From fd3ba131307c9cc54f69d8f7186b2786e73da9a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Oct 2015 21:33:47 +0200 Subject: [PATCH 01/45] FIX #3541 Bypass authentication when user was created using LDAP --- htdocs/core/login/functions_dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 36596165191..c421fdb1aeb 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -91,7 +91,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= if (! $passok) { if ((! $passcrypted || $passtyped) - && ($passtyped == $passclear)) + && ($passclear && ($passtyped == $passclear))) { $passok=true; dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database"); From 6a90431cf1d4f0853041538203f461a05ff91d3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Oct 2015 14:04:47 +0200 Subject: [PATCH 02/45] Prepare 3.8.2 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index ea369d8aff3..415a7addf4a 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -30,7 +30,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.1'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.2'); if (! defined('EURO')) define('EURO',chr(128)); From 9e9f32e3bf848dc965de0a55c99c89ff6798d7bc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 15:38:28 +0200 Subject: [PATCH 03/45] FIX : project was not retrieved on invoice creation form --- htdocs/compta/facture.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index de0a591cf98..6368dd00831 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1877,7 +1877,7 @@ if ($action == 'create') $objectsrc->fetch_lines(); $objectsrc->fetch_thirdparty(); - $projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); + $projectid = (! empty($projectid) ? $projectid : $objectsrc->fk_project); $ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : ''); $ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : ''); @@ -2257,9 +2257,6 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled) && $socid > 0) { - $projectid = GETPOST('projectid')?GETPOST('projectid'):0; - if ($origin == 'project') $projectid = ($originid ? $originid : 0); - $langs->load('projects'); print '' . $langs->trans('Project') . ''; $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0); From 5fb6705b5c57e14523c71f655b3231d0ab394ece Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 15:53:13 +0200 Subject: [PATCH 04/45] FIX : Search status not saved into list --- htdocs/compta/facture/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2f87ff09e8b..2adab72dc1c 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -270,6 +270,7 @@ if ($resql) if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; + if ($search_status != '') $param.='&search_status='.$search_status; print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png'); $i = 0; From 572be23fc1e2716b64ae584d5ea288b4b9831e72 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 15:57:23 +0200 Subject: [PATCH 05/45] FIX : filters on supplier invoices list are not used, search_status instead --- htdocs/fourn/facture/list.php | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index dc8adddec39..a2b48c253df 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -81,7 +81,6 @@ $year = GETPOST("year","int"); $day_lim = GETPOST('day_lim','int'); $month_lim = GETPOST('month_lim','int'); $year_lim = GETPOST('year_lim','int'); -$filter = GETPOST("filtre"); if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers { @@ -91,9 +90,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_company=""; $search_amount_no_tax=""; $search_amount_all_tax=""; + $search_status=""; $year=""; $month=""; - $filter=""; } /* @@ -147,15 +146,6 @@ if ($socid) { $sql .= " AND s.rowid = ".$socid; } -if ($filter && $filter != -1) // GETPOST('filtre') may be a string -{ - $filtrearr = explode(",", $filter); - foreach ($filtrearr as $fil) - { - $filt = explode(":", $fil); - $sql .= " AND " . $filt[0] . " = " . $filt[1]; - } -} if ($search_ref) { @@ -214,7 +204,7 @@ if ($search_amount_all_tax != '') if ($search_status != '') { - $sql.= " AND fac.fk_statut = '".$db->escape($search_status)."'"; + $sql.= " AND fac.fk_statut = ".$search_status; } $nbtotalofrecords = 0; @@ -248,7 +238,7 @@ if ($resql) if ($search_company) $param.='&search_company='.urlencode($search_company); if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); - if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter); + if ($search_status >= 0) $param.="&search_status=".$search_status; print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print '
'; @@ -305,8 +295,8 @@ if ($resql) print ''; print ''; print ''; - $liststatus=array('fac.fk_statut:0'=>$langs->trans("Draft"),'fac.fk_statut:1,paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid")); - print $form->selectarray('filtre', $liststatus, $filter, 1); + $liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); + print $form->selectarray('filtre', $liststatus, $search_status, 1); print ''; print ''; print ''; From d79fb7198762e09f0c07055f1086211878dc7f8b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 19 Oct 2015 16:17:47 +0200 Subject: [PATCH 06/45] FIX : search_status not used in mergefusiontool --- htdocs/compta/facture/mergepdftool.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php index 5acca49d1b1..ea0eedfa36a 100644 --- a/htdocs/compta/facture/mergepdftool.php +++ b/htdocs/compta/facture/mergepdftool.php @@ -417,6 +417,7 @@ $search_societe = GETPOST("search_societe"); $search_paymentmode = GETPOST("search_paymentmode"); $search_montant_ht = GETPOST("search_montant_ht"); $search_montant_ttc = GETPOST("search_montant_ttc"); +$search_status = GETPOST("search_status"); $late = GETPOST("late"); // Do we click on purge search criteria ? @@ -428,6 +429,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_paymentmode=''; $search_montant_ht=''; $search_montant_ttc=''; + $search_status=''; } $sortfield = GETPOST("sortfield",'alpha'); @@ -483,6 +485,7 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmo if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'"; if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'"; +if ($search_status) $sql .= " AND f.fk_statut = ".$search_status; if ($month > 0) { if ($year > 0) @@ -528,6 +531,7 @@ if ($resql) if ($search_societe) $param.='&search_paymentmode='.urlencode($search_paymentmode); if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); + if ($search_status) $param.='&search_status='.urlencode($search_status); if ($late) $param.='&late='.urlencode($late); if ($mode) $param.='&mode='.urlencode($mode); $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; From 7d382f7997fec9d9fbdb5e199c8e5befb18dfa11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Oct 2015 18:16:28 +0200 Subject: [PATCH 07/45] FIX Revert option WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES into option WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED for better compatibility with old versions --- htdocs/comm/propal.php | 2 +- htdocs/langs/en_US/workflow.lang | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index bcfaa747cab..fd6794c3d44 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2223,7 +2223,7 @@ if ($action == 'create') } $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); - if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || ! empty($conf->global->WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES)) + if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) { print ''; } diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index 7414fcb7e62..14be1a6ade6 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -3,9 +3,9 @@ WorkflowSetup=Workflow module setup WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is open (you can do things in the order you want). You can activate the automatic actions you are interested in. ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules. descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a customer order after a commercial proposal is signed -descWORKFLOW_PROPAL_AUTOCREATE_INVOICEAutomatically create a customer invoice after a commercial proposal is signed -descWORKFLOW_CONTRACT_AUTOCREATE_INVOICEAutomatically create a customer invoice after a contract is validated -descWORKFLOW_ORDER_AUTOCREATE_INVOICEAutomatically create a customer invoice after a customer order is closed +descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Automatically create a customer invoice after a commercial proposal is signed +descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice after a contract is validated +descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a customer order is closed descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated From 5237a2afc7bf155cbdc8a73bcaeefb90264084ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Oct 2015 17:45:24 +0200 Subject: [PATCH 08/45] Fix lost searchstatus on next page list --- htdocs/compta/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2f87ff09e8b..87b27ef8199 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -69,7 +69,7 @@ $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_ttc=GETPOST('search_montant_ttc','alpha'); -$search_status=GETPOST('search_status','alpha'); +$search_status=GETPOST('search_status','int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -270,6 +270,7 @@ if ($resql) if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; + if ($search_status > 0) $param.='&search_status='.$search_status; print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png'); $i = 0; From 4689b0cc11846010f43b29aeb64db4d298994c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Oct 2015 17:31:51 +0200 Subject: [PATCH 09/45] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 492663295b8..51602cafe1c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1571,6 +1571,7 @@ class CommandeFournisseur extends CommonOrder $result=$this->call_trigger('ORDER_SUPPLIER_DELETE',$user); if ($result < 0) { + $this->errors[]='ErrorWhenRunningTrigger'; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); return -1; } @@ -1583,6 +1584,8 @@ class CommandeFournisseur extends CommonOrder dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql) ) { + $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } @@ -1593,12 +1596,14 @@ class CommandeFournisseur extends CommonOrder if ($this->db->affected_rows($resql) < 1) { $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } } else { $this->error=$this->db->lasterror(); + $this->errors[]=$this->db->lasterror(); $error++; } @@ -1608,6 +1613,8 @@ class CommandeFournisseur extends CommonOrder $result=$this->deleteExtraFields(); if ($result < 0) { + $this->error='FailToDeleteExtraFields'; + $this->errors[]='FailToDeleteExtraFields'; $error++; dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); } @@ -1615,7 +1622,11 @@ class CommandeFournisseur extends CommonOrder // Delete linked object $res = $this->deleteObjectLinked(); - if ($res < 0) $error++; + if ($res < 0) { + $this->error='FailToDeleteObjectLinked'; + $this->errors[]='FailToDeleteObjectLinked'; + $error++; + } if (! $error) { @@ -1630,6 +1641,7 @@ class CommandeFournisseur extends CommonOrder if (! dol_delete_file($file,0,0,0,$this)) // For triggers { $this->error='ErrorFailToDeleteFile'; + $this->errors[]='ErrorFailToDeleteFile'; $error++; } } @@ -1639,6 +1651,7 @@ class CommandeFournisseur extends CommonOrder if (! $res) { $this->error='ErrorFailToDeleteDir'; + $this->errors[]='ErrorFailToDeleteDir'; $error++; } } From 3767ab437e6ba5cc126977ac5419ef818c4b5819 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Fri, 23 Oct 2015 12:58:30 +0200 Subject: [PATCH 10/45] [Qual] Uniformize code --- htdocs/accountancy/bookkeeping/card.php | 26 +++++----- htdocs/accountancy/bookkeeping/list.php | 4 +- htdocs/accountancy/customer/card.php | 2 +- htdocs/accountancy/customer/index.php | 4 +- htdocs/accountancy/customer/lines.php | 6 +-- htdocs/accountancy/journal/bankjournal.php | 6 +-- .../accountancy/journal/purchasesjournal.php | 8 +-- htdocs/accountancy/journal/sellsjournal.php | 8 +-- htdocs/accountancy/supplier/card.php | 2 +- htdocs/accountancy/supplier/index.php | 4 +- htdocs/accountancy/supplier/lines.php | 6 +-- htdocs/adherents/admin/adherent.php | 6 +-- htdocs/adherents/admin/public.php | 4 +- htdocs/adherents/card.php | 50 +++++++++---------- htdocs/adherents/card_subscriptions.php | 6 +-- htdocs/adherents/ldap.php | 4 +- htdocs/admin/agenda.php | 4 +- htdocs/admin/agenda_extsites.php | 6 +-- htdocs/admin/agenda_xcal.php | 4 +- htdocs/admin/askpricesupplier.php | 28 +++++------ htdocs/admin/bank.php | 4 +- htdocs/admin/barcode.php | 8 +-- htdocs/admin/boxes.php | 4 +- htdocs/admin/clicktodial.php | 4 +- htdocs/admin/commande.php | 34 ++++++------- htdocs/admin/company.php | 12 ++--- htdocs/admin/compta.php | 6 +-- htdocs/admin/const.php | 8 +-- htdocs/admin/contract.php | 18 +++---- htdocs/admin/dict.php | 18 +++---- htdocs/admin/menus/edit.php | 14 +++--- htdocs/admin/menus/index.php | 4 +- htdocs/admin/tools/dolibarr_export.php | 4 +- htdocs/admin/tools/export.php | 10 ++-- htdocs/admin/tools/update.php | 14 +++--- 35 files changed, 175 insertions(+), 175 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index d4c256dfbf2..0500ac4a0a7 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -52,7 +52,7 @@ if ($action == "confirm_update") { $error = 0; if ((floatval($debit)!=0.0) && (floatval($credit)!=0.0)) { - setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); + setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); $error ++; } @@ -61,7 +61,7 @@ if ($action == "confirm_update") { $result = $book->fetch($id); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { $book->numero_compte = $numero_compte; $book->code_tiers = $code_tiers; @@ -80,9 +80,9 @@ if ($action == "confirm_update") { $result = $book->update(); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; } } @@ -93,7 +93,7 @@ else if ($action == "add") { $error = 0; if ((intval($debit) != 0) && (intval($credit) != 0)) { - setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); + setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); $error ++; } @@ -124,9 +124,9 @@ else if ($action == "add") { $result = $book->create_std($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; } } @@ -140,11 +140,11 @@ else if ($action == "confirm_delete") { $piece_num = $book->piece_num; if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { $result = $book->delete($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } } $action = ''; @@ -168,9 +168,9 @@ else if ($action == "confirm_create") { $result = $book->create_std($user); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { - setEventMessage($langs->trans('Saved'), 'mesgs'); + setEventMessages($langs->trans('Saved'), null, 'mesgs'); $action = ''; $piece_num = $book->piece_num; } @@ -246,7 +246,7 @@ if ($action == 'create') { $book = new BookKeeping($db); $result = $book->fetch_per_mvt($piece_num); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } if (! empty($book->piece_num)) { @@ -277,7 +277,7 @@ if ($action == 'create') { $result = $book->fetch_all_per_mvt($piece_num); if ($result < 0) { - setEventMessage($book->errors, 'errors'); + setEventMessages($book->error, $book->errors, 'errors'); } else { print load_fiche_titre($langs->trans("ListeMvts")); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index d9b6d66b503..b9164329031 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -74,7 +74,7 @@ if ($action == 'delbookkeeping') { $result = $object->delete_by_importkey($import_key); Header("Location: list.php"); if ($result < 0) { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } // Export @@ -86,7 +86,7 @@ else if ($action == 'export_csv') { $object = new BookKeeping($db); $result = $object->export_bookkeping('ebp'); if ($result < 0) { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } foreach ( $object->linesexport as $line ) { diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 09e8b24a8ea..a3e179c1701 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -54,7 +54,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } else { header("Location: ./lines.php"); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index ea37f237455..5a6de05691a 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -83,10 +83,10 @@ if ($action == 'validatehistory') { if (! $resql1) { $error ++; $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } else { $db->commit(); - setEventMessage($langs->trans('Dispatched'), 'mesgs'); + setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); } } diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 01f34e700cc..a505c91c1c7 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -109,14 +109,14 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $resql1 = $db->query($sql1); if (! $resql1) { $error ++; - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } if (! $error) { $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); + setEventMessages($langs->trans('Save'), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 01957fcedf5..cd0c5d06ce5 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -343,7 +343,7 @@ if ($action == 'writeBookKeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } // Third party @@ -420,13 +420,13 @@ if ($action == 'writeBookKeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } // Export diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 28b2dc736b6..538edaa471d 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -185,7 +185,7 @@ if ($action == 'writebookkeeping') { $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -215,7 +215,7 @@ if ($action == 'writebookkeeping') { $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -246,14 +246,14 @@ if ($action == 'writebookkeeping') { $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 4437535738a..aaf3beea8a1 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -220,7 +220,7 @@ if ($action == 'writebookkeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -250,7 +250,7 @@ if ($action == 'writebookkeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -282,14 +282,14 @@ if ($action == 'writebookkeeping') $result = $bookkeeping->create(); if ($result < 0) { $error ++; - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } } if (empty($error)) { - setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } } diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index f0747c8d29c..61b225fbc16 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -55,7 +55,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { dol_syslog('accountancy/supplier/card.php:: $sql=' . $sql); $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } else { header("Location: ./lines.php"); diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 954eb60300c..ec18d8b1e23 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -79,10 +79,10 @@ if ($action == 'validatehistory') { if (! $resql1) { $error ++; $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } else { $db->commit(); - setEventMessage($langs->trans('Dispatched'), 'mesgs'); + setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); } } diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index f475e7046ad..e703bca6f2d 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -115,14 +115,14 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $resql1 = $db->query($sql1); if (! $resql1) { $error ++; - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } if (! $error) { $db->commit(); - setEventMessage($langs->trans('Save'), 'mesgs'); + setEventMessages($langs->trans('Save'), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); } } diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 5827e1d22d7..8e265eb70f7 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -69,11 +69,11 @@ if ($action == 'update' || $action == 'add') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index 58cb7bb2f41..6f5d1de5c87 100644 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -60,11 +60,11 @@ if ($action == 'update') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 355aedb3e68..f998c2f08a3 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García - * Copyright (C) 2012-2013 Philippe Grand + * Copyright (C) 2012-2015 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -133,7 +133,7 @@ if (empty($reshook)) if ($userid != $user->id && $userid != $object->user_id) { $error++; - setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors'); + setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } @@ -169,7 +169,7 @@ if (empty($reshook)) $thirdparty=new Societe($db); $thirdparty->fetch($socid); $error++; - setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors'); + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors'); } } @@ -195,12 +195,12 @@ if (empty($reshook)) if ($result < 0) { $langs->load("errors"); - setEventMessage($langs->trans($nuser->error), 'errors'); + setEventMessages($langs->trans($nuser->error), null, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->errors, $object->error, 'errors'); } } @@ -216,13 +216,13 @@ if (empty($reshook)) if ($result < 0) { $langs->load("errors"); - setEventMessage($langs->trans($company->error), 'errors'); - setEventMessage($company->errors, 'errors'); + setEventMessages($langs->trans($company->error), null, 'errors'); + setEventMessages($company->error, $company->errors, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -236,7 +236,7 @@ if (empty($reshook)) $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); $langs->load("mails"); - setEventMessage($langs->trans("MailSuccessfulySent", $from, $object->email)); + setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs'); } } @@ -352,7 +352,7 @@ if (empty($reshook)) $newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']); if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0) { - setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } else { @@ -368,7 +368,7 @@ if (empty($reshook)) } else { - setEventMessage("ErrorBadImageFormat", 'errors'); + setEventMessages("ErrorBadImageFormat", null, 'errors'); } } else @@ -397,9 +397,9 @@ if (empty($reshook)) else { if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action=''; } @@ -503,7 +503,7 @@ if (empty($reshook)) if ($num) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorLoginAlreadyExists",$login), 'errors'); + setEventMessages($langs->trans("ErrorLoginAlreadyExists",$login), null, 'errors'); } } if (empty($pass)) { @@ -528,7 +528,7 @@ if (empty($reshook)) if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadEMail",$email), 'errors'); + setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); } $public=0; if (isset($public)) $public=1; @@ -554,9 +554,9 @@ if (empty($reshook)) $db->rollback(); if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action = 'create'; @@ -609,7 +609,7 @@ if (empty($reshook)) if ($result < 0) { $error++; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -617,9 +617,9 @@ if (empty($reshook)) { $error++; if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -654,7 +654,7 @@ if (empty($reshook)) if ($result < 0) { $error++; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else @@ -662,9 +662,9 @@ if (empty($reshook)) $error++; if ($object->error) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } $action=''; } @@ -683,7 +683,7 @@ if (empty($reshook)) { if (!$mailmanspip->del_to_spip($object)) { - setEventMessage($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, 'errors'); + setEventMessages($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, null, 'errors'); } } } @@ -694,7 +694,7 @@ if (empty($reshook)) { if (!$mailmanspip->add_to_spip($object)) { - setEventMessage($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, 'errors'); + setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors'); } } } diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index fa440c3bac4..9d86f618618 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -110,7 +110,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights { $langs->load("errors"); $errmsg=$langs->trans($company->error); - setEventMessage($company->errors, 'errors'); + setEventMessages($company->error, $company->errors, 'errors'); } else { @@ -131,7 +131,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id) { $error++; - setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors'); + setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } @@ -167,7 +167,7 @@ if ($action == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch(GETPOST('socid','int')); $error++; - setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors'); + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors'); } } diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index a2848b655b3..4d9a779d579 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -72,12 +72,12 @@ if ($action == 'dolibarr2ldap') if ($result >= 0) { - setEventMessage($langs->trans("MemberSynchronized")); + setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs'); $db->commit(); } else { - setEventMessage($ldap->error, 'errors'); + setEventMessages($ldap->errors, $ldap->error, 'errors'); $db->rollback(); } } diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 287f2a897eb..c11cbeff3a4 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -86,12 +86,12 @@ if ($action == "save" && empty($cancel)) if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); $db->commit(); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"),null, 'errors'); $db->rollback(); } } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9356674921e..755d1eb23f9 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -72,7 +72,7 @@ if ($actionsave) if (! empty($src) && ! dol_is_url($src)) { - setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors'); + setEventMessages($langs->trans("ErrorParamMustBeAnUrl"), null, 'errors'); $error++; $errorsaved++; break; @@ -104,12 +104,12 @@ if ($actionsave) if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors'); + if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index dfdac2a8f0f..cd2406e6fdc 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -54,12 +54,12 @@ if ($actionsave) if ($i >= 4) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("SaveFailed"), 'errors'); + setEventMessages($langs->trans("SaveFailed"), null, 'errors'); } } diff --git a/htdocs/admin/askpricesupplier.php b/htdocs/admin/askpricesupplier.php index 9bde4673ace..9afcd1a8f62 100644 --- a/htdocs/admin/askpricesupplier.php +++ b/htdocs/admin/askpricesupplier.php @@ -6,8 +6,8 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -54,11 +54,11 @@ if ($action == 'updateMask') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -96,13 +96,13 @@ if ($action == 'specimen') } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -116,11 +116,11 @@ if ($action == 'set_ASKPRICESUPPLIER_DRAFT_WATERMARK') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -134,11 +134,11 @@ if ($action == 'set_ASKPRICESUPPLIER_FREE_TEXT') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -150,11 +150,11 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -178,12 +178,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 8214755fd2b..048e351044d 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -56,11 +56,11 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index b36a222c165..0a57508c271 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -97,11 +97,11 @@ if ($action == 'setModuleOptions') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'msgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -111,11 +111,11 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 6b1eb71fafe..5b6d64801b5 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -85,7 +85,7 @@ if ($action == 'add') { } else { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); $error++; } } @@ -121,7 +121,7 @@ if ($action == 'add') { $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->lasterror(), 'errors'); + setEventMessages($db->lasterror(), null, 'errors'); $error++; } } diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 1550c0ebef7..260a9514375 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -41,11 +41,11 @@ if ($action == 'setvalue' && $user->admin) $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity); if ($result >= 0) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index f7e3812d74f..9e55369dac9 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -64,11 +64,11 @@ if ($action == 'updateMask') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -106,13 +106,13 @@ else if ($action == 'specimen') } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -137,12 +137,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -196,11 +196,11 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -214,11 +214,11 @@ else if ($action == 'set_ORDER_FREE_TEXT') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -228,9 +228,9 @@ else if ($action=="setshippableiconinlist") { $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); if (! $res > 0) $error++; if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -243,11 +243,11 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -260,11 +260,11 @@ else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index b9660c8a04d..e84bdf2a3fa 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -125,19 +125,19 @@ if ( ($action == 'update' && empty($_POST["cancel"])) $error++; $langs->load("errors"); $tmparray=explode(':',$result); - setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors'); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); } else { $error++; - setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors'); + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } } else { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); } } } @@ -230,7 +230,7 @@ if ($action == 'addthumb') { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); } } @@ -238,7 +238,7 @@ if ($action == 'addthumb') { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors'); + setEventMessages($langs->trans("ErrorFileDoesNotExists",$_GET["file"]), null, 'errors'); dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); } } diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 633f88b9cfb..38ba28e9fa4 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -87,11 +87,11 @@ if ($action == 'update') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 62f6bbaaf2c..06e3279fa54 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -68,7 +68,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) { if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0) { - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=""; $constname=""; $constvalue=""; @@ -99,7 +99,7 @@ if (! empty($consts) && $action == 'update') } } } - if ($nbmodified > 0) setEventMessage($langs->trans("RecordSaved")); + if ($nbmodified > 0) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=''; } @@ -122,7 +122,7 @@ if (! empty($consts) && $action == 'delete') } } } - if ($nbdeleted > 0) setEventMessage($langs->trans("RecordDeleted")); + if ($nbdeleted > 0) setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); $action=''; } @@ -131,7 +131,7 @@ if ($action == 'delete') { if (dolibarr_del_const($db, $rowid, $entity) >= 0) { - setEventMessage($langs->trans("RecordDeleted")); + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } else { diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index a45045a5381..3198ad51448 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2014 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -59,11 +59,11 @@ if ($action == 'updateMask') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessage($langs->trans("Error"), null, 'errors'); } } @@ -101,13 +101,13 @@ else if ($action == 'specimen') // For contract } else { - setEventMessage($obj->error,'errors'); + setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -132,12 +132,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -194,11 +194,11 @@ else if ($action == 'set_other') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 40b4676ba25..817019cc24b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel @@ -548,20 +548,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible'; if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder'; - setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } } // Other checks if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { $ok=0; - setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors'); + setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); } if (isset($_POST["code"])) { if ($_POST["code"]=='0') { $ok=0; - setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors'); + setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); } /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base { @@ -578,7 +578,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) else { $ok=0; - setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); } } @@ -637,13 +637,13 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $result = $db->query($sql); if ($result) // Add is ok { - setEventMessage($langs->transnoentities("RecordSaved")); + setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); $_POST=array('id'=>$id); // Clean $_POST array, we keep only } else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { - setEventMessage($langs->transnoentities("ErrorRecordAlreadyExists"),'errors'); + setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); } else { dol_print_error($db); @@ -687,7 +687,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $resql = $db->query($sql); if (! $resql) { - setEventMessage($db->error(),'errors'); + setEventMessage($db->error(), 'errors'); } } //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition @@ -711,7 +711,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete { if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') { - setEventMessage($langs->transnoentities("ErrorRecordIsUsedByChild"),'errors'); + setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); } else { diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 7c60a2ee055..b7f4b8d5b73 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -78,16 +78,16 @@ if ($action == 'update') $result=$menu->update($user); if ($result > 0) { - setEventMessage($langs->trans("RecordModifiedSuccessfully")); + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } else { - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } } else { - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } $_GET["menuId"] = $_POST['menuId']; $action = "edit"; @@ -159,13 +159,13 @@ if ($action == 'add') } if (! $error && $_POST['menuId'] && $_POST['type'] == 'top') { - setEventMessage($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), 'errors'); + setEventMessages($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), null, 'errors'); $action = 'create'; $error++; } if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left') { - setEventMessage($langs->trans("ErrorLeftMenuMustHaveAParentId"), 'errors'); + setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors'); $action = 'create'; $error++; } @@ -204,7 +204,7 @@ if ($action == 'add') else { $action = 'create'; - setEventMessage($menu->error, 'errors'); + setEventMessages($menu->error, $menu->errors, 'errors'); } } } @@ -222,7 +222,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') $this->db->commit(); llxHeader(); - setEventMessage($langs->trans("MenuDeleted")); + setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs'); llxFooter(); exit ; } diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index c8699209268..7da0673b196 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -186,7 +186,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes') { $db->commit(); - setEventMessage($langs->trans("MenuDeleted")); + setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs'); header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler); exit ; @@ -359,7 +359,7 @@ if ($conf->use_javascript_ajax) else { $langs->load("errors"); - setEventMessage($langs->trans("ErrorFeatureNeedJavascript"), 'errors'); + setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors'); } print '
'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index a460f667e2a..49d229898b8 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -52,8 +52,8 @@ if ($action == 'delete') { $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); $action=''; } diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 500c766ed77..cddd42a8623 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -60,8 +60,8 @@ if ($action == 'delete') { $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); $action=''; } @@ -357,7 +357,7 @@ if ($what == 'postgresql') //{ if ($errormsg) { - setEventMessage($langs->trans("Error")." : ".$errormsg, 'errors'); + setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors'); $resultstring=''; $resultstring.='
'.$langs->trans("Error")." : ".$errormsg.'
'; @@ -368,7 +368,7 @@ if ($what == 'postgresql') { if ($what) { - setEventMessage($langs->trans("BackupFileSuccessfullyCreated").'.
'.$langs->trans("YouCanDownloadBackupFile")); + setEventMessages($langs->trans("BackupFileSuccessfullyCreated").'.
'.$langs->trans("YouCanDownloadBackupFile"), null, 'mesgs'); $resultstring='
'; $resultstring.=$langs->trans("BackupFileSuccessfullyCreated").'.
'; @@ -379,7 +379,7 @@ if ($what == 'postgresql') } else { - setEventMessage($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user)); + setEventMessages($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user), null, 'mesgs'); } } //} diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 54a6cab9cbd..e1166e96c3d 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -34,7 +34,7 @@ $action=GETPOST('action','alpha'); if (! $user->admin) accessforbidden(); if (GETPOST('msg','alpha')) { - setEventMessage(GETPOST('msg','alpha'), 'errors'); + setEventMessages(GETPOST('msg','alpha'), null, 'errors'); } @@ -63,7 +63,7 @@ if ($action=='install') if (! $original_file) { $langs->load("Error"); - setEventMessage($langs->trans("ErrorFileRequired"), 'warnings'); + setEventMessages($langs->trans("ErrorFileRequired"), null, 'warnings'); $error++; } else @@ -71,7 +71,7 @@ if ($action=='install') if (! preg_match('/\.zip/i',$original_file)) { $langs->load("errors"); - setEventMessage($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), 'errors'); + setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors'); $error++; } } @@ -99,7 +99,7 @@ if ($action=='install') if (! empty($result['error'])) { $langs->load("errors"); - setEventMessage($langs->trans($result['error'],$original_file), 'errors'); + setEventMessages($langs->trans($result['error'],$original_file), null, 'errors'); $error++; } else @@ -116,7 +116,7 @@ if ($action=='install') //var_dump($modulenamedir); if (! dol_is_dir($modulenamedir)) { - setEventMessage($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), 'errors'); + setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors'); $error++; } } @@ -128,7 +128,7 @@ if ($action=='install') $result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1); if ($result <= 0) { - setEventMessage($langs->trans("ErrorFailedToCopy"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToCopy"), null, 'errors'); $error++; } } @@ -142,7 +142,7 @@ if ($action=='install') if (! $error) { - setEventMessage($langs->trans("SetupIsReadyForUse")); + setEventMessages($langs->trans("SetupIsReadyForUse"), null, 'mesgs'); } } From a01a85c3f6eb7afc589f7c666a2533647d8e9d32 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Oct 2015 15:13:02 +0200 Subject: [PATCH 11/45] FIX tag object_total_vat_x need x to be a string with unknown decimal lenght. Now use for x the real vat real with no more decimal (x = 20 or x = 8.5 or x = 5.99, ...) --- htdocs/core/class/commondocgenerator.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 41ae45ef638..24c2fe34a93 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -388,11 +388,16 @@ abstract class CommonDocGenerator // Add vat by rates foreach ($object->lines as $line) { + // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0; $resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva; $resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]); + // $vatformated is vat without not expected chars (so 20, or 8.5 or 5.99 for example) + $vatformated=vatrate($line->tva_tx); + if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0; + $resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva; + $resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]); } - // Retrieve extrafields if (is_array($object->array_options) && count($object->array_options)) { From 2cbfb69f9b70c851cd2e13a25010d91ab472f843 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Oct 2015 15:28:14 +0200 Subject: [PATCH 12/45] Update template --- .../invoices/template_invoice.odt | Bin 25534 -> 37996 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/install/doctemplates/invoices/template_invoice.odt b/htdocs/install/doctemplates/invoices/template_invoice.odt index e9cd7c836fb0363394d73d3579ca7f84cb33cb01..dad29a292efcae907c1af651f8caae0fba453ec1 100644 GIT binary patch delta 36631 zcmaf4<5%b1+s!q3GADOu+qP}je6x*DZnA5#ZQGMQ*|zO^=Jyvoug;rmt#j5nm-fE) z=^h3@FNHu>l7)oA00V;q1GBT#l#EA~M*iOl=XhBrWdjB#Ws{hOB@Ec0NQ()pd1Rh< z{fr|Yb)`JcGncT+N=_?s)odzXoZFaV#WC^+XA+H*4E$qaNi1BqPWA*EqDbA(&YHcP zTAZ4)yTZPTl66Ym{~-;B1_liV0f{KlxVVtt-l$Mzeth?9q_P@s_BVsv5+clt1syL< z|G>b&$DsF>_vbrz^%=l(tQ58xaQ)N)PWURM8YakdPjz}N8TLb*@bh@4pmczU&G8A6b>PK&SfoV3|Ja*qdPEcSi21v*jWD;Z!n4ga>x|0 zQHb9F52A{-kt?A`N3R2hUMGCuccB7eO$cxlEd!WBBmx1r%T2I+WO#9hYhtc1yx*A+ zLNMtN3Am`Yfd^1HxM0qA{(pqJAvy(^*x;l(DP#pk{&(lSX5XVAUZ7etVRCRFzh0($ z4L`m;UjfJlJ>RUPXINqE44_spxIU?a1UUeUUf|XF`s@AY_2d_V&o1{`D;T|Pp z;EhW~_x!j8J_`By(E|}C*+=wF{d}Mp`1SDAH-dXTPtNrP)9QdQuR^>CTfGhr+`ny4 ze<3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A78m>?+}%>7F4AjSN1WryE#MRQcTr zQQtOSst}N&fR(UDT#sg@sn<@kF}h}QtZTAN6X5%E^kUKXdNGrQBG!I3DWgT2IA-A(|J4?6FE3~yKXg$r5$qgzHX0u%=qz0 z*H!$i*=i5|sWR3P=F-ZswjM+MPTB1tmjTjwDh0Cqc+0kZgIqJga%Cs3mu6Ao9yj@< zo^S_P`p}t?TSTSe+o0@CtX4X>25z08jnQ@_WNzhwpO^?$<#nDuyn_M$q)*C*k;1mv zOdIsA&%x`$tSA|aP<*U+t9J_B$|ia7E;S1gi61@&=TmdXFz=gd-ueV-l096qQIoPx zk!()k^{#v_!CD*Ryp>ldi1v Date: Fri, 23 Oct 2015 19:01:50 +0200 Subject: [PATCH 13/45] Update index.php --- htdocs/accountancy/customer/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index ea37f237455..5cf4dac19b1 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -86,7 +86,7 @@ if ($action == 'validatehistory') { setEventMessage($db->lasterror(), 'errors'); } else { $db->commit(); - setEventMessage($langs->trans('Dispatched'), 'mesgs'); + setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); } } @@ -346,4 +346,4 @@ print "\n"; print ''; llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); From 3015a0388a41458fabc27d3bd7e40b5bde42b7ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 16:09:26 +0200 Subject: [PATCH 14/45] NEW List of projects of a thirdparty are visible on a project tab --- htdocs/core/lib/company.lib.php | 26 ++-- htdocs/projet/card.php | 4 +- htdocs/societe/agenda.php | 41 ++--- htdocs/societe/class/societe.class.php | 14 +- htdocs/societe/notify/card.php | 2 + htdocs/societe/price.php | 208 +++++++++++++------------ htdocs/societe/project.php | 156 +++++++++++++++++++ htdocs/societe/soc.php | 3 - 8 files changed, 318 insertions(+), 136 deletions(-) create mode 100644 htdocs/societe/project.php diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 86c5f717f4b..70988d7e330 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -91,6 +91,13 @@ function societe_prepare_head(Societe $object) $head[$h][2] = 'agenda'; $h++; } + if (! empty($conf->projet->enabled) && (!empty($user->rights->projet->lire) )) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Projects"); + $head[$h][2] = 'project'; + $h++; + } //show categorie tab /*if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { @@ -456,9 +463,10 @@ function getFormeJuridiqueLabel($code) * @param DoliDB $db Database handler * @param Object $object Third party object * @param string $backtopage Url to go once contact is created + * @param int $nocreatelink 1=Hide create project link * @return void */ -function show_projects($conf,$langs,$db,$object,$backtopage='') +function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0) { global $user; global $bc; @@ -470,7 +478,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') $langs->load("projects"); $buttoncreate=''; - if (! empty($conf->projet->enabled) && $user->rights->projet->creer) + if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { //$buttoncreate=''.$langs->trans("AddProject").''; $buttoncreate=''.$langs->trans("AddProject"); @@ -864,13 +872,13 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='') /** * Show html area with actions to do * - * @param Conf $conf Object conf - * @param Translate $langs Object langs - * @param DoliDB $db Object db - * @param Adherent|Societe $object Object third party or member - * @param Contact $objcon Object contact - * @param int $noprint Return string but does not output it - * @return mixed Return html part or void if noprint is 1 + * @param Conf $conf Object conf + * @param Translate $langs Object langs + * @param DoliDB $db Object db + * @param Adherent|Societe $object Object third party or member + * @param Contact $objcon Object contact + * @param int $noprint Return string but does not output it + * @return mixed Return html part or void if noprint is 1 */ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) { diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e5000d008f2..748f91dbefe 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -624,7 +624,7 @@ else print ''.$langs->trans("Label").''; print ''; - // Customer + // Thirdparty print ''.$langs->trans("ThirdParty").''; $filteronlist=''; if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; @@ -713,7 +713,7 @@ else // Third party print ''.$langs->trans("ThirdParty").''; - if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1); + if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project'); else print' '; print ''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index b35715ce1ab..3d72ad9d328 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -121,17 +121,34 @@ if ($socid) dol_fiche_end(); - /* + + + /* * Barre d'action */ - print '
'; + $objthirdparty=$object; + $objcon=new stdClass(); + + $out=''; + $permok=$user->rights->agenda->myactions->create; + if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) + { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + print '
'; if (! empty($conf->agenda->enabled)) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) { - print ''.$langs->trans("AddAction").''; + print ''.$langs->trans("AddAction").''; } else { @@ -143,25 +160,11 @@ if ($socid) print '
'; - $objthirdparty=$object; - $objcon=new stdClass(); - $out=''; - $permok=$user->rights->agenda->myactions->create; - if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) - { - $out.=''; - $out.=$langs->trans("AddAnAction").' '; - $out.=img_picto($langs->trans("AddAnAction"),'filenew'); - $out.=""; - } - - print load_fiche_titre($langs->trans("ActionsOnCompany"),$out,''); + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); // List of todo actions - show_actions_todo($conf,$langs,$db,$object); + show_actions_todo($conf,$langs,$db,$object,null,0,1); // List of done actions show_actions_done($conf,$langs,$db,$object); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 21de67bfcf7..1f5f10c9178 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1747,12 +1747,12 @@ class Societe extends CommonObject * Return a link on thirdparty (with picto) * * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) - * @param string $option Target of link ('', 'customer', 'prospect', 'supplier') + * @param string $option Target of link ('', 'customer', 'prospect', 'supplier', 'project') * @param int $maxlen Max length of name * @param integer $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0) + function getNomUrl($withpicto=0, $option='', $maxlen=0, $notooltip=0) { global $conf,$langs; @@ -1795,6 +1795,16 @@ class Societe extends CommonObject $label.= '' . $langs->trans("ShowSupplier") . ''; $link = ''; + $link = ''; + $link = ''; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 291f81a6fe8..6a6fb7ab1df 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -195,6 +195,8 @@ if ($result > 0) print "\n"; + print '
'; + // Add notification form print load_fiche_titre($langs->trans("AddNewNotification"),'',''); diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index e5f89779225..f739c0ac6fa 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -429,107 +429,8 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } else { + // View mode - // View mode - - // Count total nb of records - $nbtotalofrecords = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter); - } - - $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); - if ($result < 0) { - setEventMessage($prodcustprice->error, 'errors'); - } - - $option = '&search_soc=' . $search_soc . '&id=' . $object->id; - - print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords); - - print ''; - print ''; - - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - if (count($prodcustprice->lines) > 0) { - - print ''; - print ''; - print ''; - // Print the search button - print ''; - print ''; - - $var = False; - - foreach($prodcustprice->lines as $line) - { - print ""; - - $staticprod = new Product($db); - $staticprod->fetch($line->fk_product); - - print ""; - print ""; - - print '"; - print '"; - print '"; - print '"; - print ''; - print ''; - - // User - $userstatic = new User($db); - $userstatic->fetch($line->fk_user); - print ''; - - // Todo Edit or delete button - // Action - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - - print "\n"; - } - } else { - print ''; - } - - print "
' . $langs->trans("Product") . '' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VAT") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '' . $langs->trans("ChangedBy") . ' 
 '; - print ''; - print '
" . $staticprod->getNomUrl(1) . "" . dol_print_date($line->datec, "dayhour") . "' . $langs->trans($line->price_base_type) . "' . vatrate($line->tva_tx, true, $line->recuperableonly) . "' . price($line->price) . "' . price($line->price_ttc) . "' . price($line->price_min) . '' . price($line->price_min_ttc) . ''; - print $userstatic->getLoginUrl(1); - print ''; - print 'id . '&prodid=' . $line->fk_product . '">'; - print img_info(); - print ''; - print ' '; - print 'id . '&lineid=' . $line->id . '">'; - print img_edit('default', 0, 'style="vertical-align: middle;"'); - print ''; - print ' '; - print 'id . '&lineid=' . $line->id . '">'; - print img_delete('default', 'style="vertical-align: middle;"'); - print ''; - print '
'.$langs->trans('NoPriceSpecificToCustomer').'
"; - - print ""; - /* ************************************************************************** */ /* */ /* Barre d'action */ @@ -541,7 +442,112 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print '
'; } - print "\n

\n"; + print "\n
\n"; + + + // Count total nb of records + $nbtotalofrecords = 0; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter); + } + + $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); + if ($result < 0) + { + setEventMessage($prodcustprice->error, 'errors'); + } + + $option = '&search_soc=' . $search_soc . '&id=' . $object->id; + + print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVEUR['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, ''); + + print '
'; + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if (count($prodcustprice->lines) > 0) + { + + print ''; + print ''; + print ''; + // Print the search button + print ''; + print ''; + + $var = False; + + foreach ($prodcustprice->lines as $line) + { + print ""; + + $staticprod = new Product($db); + $staticprod->fetch($line->fk_product); + + print ""; + print ""; + + print '"; + print '"; + print '"; + print '"; + print ''; + print ''; + + // User + $userstatic = new User($db); + $userstatic->fetch($line->fk_user); + print ''; + + // Todo Edit or delete button + // Action + if ($user->rights->produit->creer || $user->rights->service->creer) + { + print ''; + } + + print "\n"; + } + } else + { + print ''; + } + + print "
' . $langs->trans("Product") . '' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceBase") . '' . $langs->trans("VAT") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '' . $langs->trans("ChangedBy") . ' 
 '; + print ''; + print '
" . $staticprod->getNomUrl(1) . "" . dol_print_date($line->datec, "dayhour") . "' . $langs->trans($line->price_base_type) . "' . vatrate($line->tva_tx, true, $line->recuperableonly) . "' . price($line->price) . "' . price($line->price_ttc) . "' . price($line->price_min) . '' . price($line->price_min_ttc) . ''; + print $userstatic->getLoginUrl(1); + print ''; + print 'id . '&prodid=' . $line->fk_product . '">'; + print img_info(); + print ''; + print ' '; + print 'id . '&lineid=' . $line->id . '">'; + print img_edit('default', 0, 'style="vertical-align: middle;"'); + print ''; + print ' '; + print 'id . '&lineid=' . $line->id . '">'; + print img_delete('default', 'style="vertical-align: middle;"'); + print ''; + print '
' . $langs->trans('NoPriceSpecificToCustomer') . '
"; + + print "
"; + } } diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php new file mode 100644 index 00000000000..6eb9765d034 --- /dev/null +++ b/htdocs/societe/project.php @@ -0,0 +1,156 @@ + + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/societe/project.php + * \ingroup societe + * \brief Page of third party projects + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + +$langs->load("companies"); + +// Security check +$socid = GETPOST('socid','int'); +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'societe', $socid, '&societe'); + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('projectthirdparty')); + + +/* + * Actions + */ + +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + + +/* + * View + */ + +$contactstatic = new Contact($db); + +$form = new Form($db); + +if ($socid) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + + $langs->load("companies"); + + + $object = new Societe($db); + $result = $object->fetch($socid); + + $title=$langs->trans("Agenda"); + if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + llxHeader('',$title); + + if (! empty($conf->notification->enabled)) $langs->load("mails"); + $head = societe_prepare_head($object); + + dol_fiche_head($head, 'project', $langs->trans("ThirdParty"),0,'company'); + + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + + print '
'; + + print '
'; + print ''; + + // Alias names (commercial, trademark or alias names) + print '"; + + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''; + } + + if ($object->client) + { + print ''; + } + + if ($object->fournisseur) + { + print ''; + } + + print '
'.$langs->trans('AliasNames').''; + print $object->name_alias; + print "
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; + print $langs->trans('CustomerCode').''; + print $object->code_client; + if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; + print '
'; + print $langs->trans('SupplierCode').''; + print $object->code_fournisseur; + if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; + print '
'; + + print '
'; + + dol_fiche_end(); + + + /* + * Barre d'action + */ + + print '
'; + + if (! empty($conf->projet->enabled)) + { + if (! empty($conf->projet->enabled) && ! empty($user->rights->projet->creer)) + { + print ''.$langs->trans("AddProject").''; + } + else + { + print ''.$langs->trans("AddProject").''; + } + } + + print '
'; + + + print '
'; + + + // Projects list + $result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1); +} + + +llxFooter(); + +$db->close(); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 9fa6e117279..93fff61d1f1 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -2481,9 +2481,6 @@ else { $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); } - - // Projects list - $result=show_projects($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); } } From 5181afd49d17a7f3c641fe5e03146096e0459a18 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 19:29:41 +0200 Subject: [PATCH 15/45] Disable dead code --- htdocs/comm/card.php | 5 +++-- htdocs/societe/price.php | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3e20d611785..fe164006a29 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -184,7 +184,7 @@ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$title,$help_url); - +/* if ($mode == 'search') { if ($modesearch == 'soc') @@ -209,7 +209,7 @@ if ($mode == 'search') $db->free($resql); } } - +*/ if ($id > 0) { @@ -1021,6 +1021,7 @@ if ($id > 0) // List of done actions show_actions_done($conf,$langs,$db,$object); } + } else { diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index f739c0ac6fa..159dcb69d18 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -172,6 +172,8 @@ print '
'; dol_fiche_end(); + + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $prodcustprice = new Productcustomerprice($db); From b88a28b660f6073416575c2370b69c7ea88366d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 19:45:41 +0200 Subject: [PATCH 16/45] Restore compatibility with old version --- htdocs/user/class/user.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 965ac2544b8..2addea47f87 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1862,6 +1862,7 @@ class User extends CommonObject $result = ''; $companylink = ''; + $link = ''; $label = '' . $langs->trans("User") . ''; $label.= '
'; @@ -1914,7 +1915,7 @@ class User extends CommonObject $link.= '>'; $linkend=''; - if (abs($withpictoimg) == 1) $result.='
'; + //if ($withpictoimg == -1) $result.='
'; $result.=$link; if ($withpictoimg) { @@ -1929,7 +1930,7 @@ class User extends CommonObject $result.='
'.$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen).'
'; } $result.=$linkend; - if (abs($withpictoimg) == 1) $result.='
'; + //if ($withpictoimg == -1) $result.='
'; $result.=$companylink; return $result; } From 9d26d0fa4d09bdd8289e7592d477628099c6cafa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 21:13:28 +0200 Subject: [PATCH 17/45] Restore compatibility with old version --- htdocs/core/class/html.form.class.php | 11 ++++++----- htdocs/user/class/user.class.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7b472b2a163..bc26812bd29 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5255,9 +5255,10 @@ class Form * @param int $caneditfield Add edit fields * @param string $cssclass CSS name to use on img for photo * @param int $genericifundef Use a generic image if no image avaiable + * @param int $addlinktofullsize Add link to fullsize image * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0,$addlinktofullsize=1) { global $conf,$langs; @@ -5303,15 +5304,15 @@ class Form $cache='0'; if ($file && file_exists($dir."/".$file)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else if ($altfile && file_exists($dir."/".$altfile)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo alt'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2addea47f87..ae985b22be5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1922,7 +1922,7 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto').'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto',0,0).'
'; $result.=$picto; } if (abs($withpictoimg) != 2) From 461771d4885892f26df470ce5357785d491f2f93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 21:13:28 +0200 Subject: [PATCH 18/45] Currency is on title only. --- htdocs/compta/bank/account.php | 8 ++++---- htdocs/core/class/html.form.class.php | 11 ++++++----- htdocs/user/class/user.class.php | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 500cf63b021..e3bc2a3fc2c 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -952,7 +952,7 @@ if ($id > 0 || ! empty($ref)) if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("CurrentBalance"); print ' '.$object->currency_code.''; - print ''.price($total, 0, $langs, 0, 0, -1, $object->currency_code).''; + print ''.price($total).''; print ' '; print ''; } else { @@ -961,9 +961,9 @@ if ($id > 0 || ! empty($ref)) if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("Total"); print ' '.$object->currency_code.''; - print ''.price($total_deb*-1, 0, $langs, 0, 0, -1, $object->currency_code).''; - print ''.price($total_cred, 0, $langs, 0, 0, -1, $object->currency_code).''; - print ''.price($total_cred-($total_deb*-1), 0, $langs, 0, 0, -1, $object->currency_code).''; + print ''.price($total_deb*-1).''; + print ''.price($total_cred).''; + print ''.price($total_cred-($total_deb*-1)).''; print ' '; print ''; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7b472b2a163..bc26812bd29 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5255,9 +5255,10 @@ class Form * @param int $caneditfield Add edit fields * @param string $cssclass CSS name to use on img for photo * @param int $genericifundef Use a generic image if no image avaiable + * @param int $addlinktofullsize Add link to fullsize image * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0,$addlinktofullsize=1) { global $conf,$langs; @@ -5303,15 +5304,15 @@ class Form $cache='0'; if ($file && file_exists($dir."/".$file)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else if ($altfile && file_exists($dir."/".$altfile)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo alt'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2addea47f87..ae985b22be5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1922,7 +1922,7 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto').'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto',0,0).'
'; $result.=$picto; } if (abs($withpictoimg) != 2) From 1b8234d9fe416d531d7951ead1ef830893c672d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 11:09:50 +0100 Subject: [PATCH 19/45] Bette behaviour for blind people --- htdocs/contact/class/contact.class.php | 11 +++++++++-- htdocs/core/boxes/box_contacts.php | 22 +++++++++++++++++----- htdocs/index.php | 4 ++-- htdocs/langs/en_US/companies.lang | 2 +- htdocs/societe/class/societe.class.php | 18 +++++++++++++++--- htdocs/user/class/user.class.php | 16 ++++++++++++++-- 6 files changed, 58 insertions(+), 15 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9a887bf9fdb..723784d9a5d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -908,7 +908,7 @@ class Contact extends CommonObject */ function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='') { - global $langs; + global $conf, $langs; $result=''; $label = '' . $langs->trans("ShowContact") . ''; @@ -923,7 +923,14 @@ class Contact extends CommonObject $label.= '
' . $langs->trans("Phone") . ': '.join(', ',$phonelist); $label.= '
' . $langs->trans("Address") . ': '.dol_format_address($this, 1, ' ', $langs); - $link = ''; + $link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowContact"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.= ' class="classfortooltip">'; $linkend=''; if ($option == 'xxx') diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 18a09af6ace..a1fc2768ba1 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -63,8 +63,9 @@ class box_contacts extends ModeleBoxes if ($user->rights->societe->lire) { $sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status"; - $sql.= ", s.nom as socname"; - $sql.= ", s.code_client"; + $sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile"; + $sql.= ", s.nom as socname, s.name_alias"; + $sql.= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -93,10 +94,21 @@ class box_contacts extends ModeleBoxes $contactstatic->firstname=$objp->firstname; $contactstatic->civility_id=$objp->civility_id; $contactstatic->statut=$objp->status; - $societestatic->id = $objp->fk_soc; - $societestatic->code_client = $objp->code_client; + $contactstatic->phone_pro = $objp->phone; + $contactstatic->phone_perso = $objp->phone_perso; + $contactstatic->phone_mobile = $objp->phone_mobile; + $contactstatic->address = $objp->address; + $contactstatic->zip = $objp->zip; + $contactstatic->town = $objp->town; + + $societestatic->id = $objp->fk_soc; $societestatic->name = $objp->socname; - + $societestatic->name_alias = $objp->name_alias; + $societestatic->code_client = $objp->code_client; + $societestatic->code_fournisseur = $objp->code_fournisseur; + $societestatic->client = $objp->client; + $societestatic->fournisseur = $objp->fournisseur; + $this->info_box_contents[$line][] = array( 'td' => 'align="left"', 'text' => $contactstatic->getNomUrl(1), diff --git a/htdocs/index.php b/htdocs/index.php index 5db358aa34b..818da8f9ecd 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -103,7 +103,7 @@ print '
'; * Informations area */ -print ''; +print '
'; print ''; print ''; print ''; @@ -129,7 +129,7 @@ $langs->load("contracts"); if (empty($user->societe_id)) { print '
'; - print '
'.$langs->trans("Informations").'
'.$langs->trans("User").''.$user->getNomUrl(0).'
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index e3fd6fadeec..3e93a48d7b5 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -305,7 +305,7 @@ ListOfCustomersContacts=List of customer contacts ListOfSuppliersContacts=List of supplier contacts ListOfCompanies=List of companies ListOfThirdParties=List of third parties -ShowCompany=Show company +ShowCompany=Show thirdparty ShowContact=Show contact ContactsAllShort=All (No filter) ContactType=Contact type diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1f5f10c9178..fb99f819af2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1824,10 +1824,13 @@ class Societe extends CommonObject } if (! empty($this->name)) + { $label.= '
' . $langs->trans('Name') . ': '. $this->name; - if (! empty($this->code_client)) + if (! empty($this->name_alias)) $label.=' ('.$this->name_alias.')'; + } + if (! empty($this->code_client) && $this->client) $label.= '
' . $langs->trans('CustomerCode') . ': '. $this->code_client; - if (! empty($this->code_fournisseur)) + if (! empty($this->code_fournisseur) && $this->fournisseur) $label.= '
' . $langs->trans('SupplierCode') . ': '. $this->code_fournisseur; if (! empty($this->logo)) @@ -1841,7 +1844,16 @@ class Societe extends CommonObject // Add type of canvas $link.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"'; - $link.=($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip"'); + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowCompany"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.=' class="classfortooltip"'; + } $link.='>'; $linkend=''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ae985b22be5..a165a735f84 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1911,7 +1911,17 @@ class User extends CommonObject } $link.= 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $langs->load("users"); + $label=$langs->trans("ShowUser"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } $link.= '>'; $linkend=''; @@ -1927,7 +1937,9 @@ class User extends CommonObject } if (abs($withpictoimg) != 2) { - $result.='
'.$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen).'
'; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; + $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; } $result.=$linkend; //if ($withpictoimg == -1) $result.=''; From 1261ad43a1d30bd3703083aad451bb9e4f52a6d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 18:15:37 +0100 Subject: [PATCH 20/45] NEW Can select which field to show into list of users. --- htdocs/societe/list.php | 44 ++--- htdocs/user/index.php | 426 ++++++++++++++++++++++++++++++---------- 2 files changed, 340 insertions(+), 130 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 98795e27667..0e102af33f9 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -338,8 +338,8 @@ else dol_print_error($db); $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, "; $sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; -$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4,"; -$sql.= " s.fk_pays, s.tms as date_update, s.datec as date_creation,"; +$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4, s.fk_pays,"; +$sql.= " s.tms as date_update, s.datec as date_creation,"; $sql.= " typent.code as typent_code"; // We'll need these fields in order to filter by sale (including the case where the user can only see his prospects) if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; @@ -575,10 +575,10 @@ if ($resql) 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6), 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel), 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm), - 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>200), 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - ); + 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + ); $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'.$langs->trans("DolibarrStateBoard").' 
'; @@ -618,9 +618,9 @@ if ($resql) $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -795,25 +795,25 @@ if ($resql) $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (! empty($arrayfields['s.status']['checked'])) - { - // Status - print ''; - } + // Date creation if (! empty($arrayfields['s.datec']['checked'])) { - // Date creation print ''; } + // Date modification if (! empty($arrayfields['s.tms']['checked'])) { - // Date modification print ''; } + // Status + if (! empty($arrayfields['s.status']['checked'])) + { + print ''; + } // Action column print ''; - } - if (! empty($arrayfields['s.datec']['checked'])) - { - // Date creation print ''; } + // Date modification if (! empty($arrayfields['s.tms']['checked'])) { - // Date modification print ''; + } + // Status + if (! empty($arrayfields['s.status']['checked'])) + { + print ''; } // Action column print ''; diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 921697ade51..40fe8353093 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -47,6 +47,8 @@ $search_lastname=GETPOST('search_lastname','alpha'); $search_firstname=GETPOST('search_firstname','alpha'); $search_statut=GETPOST('search_statut','alpha'); $search_thirdparty=GETPOST('search_thirdparty','alpha'); +$search_supervisor=GETPOST('search_supervisor','alpha'); +$search_previousconn=GETPOST('search_previousconn','alpha'); $optioncss = GETPOST('optioncss','alpha'); if ($search_statut == '') $search_statut='1'; @@ -62,6 +64,14 @@ $limit = $conf->liste_limit; if (! $sortfield) $sortfield="u.login"; if (! $sortorder) $sortorder="ASC"; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('userlist')); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('user'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + $userstatic=new User($db); $companystatic = new Societe($db); $form = new Form($db); @@ -74,8 +84,35 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_firstname=""; $search_statut=""; $search_thirdparty=""; + $search_supervisor=""; + $search_datelastlogin=""; + $search_datepreviouslogin=""; + $search_date_creation=""; + $search_date_update=""; } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'u.login'=>"Login", + 'u.firstname'=>"Firstname", + 'u.lastname'=>"Lastname", + 'u.accountancy_code'=>"AccountancyCode", + 'u.email'=>"EMail", + 'u.note'=>"Note" +); + + +/* + * Actions + */ + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + /* * View @@ -88,12 +125,17 @@ $buttonviewhierarchy='attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; @@ -106,14 +148,33 @@ else $sql.= " WHERE u.entity IN (".getEntity('user',1).")"; } if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; -if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor; if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); -if ($search_login != '') $sql.= natural_search("u.login", $search_login); -if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); -if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); +if ($search_login != '') $sql.= natural_search("u.login", $search_login); +if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); +if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; -if ($sall) $sql.= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $sall); +if ($sall) $sql.= natural_search($fieldstosearchall, $sall); +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; $sql.=$db->order($sortfield,$sortorder); +//$sql.= $db->plimit($conf->liste_limit+1, $offset); $result = $db->query($sql); if ($result) @@ -121,54 +182,153 @@ if ($result) $num = $db->num_rows($result); $i = 0; + $param=''; + if ($sall != '') $param.='&sall='.urlencode($sall); + if ($search_user != '') $param.="&search_user=".$search_user; + if ($search_login != '') $param.="&search_login=".$search_login; + if ($search_lastname != '') $param.="&search_lastname=".$search_lastname; + if ($search_firstname != '') $param.="&search_firstname=".$search_firstname; + if ($search_supervisor > 0) $param.="&search_supervisor=".$search_supervisor; + if ($search_statut != '') $param.="&search_statut=".$search_statut; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } + + print ''."\n"; if ($optioncss != '') print ''; - - $param="search_user=".$search_user."&sall=".$sall; - $param.="&search_statut=".$search_statut; - if ($optioncss != '') $param.='&optioncss='.$optioncss; - + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + + $arrayfields=array( + 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), + 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), + 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), + 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), + 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))), + 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1), + 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100), + 'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110), + 'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + ); + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); - print ''; print ''; print ''; + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print ''; if ($type != '') print ''; @@ -971,24 +971,24 @@ if ($resql) $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - // Status - if (! empty($arrayfields['s.status']['checked'])) + // Date creation + if (! empty($arrayfields['s.datec']['checked'])) { - print ''.$companystatic->getLibStatut(3).''; print dol_print_date($obj->date_creation, 'dayhour'); print ''; print dol_print_date($obj->date_update, 'dayhour'); print ''.$companystatic->getLibStatut(3).'
'; print ''; - print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder); - if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) - { - print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); - } - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER['PHP_SELF'],"u.datec",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre($langs->trans("PreviousConnexion"),$_SERVER['PHP_SELF'],"u.datepreviouslogin",$param,"",'align="center"',$sortfield,$sortorder); + // Extra fields + if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) + { + foreach($extrafields->attribute_list as $key => $val) + { + if ($val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['u.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"u.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['u.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"u.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['u.statut']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"u.statut","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; // Search bar - $colspan=3; - if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) $colspan++; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - // Status - print ''; - - print ''; + } + if (! empty($arrayfields['u.lastname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.firstname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_soc']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.entity']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_user']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.datelastlogin']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) + { + print ''; + } + + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['u.datec']['checked'])) + { + // Date creation + print ''; + } + if (! empty($arrayfields['u.tms']['checked'])) + { + // Date modification + print ''; + } + if (! empty($arrayfields['u.statut']['checked'])) + { + // Status + print ''; + } + // Action column + print ''; - + print "\n"; $user2=new User($db); $var=True; + //while ($i < min($num,$conf->liste_limit)) while ($i < $num) { $obj = $db->fetch_object($result); @@ -183,87 +343,137 @@ if ($result) $userstatic->societe_id=$obj->fk_soc; $userstatic->firstname=''; $userstatic->lastname=$obj->login; - + $li=$userstatic->getNomUrl(1,'',0,0,24,1); print ""; - print ''; - print ''; - print ''; - print "'; - + if (! empty($arrayfields['u.login']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.lastname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.firstname']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_soc']['checked'])) + { + print "'; + } // Multicompany enabled if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) { - print ''; + if (! empty($arrayfields['u.entity']['checked'])) + { + print ''; + } } - - // Date creation - print ''; - + // Supervisor + if (! empty($arrayfields['u.fk_user']['checked'])) + { + // Resp + print ''; + } + // Date last login - print ''; - - // Resp - print ''; + } + // Date previous login + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) + { + print ''; + } + + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['u.datec']['checked'])) { - $user2->login=$obj->login2; - //$user2->lastname=$obj->lastname2; - //$user2->firstname=$obj->firstname2; - $user2->lastname=$user2->login; - $user2->firstname=''; - print $user2->getNomUrl(1); + print ''; } - print ''; + // Date modification + if (! empty($arrayfields['u.tms']['checked'])) + { + print ''; + } + // Status + if (! empty($arrayfields['u.statut']['checked'])) + { + $userstatic->statut=$obj->statut; + print ''; + } + // Action column + print ''; - // Statut - $userstatic->statut=$obj->statut; - print ''; - print ''; print "\n"; $i++; } + + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print "
 '; - print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); - print ''; + if (! empty($arrayfields['u.login']['checked'])) + { + print ''; + print ''; + print ''; + print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); + print ''; + print ''; print ''; print '
'; - print $li; - if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) - { - print img_picto($langs->trans("SuperAdministrator"),'redstar'); - } - else if ($obj->admin) - { - print img_picto($langs->trans("Administrator"),'star'); - } - print ''.ucfirst($obj->lastname).''.ucfirst($obj->firstname).'"; - if ($obj->fk_soc) - { - $companystatic->id=$obj->fk_soc; - $companystatic->name=$obj->name; - $companystatic->canvas=$obj->canvas; - print $companystatic->getNomUrl(1); - } - else if ($obj->ldap_sid) - { - print $langs->trans("DomainUser"); - } - else - { - print $langs->trans("InternalUser"); - } - print ''; + print $li; + if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) + { + print img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($obj->admin) + { + print img_picto($langs->trans("Administrator"),'star'); + } + print ''.ucfirst($obj->lastname).''.ucfirst($obj->firstname).'"; + if ($obj->fk_soc) + { + $companystatic->id=$obj->fk_soc; + $companystatic->name=$obj->name; + $companystatic->canvas=$obj->canvas; + print $companystatic->getNomUrl(1); + } + else if ($obj->ldap_sid) + { + print $langs->trans("DomainUser"); + } + else + { + print $langs->trans("InternalUser"); + } + print ''; - if (! $obj->entity) - { - print $langs->trans("AllEntities"); - } - else - { - // $mc is defined in conf.class.php if multicompany enabled. - if (is_object($mc)) - { - $mc->getInfo($obj->entity); - print $mc->label; - } - } - print ''; + if (! $obj->entity) + { + print $langs->trans("AllEntities"); + } + else + { + // $mc is defined in conf.class.php if multicompany enabled. + if (is_object($mc)) + { + $mc->getInfo($obj->entity); + print $mc->label; + } + } + print ''.dol_print_date($db->jdate($obj->datec),"dayhour").''; + if ($obj->login2) + { + $user2->login=$obj->login2; + //$user2->lastname=$obj->lastname2; + //$user2->firstname=$obj->firstname2; + $user2->lastname=$user2->login; + $user2->firstname=''; + print $user2->getNomUrl(1); + } + print ''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''; - if ($obj->login2) + if (! empty($arrayfields['u.datelastlogin']['checked'])) + { + print ''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").''; + print dol_print_date($obj->date_creation, 'dayhour'); + print ''; + print dol_print_date($obj->date_update, 'dayhour'); + print ''.$userstatic->getLibStatut(3).''.$userstatic->getLibStatut(5).' 
"; print "\n"; $db->free($result); From b49d63c12f2389d310c03d9908f528feae4062a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 19:31:13 +0100 Subject: [PATCH 21/45] NEW Show photo of user into user list. A new function getImageFileNameForSize was also introduced to choose image best size according to usage to save bandwith. --- htdocs/core/class/html.form.class.php | 39 ++++++++++++++++++++------ htdocs/core/lib/functions.lib.php | 30 ++++++++++++++++++++ htdocs/core/lib/images.lib.php | 4 +-- htdocs/theme/eldy/img/object_user.png | Bin 607 -> 651 bytes htdocs/user/class/user.class.php | 12 ++++---- htdocs/user/group/index.php | 2 +- htdocs/user/hierarchy.php | 8 ++++-- htdocs/user/index.php | 33 +++++++++++++++------- 8 files changed, 99 insertions(+), 29 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bc26812bd29..6bb8049f6f6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5254,11 +5254,11 @@ class Form * @param int $height Height of photo (auto if 0) * @param int $caneditfield Add edit fields * @param string $cssclass CSS name to use on img for photo - * @param int $genericifundef Use a generic image if no image avaiable + * @param string $imagesize 'mini', 'small' or '' (original) * @param int $addlinktofullsize Add link to fullsize image * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0,$addlinktofullsize=1) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='',$addlinktofullsize=1) { global $conf,$langs; @@ -5272,29 +5272,52 @@ class Form $dir=$conf->societe->multidir_output[$entity]; $smallfile=$object->logo; $smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile); - if (! empty($object->logo)) $file=$id.'/logos/thumbs/'.$smallfile; + if (! empty($object->logo)) + { + if ($imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); + else if ($imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); + else $file=$id.'/logos/thumbs/'.$smallfile; + } } else if ($modulepart=='contact') { $dir=$conf->societe->multidir_output[$entity].'/contact'; - $file=$id.'/photos/'.$object->photo; + if (! empty($object->photo)) + { + if ($imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); + else if ($imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); + else $file=$id.'/photos/'.$object->photo; + } } else if ($modulepart=='userphoto') { $dir=$conf->user->dir_output; - if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + if (! empty($object->photo)) + { + //var_dump(getImageFileNameForSize($object->photo, '_mini')); + if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); + else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } else if ($modulepart=='memberphoto') { $dir=$conf->adherent->dir_output; - if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'invoice_supplier').'photos/'.$object->photo; + if (! empty($object->photo)) + { + if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; - } else { + } + else + { $dir=$conf->$modulepart->dir_output; - if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo; + if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 896cc0824d0..0750d1d24b0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5223,3 +5223,33 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) return $res; } + +/** + * Return the filename of file to get the thumbs + * + * @param string $file Original filename + * @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini') + * @param string $extImgTarget Force image format for thumbs. Use '' to keep same extension than original image. + * @return string New file name + */ +function getImageFileNameForSize($file, $extName, $extImgTarget='') +{ + $dirName = dirname($file); + if ($dirName == '.') $dirName=''; + + $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse + $fileName = basename($fileName); + + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpg$/i',$file)?'.jpg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.gif$/i',$file)?'.gif':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.png$/i',$file)?'.png':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.bmp$/i',$file)?'.bmp':''); + + if (! $extImgTarget) return $file; + + $subdir=''; + if ($extName) $subdir = 'thumbs/'; + + return $dirName.$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb +} diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 7e47f755a7e..e61dc22eeb0 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -483,7 +483,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $ break; case IMAGETYPE_JPEG: // 2 $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); - $extImgTarget = (preg_match('/\.jpeg$/',$file)?'.jpeg':'.jpg'); + $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':'.jpg'); $newquality=$quality; break; case IMAGETYPE_PNG: // 3 @@ -512,7 +512,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $ $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse $fileName = basename($fileName); - $imgThumbName = $dirthumb.'/'.$fileName.$extName.$extImgTarget; // Chemin complet du fichier de la vignette + $imgThumbName = $dirthumb.'/'.getImageFileNameForSize($file, $extName, $extImgTarget); // Chemin complet du fichier de la vignette // Check if permission are ok //$fp = fopen($imgThumbName, "w"); diff --git a/htdocs/theme/eldy/img/object_user.png b/htdocs/theme/eldy/img/object_user.png index d26d8899ee80f1e4976260b265a3e7d75ebab61d..6452b94da6803fa598cfacb8c6bbe0b61232a0b1 100644 GIT binary patch delta 637 zcmV-@0)qYD1d9cb8Gi-<0019IEztk~00v@9M??Vs0RI60puMM)00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-ys84(~Mj1>7*0006QNkl$@!A=uV6o$WhXUdeO z&;o*Bi3^BOT@;w25H_+maigwWn7G0xa3@c|Gxz{J0S{nIG=I)Q)EO{dwa3(`vgG%fZGRr z-=|P0xDOw#?##}XUWLsNi?Fm@c`ITIz?(h8usW5uz#!C7~(IXgS+Dy^&{ zc51cSU&oD&wf=4N!o7vEo5|cy(lk~|0bqyp?yGt#;?)qPZnv$3cytbY2uWP@V=X5-X98Sh=(!ms-)DTbSoJ X@GAtI0IY4*00000NkvXXu0mjfk?J6G literal 607 zcmb`C&ubGw6vwx=AvHCnNGddzqJm)cVo^$q7qcXqge1h6Rtz3m7V$@{s9Or@s-SGu z+713-5yjDiFhbKzAmD&0OfSMvQT8CXD&k&R9MjA6)Zh<@v;GZ!c<=jt?;RfR&8AaF z{l1`2k|cjD8qNssbhEux=$=R4R)l#cW66m3i??^{?tMO1d@DwqFGWwPlH^-=vqdf+ zd@P1-XF|!4BvtQq{2BL%el4BIMuz+2@<2u&$i;{Axww+cXo`~0E1Ih4YTi^;O;dGE zH4R-ibi>ers7%BB2Lgr$OdYsD2y_Sx2oQ7;iV-xCs}#9lgeZnU7{($5gg}E}NH8VD zBm@ycDAXx|lv2wAmSx#Cwr$(7f#YDuaTrpWLl}dMA;vIcqP7@goFUFI=a6%ugmcQd z%{gyy+~Bm)5YcEho5dixD85cjW>UvR`~Q&2$={aP{5%#8W!pa~>z+;ioep)mIc>bvd1gCc@!dZp*SqI`po8=photo)) { $label.= '
'; - $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip'); + $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small'); $label.= '
'; } @@ -1932,13 +1932,14 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto',0,0).'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 0, 0, 'mini').'
'; $result.=$picto; } if (abs($withpictoimg) != 2) { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; - $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); + if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen); + else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; } $result.=$linkend; @@ -2398,7 +2399,7 @@ class User extends CommonObject $this->load_parentof(); // Init $this->users array - $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates + $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.photo, u.entity"; // Distinct reduce pb with old tables with duplicates $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity)))) { @@ -2429,6 +2430,7 @@ class User extends CommonObject $this->users[$obj->rowid]['email'] = $obj->email; $this->users[$obj->rowid]['gender'] = $obj->gender; $this->users[$obj->rowid]['admin'] = $obj->admin; + $this->users[$obj->rowid]['photo'] = $obj->photo; $i++; } } diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index 058f3ac92e2..f515c8307e7 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -94,7 +94,7 @@ if ($resql) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],"g.entity",$param,"",'align="center"',$sortfield,$sortorder); } print_liste_field_titre($langs->trans("NbOfUsers"),$_SERVER["PHP_SELF"],"nb",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"g.datec",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"g.datec",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; $var=True; while ($i < $num) diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index a9aef6ed783..14b8ec4265b 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -82,6 +82,7 @@ foreach($fulltree as $key => $val) { $userstatic->id=$val['id']; $userstatic->ref=$val['label']; + $userstatic->login=$val['login']; $userstatic->firstname=$val['firstname']; $userstatic->lastname=$val['lastname']; $userstatic->statut=$val['statut']; @@ -90,6 +91,7 @@ foreach($fulltree as $key => $val) $userstatic->societe_id=$val['fk_soc']; $userstatic->admin=$val['admin']; $userstatic->entity=$val['entity']; + $userstatic->photo=$val['photo']; $entity=$val['entity']; $entitystring=''; @@ -111,7 +113,7 @@ foreach($fulltree as $key => $val) } } - $li=$userstatic->getNomUrl(1,'',0,1); + $li=$userstatic->getNomUrl(-1,'',0,1); if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity) { $li.=img_picto($langs->trans("SuperAdministrator"),'redstar'); @@ -121,12 +123,12 @@ foreach($fulltree as $key => $val) $li.=img_picto($langs->trans("Administrator"),'star'); } $li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')'; - + $data[] = array( 'rowid'=>$val['rowid'], 'fk_menu'=>$val['fk_user'], 'statut'=>$val['statut'], - 'entry'=>'
'.$li.''.$userstatic->getLibStatut(5).'
' + 'entry'=>'
'.$li.''.$userstatic->getLibStatut(3).'
' ); } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 40fe8353093..7688cadbe05 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -124,11 +124,11 @@ $buttonviewhierarchy='
attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; @@ -341,10 +341,11 @@ if ($result) $userstatic->email=$obj->email; $userstatic->gender=$obj->gender; $userstatic->societe_id=$obj->fk_soc; - $userstatic->firstname=''; - $userstatic->lastname=$obj->login; + $userstatic->firstname=$obj->firstname; + $userstatic->lastname=$obj->lastname; + $userstatic->photo=$obj->photo; - $li=$userstatic->getNomUrl(1,'',0,0,24,1); + $li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login'); print ""; if (! empty($arrayfields['u.login']['checked'])) @@ -418,12 +419,24 @@ if ($result) print ''; if ($obj->login2) { + $user2->id=$obj->id2; $user2->login=$obj->login2; - //$user2->lastname=$obj->lastname2; - //$user2->firstname=$obj->firstname2; - $user2->lastname=$user2->login; - $user2->firstname=''; - print $user2->getNomUrl(1); + $user2->lastname=$obj->lastname2; + $user2->firstname=$obj->firstname2; + $user2->gender=$obj->gender2; + $user2->photo=$obj->photo2; + $user2->admin=$obj->admin2; + $user2->email=$obj->email2; + $user2->societe_id=$obj->fk_soc2; + print $user2->getNomUrl(-1,'',0,0,24,0,''); + if (! empty($conf->multicompany->enabled) && $obj->admin2 && ! $obj->entity2) + { + print img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($obj->admin2) + { + print img_picto($langs->trans("Administrator"),'star'); + } } print ''; } From 48ed8d440869b64f532c079055660bbb42fefe8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 19:42:00 +0100 Subject: [PATCH 22/45] FIX The thumb of user into top menu was using the image in full size. This make a large download at each page call. We must use the mini thumbs. --- htdocs/core/class/html.form.class.php | 10 +++++++-- htdocs/core/lib/functions.lib.php | 29 +++++++++++++++++++++++++++ htdocs/main.inc.php | 2 +- htdocs/user/class/user.class.php | 5 +++-- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b75bd01d2aa..9b0ef17b465 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5134,10 +5134,11 @@ class Form * @param int $width Width of photo * @param int $height Height of photo (auto if 0) * @param int $caneditfield Add edit fields + * @param string $imagesize 'mini', 'small' or '' (original) * @param string $cssclass CSS name to use on img for photo * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin') + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='') { global $conf,$langs; @@ -5156,7 +5157,12 @@ class Form else if ($modulepart=='userphoto') { $dir=$conf->user->dir_output; - if ($object->photo) $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + if (! empty($object->photo)) + { + if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); + else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 290cdb2300b..04c2c02a7d5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5118,3 +5118,32 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) return $res; } +/** + * Return the filename of file to get the thumbs + * + * @param string $file Original filename + * @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini') + * @param string $extImgTarget Force image format for thumbs. Use '' to keep same extension than original image. + * @return string New file name + */ +function getImageFileNameForSize($file, $extName, $extImgTarget='') +{ + $dirName = dirname($file); + if ($dirName == '.') $dirName=''; + + $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse + $fileName = basename($fileName); + + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpg$/i',$file)?'.jpg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.gif$/i',$file)?'.gif':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.png$/i',$file)?'.png':''); + if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.bmp$/i',$file)?'.bmp':''); + + if (! $extImgTarget) return $file; + + $subdir=''; + if ($extName) $subdir = 'thumbs/'; + + return $dirName.$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb +} diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 51147a03a9c..92d421d42cb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1443,7 +1443,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // User photo $toprightmenu.='
'; // Login name with tooltip diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e375a3c3d80..4459dfc3fc0 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1813,14 +1813,15 @@ class User extends CommonObject * @param int $width Width of image * @param int $height Height of image * @param string $cssclass Force a css class + * @param string $imagesize 'mini', 'small' or '' (original) * @return string String with URL link */ - function getPhotoUrl($width, $height, $cssclass='') + function getPhotoUrl($width, $height, $cssclass='', $imagesize='') { $result=''; $result.=''; - $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass); + $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize); $result.=''; return $result; From d7761ece58ea0cfaf8ede926b3e3a5dc42427cdd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 19:42:54 +0100 Subject: [PATCH 23/45] FIX The thumb of user into top menu was using the image in full size. This make a large download at each page call. We must use the mini thumbs. --- htdocs/core/class/html.form.class.php | 3 +-- htdocs/user/class/user.class.php | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6bb8049f6f6..a192b54c200 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5258,7 +5258,7 @@ class Form * @param int $addlinktofullsize Add link to fullsize image * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='',$addlinktofullsize=1) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1) { global $conf,$langs; @@ -5294,7 +5294,6 @@ class Form $dir=$conf->user->dir_output; if (! empty($object->photo)) { - //var_dump(getImageFileNameForSize($object->photo, '_mini')); if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index dd63a144226..e281f4002f3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1825,14 +1825,15 @@ class User extends CommonObject * @param int $width Width of image * @param int $height Height of image * @param string $cssclass Force a css class + * @param string $imagesize 'mini', 'small' or '' (original) * @return string String with URL link */ - function getPhotoUrl($width, $height, $cssclass='') + function getPhotoUrl($width, $height, $cssclass='', $imagesize='') { $result=''; $result.=''; - $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass); + $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize); $result.=''; return $result; From 24732cf454405793f35ddae77d02f343bb4824bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 20:01:39 +0100 Subject: [PATCH 24/45] Fix to avoid duplicate tooltip --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index e828117327b..77437667c33 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1575,7 +1575,7 @@ class Adherent extends CommonObject $picto='user'; - if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend); + if ($withpicto) $result.=($link.img_object('', $picto, 'class="classfortooltip"').$linkend); if ($withpicto && $withpicto != 2) $result.=' '; $result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend; return $result; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e281f4002f3..d4358bb2b0a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1845,7 +1845,7 @@ class User extends CommonObject * * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo) * @param string $option On what the link point to - * @param integer $infologin Add connection info to the tooltip + * @param integer $infologin Add complete info tooltip * @param integer $notooltip 1=Disable tooltip on picto and name * @param int $maxlen Max length of visible user name * @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user From 54883f2d84c788182fadf10a4c11f1bcf990b604 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 20:14:57 +0100 Subject: [PATCH 25/45] FIX Bad picto for expense report --- htdocs/expensereport/class/expensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 920c6aa16d7..0dba68b5b5c 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1534,7 +1534,7 @@ class ExpenseReport extends CommonObject $response->warning_delay=$conf->expensereport->payment->warning_delay/60/60/24; $response->label=$langs->trans("ExpenseReportsToPay"); $response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=5'; - $response->img=img_object($langs->trans("ExpenseReports"),"user"); + $response->img=img_object($langs->trans("ExpenseReports"),"trip"); while ($obj=$this->db->fetch_object($resql)) { From 9a4b62c279dc0c16c1457c787ea0c7a5fdeb67a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 20:15:52 +0100 Subject: [PATCH 26/45] NEW Introduce use of cache for thumbs images of users --- htdocs/core/class/html.form.class.php | 27 ++++++++++++++++----------- htdocs/user/class/user.class.php | 4 ++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a192b54c200..5f714a85bcd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5256,9 +5256,10 @@ class Form * @param string $cssclass CSS name to use on img for photo * @param string $imagesize 'mini', 'small' or '' (original) * @param int $addlinktofullsize Add link to fullsize image + * @param int $cache 1=Accept to use image in cache * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0) { global $conf,$langs; @@ -5274,8 +5275,8 @@ class Form $smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile); if (! empty($object->logo)) { - if ($imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); - else if ($imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); + if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); + else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); else $file=$id.'/logos/thumbs/'.$smallfile; } } @@ -5284,8 +5285,8 @@ class Form $dir=$conf->societe->multidir_output[$entity].'/contact'; if (! empty($object->photo)) { - if ($imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); - else if ($imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); + if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); else $file=$id.'/photos/'.$object->photo; } } @@ -5294,8 +5295,8 @@ class Form $dir=$conf->user->dir_output; if (! empty($object->photo)) { - if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); - else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo; } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility @@ -5306,8 +5307,8 @@ class Form $dir=$conf->adherent->dir_output; if (! empty($object->photo)) { - if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); - else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo; } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility @@ -5316,14 +5317,18 @@ class Form else { $dir=$conf->$modulepart->dir_output; - if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; + if (! empty($object->photo)) + { + if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); + else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); + else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; + } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } if ($dir) { - $cache='0'; if ($file && file_exists($dir."/".$file)) { if ($addlinktofullsize) $ret.=''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index d4358bb2b0a..f16af2ee72d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1886,7 +1886,7 @@ class User extends CommonObject if (! empty($this->photo)) { $label.= '
'; - $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small'); + $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1); $label.= '
'; } @@ -1933,7 +1933,7 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 0, 0, 'mini').'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'
'; $result.=$picto; } if (abs($withpictoimg) != 2) From 080ba15e0de42ec5477be20dfc72fec7f216d8f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 22:50:05 +0100 Subject: [PATCH 27/45] FIX The price per level just never correctly manage the vat. Vat is not per level but depends on seller and supplyer. I kept a hidden option to keep old behaviour that was bugged. --- htdocs/compta/facture.php | 34 +++--- htdocs/langs/en_US/products.lang | 2 + htdocs/product/price.php | 192 +++++++++++++++++++++++-------- 3 files changed, 166 insertions(+), 62 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index f2148f8e063..983331bd412 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1283,7 +1283,8 @@ if (empty($reshook)) // Ecrase $txtva par celui du produit // Ecrase $base_price_type par celui du produit // Replaces $fk_unit with the product's - if (! empty($idprod)) { + if (! empty($idprod)) + { $prod = new Product($db); $prod->fetch($idprod); @@ -1304,8 +1305,11 @@ if (empty($reshook)) $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; - if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; - if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + } } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -1318,26 +1322,30 @@ if (empty($reshook)) $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { - $pu_ht = price($prodcustprice->lines [0]->price); - $pu_ttc = price($prodcustprice->lines [0]->price_ttc); - $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $pu_ht = price($prodcustprice->lines[0]->price); + $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_base_type = $prodcustprice->lines[0]->price_base_type; + $prod->tva_tx = $prodcustprice->lines[0]->tva_tx; } } } - // if price ht is forced (ie: calculated by margin rate and cost price) - if (! empty($price_ht)) { + // if price ht was forced (ie: from gui when calculated by margin rate and cost price) + if (! empty($price_ht)) + { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU'); } - // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - elseif ($tva_tx != $prod->tva_tx) { - if ($price_base_type != 'HT') { + elseif ($tva_tx != $prod->tva_tx) + { + if ($price_base_type != 'HT') + { $pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); - } else { + } + else + { $pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU'); } } diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index e108dfff52b..1759eb12e9f 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -67,6 +67,8 @@ ProductStatusNotOnBuy=Not for purchase ProductStatusOnBuyShort=For purchase ProductStatusNotOnBuyShort=Not for purchase UpdatePrice=Update price +UpdateVAT=Update vat +UpdateDefaultPrice=Update default price AppliedPricesFrom=Applied prices from SellingPrice=Selling price SellingPriceHT=Selling price (net of tax) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 9c7defc4643..ac611faf5c3 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -84,8 +84,37 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($action == 'update_price' && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) + if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) { + $object->tva_tx = GETPOST('tva_tx'); + + $db->begin(); + + $resql = $object->update($object->id, $user); + if (! $resql) + { + $error++; + } + + if ($error) + { + $object->updatePrice($newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr, $newpsq); + } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + + $action=''; + } + + if (($action == 'update_price') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) + { $maxpricesupplier = $object->min_recommended_price(); $object->fk_price_expression = empty($eid) ? 0 : $eid; //0 discards expression @@ -399,6 +428,11 @@ if ($isphoto) { print ''; +// Status (to sell) +print '' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; +print $object->getLibStatut(2, 0); +print ''; + // MultiPrix if (! empty($conf->global->PRODUIT_MULTIPRICES)) { @@ -433,14 +467,32 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print price($object->multiprices_min["$soc->price_level"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$soc->price_level"])?'HT':$object->multiprices_base_type["$soc->price_level"]); } print ''; - - // TVA - print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . ''; + + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + // TVA + print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . ''; + } + else + { + // TVA + print '' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . ''; + } + } else { - // We show only vat for level 1 - print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . ''; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + // We show only vat for level 1 + print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . ''; + } + else + { + // TVA + print '' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . ''; + } + print ''.$langs->trans("PriceLevel").''.$langs->trans("SellingPrice").''.$langs->trans("MinPrice").''; for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) @@ -551,7 +603,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) } } } -} else { +} +else +{ // TVA print '' . $langs->trans("VATRate") . '' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . ''; @@ -649,11 +703,6 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) } } -// Status (to sell) -print '' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; -print $object->getLibStatut(2, 0); -print ''; - print "\n"; dol_fiche_end(); @@ -669,16 +718,69 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ { print "\n" . '
' . "\n"; - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES)) + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } - + else + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + print "\n
\n"; } + + /* - * Edition du prix + * Edit price area */ + +if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->service->creer)) +{ + print load_fiche_titre($langs->trans("UpdateVAT"), ''); + + print ''; + print ''; + print ''; + print ''; + + dol_fiche_head(''); + + print ''; + + // VAT + print ''; + + print '
' . $langs->trans("VATRate") . ''; + print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr); + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; + + print '

'; +} + if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->service->creer)) { print load_fiche_titre($langs->trans("NewPrice"), ''); @@ -785,26 +887,31 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> } else { - for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) + dol_fiche_head(''); + + for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) { + if ($i > 1) print '
'; + print '
'; - print ''; + print ''; print ''; print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) + { + print ''; + } - dol_fiche_head(''); - print ''; // VAT - if ($i == 1) { + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) + { print ''; - } else { // We always use the vat rate of price level 1 (A vat rate does not depends on customer) - print ''; } - + // Selling price print '
' . $langs->trans("VATRate") . ''; - print $form->load_tva("tva_tx_" . $i, $object->multiprices_tva_tx ["$i"], $mysoc, '', $object->id); + print $form->load_tva("tva_tx_" . $i, $object->multiprices_tva_tx["$i"], $mysoc, '', $object->id); print '
'; $text = $langs->trans('SellingPrice') . ' ' . $i; @@ -839,10 +946,10 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> print '
'; - dol_fiche_end(); - print '
'; } + + dol_fiche_end(); } } @@ -886,14 +993,14 @@ if ($result) print '' . $langs->trans("AppliedPricesFrom") . ''; if (! empty($conf->global->PRODUIT_MULTIPRICES)) { - print '' . $langs->trans("MultiPriceLevelsName") . ''; + print '' . $langs->trans("PriceLevel") . ''; } if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) { print '' . $langs->trans("Type") . ''; } print '' . $langs->trans("PriceBase") . ''; - print '' . $langs->trans("VAT") . ''; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '' . $langs->trans("VATRate") . ''; print '' . $langs->trans("HT") . ''; print '' . $langs->trans("TTC") . ''; if (! empty($conf->dynamicprices->enabled)) { @@ -928,7 +1035,7 @@ if ($result) } print '' . $langs->trans($objp->price_base_type) . ""; - print '' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . ""; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . ""; //Price if (! empty($objp->fk_price_expression) && ! empty($conf->dynamicprices->enabled)) @@ -942,14 +1049,14 @@ if ($result) } else { - print '' . price($objp->price) . ""; - print '' . price($objp->price_ttc) . ""; + print '' . ($objp->price_base_type != 'TTC' ? price($objp->price) : ''). ""; + print '' . ($objp->price_base_type == 'TTC' ? price($objp->price_ttc) : '') . ""; if (! empty($conf->dynamicprices->enabled)) { //Only if module is enabled print ''; } } - print '' . price($objp->price_min) . ''; - print '' . price($objp->price_min_ttc) . ''; + print '' . ($objp->price_base_type != 'TTC' ? price($objp->price_min) : '') . ''; + print '' . ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : '') . ''; // User print '' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $objp->login . ''; @@ -1202,7 +1309,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '' . $langs->trans("ThirdParty") . ''; print '' . $langs->trans("AppliedPricesFrom") . ''; print '' . $langs->trans("PriceBase") . ''; - print '' . $langs->trans("VAT") . ''; + print '' . $langs->trans("VATRate") . ''; print '' . $langs->trans("HT") . ''; print '' . $langs->trans("TTC") . ''; print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . ''; @@ -1275,7 +1382,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '' . $langs->trans("ThirdParty") . ''; print '' . $langs->trans("AppliedPricesFrom") . ''; print '' . $langs->trans("PriceBase") . ''; - print '' . $langs->trans("VAT") . ''; + print '' . $langs->trans("VATRate") . ''; print '' . $langs->trans("HT") . ''; print '' . $langs->trans("TTC") . ''; print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . ''; @@ -1355,19 +1462,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ""; print ""; - - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ - - print "\n" . '
' . "\n"; - - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - print "\n

\n"; } } From 132bc610b6ccd5ba7a8616289454aba76315aa98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Oct 2015 23:32:49 +0100 Subject: [PATCH 28/45] Icon for contact contains a part of thirdparty icon to make things easier to understand --- htdocs/comm/card.php | 2 +- htdocs/societe/soc.php | 12 +++++++++++- htdocs/theme/eldy/img/object_contact.png | Bin 593 -> 666 bytes htdocs/theme/eldy/img/object_group.png | Bin 912 -> 655 bytes htdocs/theme/eldy/img/object_user.png | Bin 651 -> 581 bytes htdocs/theme/md/img/object_contact.png | Bin 593 -> 666 bytes htdocs/theme/md/img/object_group.png | Bin 912 -> 655 bytes htdocs/theme/md/img/object_user.png | Bin 607 -> 581 bytes 8 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index fe164006a29..b874eeefde5 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -226,7 +226,7 @@ if ($id > 0) print ''; // Alias name (commercial, trademark or alias name) - print '"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 93fff61d1f1..71fa3b66a74 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1908,7 +1908,17 @@ else print $object->name_alias; print ""; - // Prefix + // Prospect/Customer + print ''; + + // Prospect/Customer + print ''; + + // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; diff --git a/htdocs/theme/eldy/img/object_contact.png b/htdocs/theme/eldy/img/object_contact.png index e98202b367d15cdb2509122e8d4f0e009396f2ba..d4272f367c6e5eae37c9ddc745fd8a9be7d05bb7 100644 GIT binary patch delta 653 zcmV;80&@M)1eyhq8Gi-<0019IEztk~00v@9M??Vs0RI60puMM)00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-ys85SN9?nlG{0006fNklN=8P8; z^8?E@F+mzhZ3`l;h$*;~4qbGqNS6*yb@4B7@~?2If;cpTyMJATZZ?RJLb1I?nrvxo z^sXi)?_KV_*CC`-5Pjz7^ZkCGhp)kZrqMXk4X26cO0eMZ@?CD;EEwWnP`mAF$2q2) z&jFHlv(2m82aejVHpffz^Yhmh7Z+a^i^V5OsaUJkdi(nQM;_d+u)X6T<$$*5;klAp zb_Zi?YuDP`e18#EtJOE9Qt7Gdx@fJ*WHM+SV`=FTPV@LYMZS=w-f%Fn2p1L>uEgW< z^=`LI7=|dN==FM}(`okh4mmtJ1;CRomSs^WHa2YAwmV}eiXw)?A(NAn%*@;) z2+|A~0FcWjaGW+KK&R7@LWo{EoxU0b0bv*tMG>Cok$=hLI5|NSs54@nF4%5TlQt)Tl}G6#jD1Z-zW8T z&YspcYu2oFE0^xrx@rI3JspcK^{>3yvF3Tl#!uawKD2K9(YO2mqKzk4?!3Qu@1bS8 zKP@}-ebbSbyH3A5b>_<5>lg0czIp5JqeEA}AHDnk?&Hr-9^d`><;DO1zyJULZ<^0> z92h!bB|(0{KrZzGgO_j4O`r`0o-U3d9M_XMSeX@FT@B7MJj^<|uxRUqok@OvR*MSO zE!wtr+gu^}DcUO*EnT^6p{5$g!&MnAQqtNjuRb^JRIu)mIdXt!#mQygqCC{3ttBk9 zm3FkT{W0006UNklgsC0-EKb;k*p|+SJUaVzqz^T_>c0Pot?bf?Y?NY+mGwI z2B6dFJXh6Az|;SMW^ZrrVzb#SthISc2~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fhb2#U0XAL$o zanIJyTG=}*AMl?;*B6_2H%mL)+k2Ht<*Bt!cDvnoyshau6^+J5+V}nE!C(NbG*lep^xG*`R%)*RWab7hCzBL2 zdrB!Nt)aDs)(Rv93i(29?yLQNKPExrTrQK4Fz|XnCpG`*Kz&tvJ7!|DMTa zo8+066FV$t5#`!5~NQ{lqf>@TS&C xV+?!Ny8xH~5c6McGZ7eoBO=Glej$G|^9Mvg*wk5w1(*N;002ovPDHLkV1jqH=U4y$ delta 578 zcmV-I0=@mk1d9cbRDTg5A&eCHRR9127)eAyR4C7FlEF?BQ51&1duPg&rqBX{V2KNe zP+b(5q7XK+H*uq`T$s4RCvYcEz%%#&JOK}2Of=3y)EO{dwa3(`+o#M0D#*EeBY-~D7X(F zt?taumR^O;5R0(1TzM;E3&5K`1fcsx5CkkQFXcSXds%NZFtH)-b~!#dW`2Hd3&;;9 z(}PXt`Z_BjZXCzN#$b%Wm>8usW5uz#!C7~(IXgS+Dy^&{c51cSU&oD& zwf=4N!o7vEo5|cy(lk~|0bqDPY)ItNM{d1QaygQY5o2_=|;-a}FV#h&^pmbgoIZ&PkED|e`j##<0B9~gxo?DpbH}ES2oB*tC Q)c^nh07*qoM6N<$f(Stpr2qf` diff --git a/htdocs/theme/md/img/object_contact.png b/htdocs/theme/md/img/object_contact.png index e98202b367d15cdb2509122e8d4f0e009396f2ba..d4272f367c6e5eae37c9ddc745fd8a9be7d05bb7 100644 GIT binary patch delta 653 zcmV;80&@M)1eyhq8Gi-<0019IEztk~00v@9M??Vs0RI60puMM)00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-ys85SN9?nlG{0006fNklN=8P8; z^8?E@F+mzhZ3`l;h$*;~4qbGqNS6*yb@4B7@~?2If;cpTyMJATZZ?RJLb1I?nrvxo z^sXi)?_KV_*CC`-5Pjz7^ZkCGhp)kZrqMXk4X26cO0eMZ@?CD;EEwWnP`mAF$2q2) z&jFHlv(2m82aejVHpffz^Yhmh7Z+a^i^V5OsaUJkdi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deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 71fa3b66a74..8b640040b80 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1915,7 +1915,7 @@ else // Prospect/Customer print ''; // Prefix From 71da059ef09642143407e992e911acaab0810538 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 11:23:31 +0100 Subject: [PATCH 30/45] NEW Add a new widget $form->selectArrayAjax() to use combo list with content coming from an Ajax URL. --- htdocs/core/ajax/selectsearchbox.php | 10 +++---- htdocs/core/class/html.form.class.php | 41 +++++++++++++++++---------- htdocs/public/test/test_forms.php | 4 +-- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 4fe9b905eda..565866e2d90 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -44,14 +44,14 @@ if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE { $langs->load("companies"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); - $arrayresult['searchintothirdparty']=img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue); + $arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) { $langs->load("companies"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); - $arrayresult['searchintocontact']=img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue); + $arrayresult['searchintocontact']=array('text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue)); } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) @@ -59,7 +59,7 @@ if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! em { $langs->load("products"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); - $arrayresult['searchintoproduct']=img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue); + $arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); } /*if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) @@ -73,14 +73,14 @@ if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ { $langs->load("members"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); - $arrayresult['searchintomember']=img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue); + $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) { $langs->load("projects"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); - $arrayresult['searchintoprojects']=img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue); + $arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); } // Execute hook printSearchForm diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5f714a85bcd..1e11f103a39 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4504,16 +4504,17 @@ class Form * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. * * @param string $htmlname Name of html select area - * @param string $url Url + * @param string $url Url. Must return a json_encode of array(key=>array('text'=>'A text', 'url'=>'An url'), ...) * @param string $id Preselected key * @param string $moreparam Add more parameters onto the select tag * @param string $moreparamtourl Add more parameters onto the Ajax called URL * @param int $disabled Html select box is disabled * @param int $minimumInputLength Minimum Input Length * @param string $morecss Add more class to css styles + * @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. * @return string HTML select string. */ - static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='') + static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0) { $out = ''; @@ -4521,7 +4522,10 @@ class Form $out.=' '; diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index 5e7b2f2434f..a189ee836b1 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -64,11 +64,11 @@ print $form->selectarray('selectarray',$array); print '

'."\n"; -print "Test 4d: a select with ajax refresh
\n"; +print "Test 4d: a select with ajax refresh and with onchange call of url
\n"; //$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz'); $array=array(); $selected=-1; -print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, ''); +print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1); print '

'."\n"; From 4fd0086862af66e5a67530ee9903088f8d24772b Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Climent Date: Mon, 26 Oct 2015 11:33:43 +0100 Subject: [PATCH 31/45] Fix: error this.price > 0 if no parse this.price when compare this.price and 0 always false --- htdocs/core/tpl/objectline_create.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index ccf63983539..e8bacede84a 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -521,6 +521,7 @@ jQuery(document).ready(function() { if (this.id != 'pmpprice') { i++; + this.price = parseFloat(this.price);//fix this.price >0 // If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0) var defaultbuyprice = 'global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1')?'bestsupplierprice':''); ?>'; From 5c4ac0bf62d65b788a8add89953831346b95253a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 12:16:40 +0100 Subject: [PATCH 32/45] NEW Merge all left menu search boxes into one. --- htdocs/core/ajax/selectsearchbox.php | 52 +++++++++++++++------------ htdocs/core/class/html.form.class.php | 6 +++- htdocs/langs/en_US/main.lang | 1 + htdocs/main.inc.php | 22 +++++++----- htdocs/public/test/test_forms.php | 2 -- htdocs/theme/eldy/style.css.php | 14 +++++--- htdocs/theme/md/style.css.php | 4 +++ htdocs/user/index.php | 44 ++++++++++++++++++----- 8 files changed, 99 insertions(+), 46 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 565866e2d90..a7149400f80 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -40,14 +40,14 @@ $search_boxvalue=GETPOST('q'); $arrayresult=array(); // Define $searchform -if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) +if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { $langs->load("companies"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); $arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); } -if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) +if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire) { $langs->load("companies"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); @@ -55,42 +55,50 @@ if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_C } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) -&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) +&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { $langs->load("products"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); $arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); } -/*if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) -&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER)) -{ - $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); -}*/ - -if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) -{ - $langs->load("members"); - //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); - $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); -} - -if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) +if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { $langs->load("projects"); //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); $arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); } -// Execute hook printSearchForm +if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) +{ + $langs->load("members"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); + $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->user->user->lire) +{ + $langs->load("users"); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + $arrayresult['searchintouser']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue)); +} + +/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag +if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read) +{ + $langs->load("hrm"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user')); +} +*/ + +// Execute hook addSearchEntry $parameters=array(); -$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters); if (empty($reshook)) { - $searchform.=$hookmanager->resPrint; + $arrayresult=array_merge($arrayresult, $hookmanager->resArray); } -else $searchform=$hookmanager->resPrint; +else $arrayresult=$hookmanager->resArray; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1e11f103a39..a9f66d80f22 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4512,10 +4512,13 @@ class Form * @param int $minimumInputLength Minimum Input Length * @param string $morecss Add more class to css styles * @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. + * @param string $placeholder String to use as placeholder * @return string HTML select string. */ - static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0) + static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='') { + global $langs; + $out = ''; $tmpplugin='select2'; @@ -4559,6 +4562,7 @@ class Form },*/ cache: true }, + placeholder: "'.dol_escape_js($placeholder).'", escapeMarkup: function (markup) { return markup; }, // let our custom formatter work minimumInputLength: '.$minimumInputLength.', formatResult: function(result, container, query, escapeMarkup) { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b8c6735be80..648ce25b9ce 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -755,5 +755,6 @@ SetRef=Set ref SearchIntoThirdparties=Search %s into thirdparties SearchIntoContacts=Search %s into contacts SearchIntoMembers=Search %s into members +SearchIntoUsers=Search %s into users SearchIntoProductsOrServices=Search %s into products or services SearchIntoProjects=Search %s into projects \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 608957aa52d..8db9b6aa2ac 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1551,7 +1551,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a */ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='') { - global $user, $conf, $langs, $db; + global $user, $conf, $langs, $db, $form; global $hookmanager, $menumanager; $searchform=''; @@ -1567,7 +1567,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print "\n"; + if (! is_object($form)) $form=new Form($db); + $selected=-1; + $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search")); + // Define $searchform + /* if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) { $langs->load("companies"); @@ -1594,18 +1599,18 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); } + if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) + { + $langs->load("projects"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + } + if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) { $langs->load("members"); $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); } - if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) - { - $langs->load("projects"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); - } - if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read) { $langs->load("hrm"); @@ -1620,7 +1625,8 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $searchform.=$hookmanager->resPrint; } else $searchform=$hookmanager->resPrint; - + */ + // Define $bookmarks if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) { diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index a189ee836b1..f1c00f94acf 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -65,8 +65,6 @@ print $form->selectarray('selectarray',$array); print '

'."\n"; print "Test 4d: a select with ajax refresh and with onchange call of url
\n"; -//$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz'); -$array=array(); $selected=-1; print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c152e1d93a3..641b13030ee 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1145,6 +1145,10 @@ div.vmenu, td.vmenu { } +.vmenusearchselectcombo { + width: 172px; +} + .menu_contenu { padding-top: 3px; padding-bottom: 2px; @@ -1219,17 +1223,17 @@ div.blockvmenusearch color: #000000; text-align: ; text-decoration: none; - padding-left: 5px; + /*padding-left: 5px; padding-right: 1px; padding-top: 3px; - padding-bottom: 3px; - margin: 1px 0px 8px 2px; + padding-bottom: 3px; */ + margin: 1px 0px 4px 2px; background: rgb(); - border-left: 1px solid #AAA; + /*border-left: 1px solid #AAA; border-right: 1px solid #BBB; border-bottom: 1px solid #BBB; - border-top: 1px solid #BBB; + border-top: 1px solid #BBB;*/ /*border-radius: 4px; -moz-border-radius: 4px; -moz-box-shadow: 3px 3px 4px #DDD; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index db6cfa50f86..55ef8a3b991 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1173,6 +1173,10 @@ div.vmenu, td.vmenu { } +.vmenusearchselectcombo { + width: 170px; +} + .menu_contenu { padding-top: 4px; padding-bottom: 3px;} #menu_contenu_logo { padding-right: 4px; } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 7688cadbe05..6b618552dc6 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -45,6 +45,8 @@ $search_user=GETPOST('search_user','alpha'); $search_login=GETPOST('search_login','alpha'); $search_lastname=GETPOST('search_lastname','alpha'); $search_firstname=GETPOST('search_firstname','alpha'); +$search_accountancy_code=GETPOST('search_accountancy_code','alpha'); +$search_email=GETPOST('search_email','alpha'); $search_statut=GETPOST('search_statut','alpha'); $search_thirdparty=GETPOST('search_thirdparty','alpha'); $search_supervisor=GETPOST('search_supervisor','alpha'); @@ -82,6 +84,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_login=""; $search_lastname=""; $search_firstname=""; + $search_accountancy_code=""; + $search_email=""; $search_statut=""; $search_thirdparty=""; $search_supervisor=""; @@ -94,8 +98,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'u.login'=>"Login", - 'u.firstname'=>"Firstname", 'u.lastname'=>"Lastname", + 'u.firstname'=>"Firstname", 'u.accountancy_code'=>"AccountancyCode", 'u.email'=>"EMail", 'u.note'=>"Note" @@ -124,7 +128,7 @@ $buttonviewhierarchy='
0) $sql.= " AND u.fk_soc = ".$socid; -if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +//if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor; if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); if ($search_login != '') $sql.= natural_search("u.login", $search_login); if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); +if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code); +if ($search_email != '') $sql.= natural_search("u.email", $search_email); if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; -if ($sall) $sql.= natural_search($fieldstosearchall, $sall); +if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall); // Add where from extra fields foreach ($search_array_options as $key => $val) { @@ -188,6 +194,8 @@ if ($result) if ($search_login != '') $param.="&search_login=".$search_login; if ($search_lastname != '') $param.="&search_lastname=".$search_lastname; if ($search_firstname != '') $param.="&search_firstname=".$search_firstname; + if ($search_accountancy_code != '') $param.="&search_accountancy_code=".$search_accountancy_code; + if ($search_email != '') $param.="&search_email=".$search_email; if ($search_supervisor > 0) $param.="&search_supervisor=".$search_supervisor; if ($search_statut != '') $param.="&search_statut=".$search_statut; if ($optioncss != '') $param.='&optioncss='.$optioncss; @@ -217,7 +225,9 @@ if ($result) 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), + 'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0), + 'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1), + 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))), 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1), 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100), @@ -233,6 +243,8 @@ if ($result) if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER['PHP_SELF'],"u.accountancy_code",$param,"","",$sortfield,$sortorder); + if (! empty($arrayfields['u.email']['checked'])) print_liste_field_titre($langs->trans("EMail"),$_SERVER['PHP_SELF'],"u.email",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder); @@ -273,6 +285,14 @@ if ($result) { print '
'; } + if (! empty($arrayfields['u.accountancy_code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.email']['checked'])) + { + print ''; + } if (! empty($arrayfields['u.fk_soc']['checked'])) { print ''; @@ -364,13 +384,21 @@ if ($result) } if (! empty($arrayfields['u.lastname']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.firstname']['checked'])) { - print ''; + print ''; } - if (! empty($arrayfields['u.fk_soc']['checked'])) + if (! empty($arrayfields['u.accountancy_code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.email']['checked'])) + { + print ''; + } + if (! empty($arrayfields['u.fk_soc']['checked'])) { print "'; + print ''; print ''; print ''; @@ -357,20 +360,23 @@ else // Show print '
'; - // Liste des zone de recherches permanentes supportees - print '
'.$langs->trans('AliasNameShort').''; + print '
'.$langs->trans('AliasNames').''; print $object->name_alias; print "
'.$langs->trans('ProspectCustomer').''; + print $object->getLibCustProspStatut(); + print '
'.$langs->trans('Supplier').''; + print yn($object->fournsseur); + print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'.$langs->trans('Supplier').''; - print yn($object->fournsseur); + print yn($object->fournisseur); print '
'.ucfirst($obj->lastname).''.$obj->lastname.''.ucfirst($obj->firstname).''.$obj->firstname.''.$obj->accountancy_code.''.$obj->email.'"; if ($obj->fk_soc) From d5e42478a999246a713de7ba0594ed211dbfa245 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 12:37:36 +0100 Subject: [PATCH 33/45] Removed deprecated options to show or not forms. Such forms does not exists anymore. --- htdocs/admin/ihm.php | 40 ++++++++++++++++++++--------------- htdocs/langs/en_US/admin.lang | 3 ++- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 6e7a4f7d868..38d766e77fb 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -47,11 +47,12 @@ $action = GETPOST('action'); if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); // List of supported permanent search area +/* $searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); $searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); $searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Employees")); $searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module4000Name'); - +*/ if ($action == 'update') { @@ -78,6 +79,7 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity); + /* dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity); @@ -85,7 +87,8 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity); - + */ + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); @@ -209,7 +212,7 @@ if ($action == 'edit') // Edit // Max size of short lists on customer card $var=!$var; - print '
'.$langs->trans("DefaultMaxSizeShortListCustomerCard").'
'.$langs->trans("DefaultMaxSizeShortList").' 
'; - print ''; - $var=true; - foreach ($searchform as $key => $value) + // List of search forms to show + /* + if (! empty($searchform)) { - $var=!$var; - print ''; - print ''; - } - print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); - print '
'; - print '
'; - + print ''; + print ''; + $var=true; + foreach ($searchform as $key => $value) + { + $var=!$var; + print ''; + print ''; + } + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); + print '
'; + print '
'; + }*/ // Other $var=true; @@ -396,7 +402,7 @@ else // Show print ""; $var=!$var; - print ''.$langs->trans("DefaultMaxSizeShortListCustomerCard").'' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . ''; + print ''.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . ''; print ' '; print ""; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9bf9233f76b..c924d80639e 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -936,7 +936,8 @@ DefaultMenuSmartphoneManager=Smartphone menu manager Skin=Skin theme DefaultSkin=Default skin theme MaxSizeList=Max length for list -DefaultMaxSizeList=Default max length for list +DefaultMaxSizeList=Default max length for lists +DefaultMaxSizeShortList=Default max length for short lists (ie in customer card) MessageOfDay=Message of the day MessageLogin=Login page message PermanentLeftSearchForm=Permanent search form on left menu From 4b2db78c3ade9da7ecca14814c6ecc5005d4788d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 12:50:32 +0100 Subject: [PATCH 34/45] Keep deprecated options to show or not forms for blind people. --- htdocs/admin/ihm.php | 45 +++++++++-------- htdocs/main.inc.php | 113 ++++++++++++++++++++++--------------------- 2 files changed, 83 insertions(+), 75 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 38d766e77fb..6907e30f979 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -47,12 +47,14 @@ $action = GETPOST('action'); if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); // List of supported permanent search area -/* -$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); -$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); -$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Employees")); -$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module4000Name'); -*/ +$searchform=array(); +if (empty($conf->use_javascript_ajax)) +{ + $searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); + $searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); + $searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users")); + $searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name'); +} if ($action == 'update') { @@ -167,19 +169,22 @@ if ($action == 'edit') // Edit print '
'; // Liste des zone de recherche permanantes supportees - print ''; - print ''; - $var=True; - foreach ($searchform as $key => $value) + if (! empty($searchform)) { - $var=!$var; - print ''; + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; - print $form->selectyesno($searchform[$key],$searchformconst[$key],1); - print '
'; + print ''; + $var=True; + foreach ($searchform as $key => $value) + { + $var=!$var; + print ''; + } + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; + print $form->selectyesno($searchform[$key],$searchformconst[$key],1); + print '
'; + print '
'; } - print ''; - print '
'; - + // Other print ''; print ''; @@ -361,7 +366,6 @@ else // Show // List of search forms to show - /* if (! empty($searchform)) { print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; @@ -371,12 +375,13 @@ else // Show { $var=!$var; print ''; - print ''; } print '
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); + print ''; + if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); print '
'; print '
'; - }*/ + } // Other $var=true; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8db9b6aa2ac..dd4cd684970 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1567,65 +1567,68 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print "\n"; - if (! is_object($form)) $form=new Form($db); - $selected=-1; - $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search")); - - // Define $searchform - /* - if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) + if ($conf->use_javascript_ajax) { - $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); + if (! is_object($form)) $form=new Form($db); + $selected=-1; + $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search")); } - - if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) + else { - $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); + // Define $searchform + if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) + { + $langs->load("companies"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); + } + + if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) + { + $langs->load("companies"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); + } + + if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) + && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) + { + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); + } + + if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) + && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER)) + { + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); + } + + if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) + { + $langs->load("projects"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + } + + if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) + { + $langs->load("members"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); + } + + if (! empty($conf->user->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_USER) && $user->rights->user->user->lire) + { + $langs->load("users"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user')); + } + + // Execute hook printSearchForm + $parameters=array(); + $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + $searchform.=$hookmanager->resPrint; + } + else $searchform=$hookmanager->resPrint; } - - if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) - && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) - { - $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); - } - - if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) - && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER)) - { - $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product')); - } - - if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire) - { - $langs->load("projects"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); - } - - if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) - { - $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); - } - - if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read) - { - $langs->load("hrm"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user')); - } - - // Execute hook printSearchForm - $parameters=array(); - $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - $searchform.=$hookmanager->resPrint; - } - else $searchform=$hookmanager->resPrint; - */ // Define $bookmarks if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) From 07b277b23f262b5ef86c7928d8f4cb7a50902d7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 15:21:22 +0100 Subject: [PATCH 35/45] Prepare fields in dtabase to store if time spent was invoiced or not. --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 5 +++++ htdocs/install/mysql/tables/llx_projet_task_time.sql | 2 ++ 2 files changed, 7 insertions(+) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index d426cd72105..92ab08d141d 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -105,3 +105,8 @@ ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy; ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1; + +ALTER TABLE llx_projet_task_time ADD COLUMN invoice_id integer DEFAULT NULL; +ALTER TABLE llx_projet_task_time ADD COLUMN invoice_line_id integer DEFAULT NULL; + + diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.sql b/htdocs/install/mysql/tables/llx_projet_task_time.sql index 6c34440a58b..3ca161ed07d 100644 --- a/htdocs/install/mysql/tables/llx_projet_task_time.sql +++ b/htdocs/install/mysql/tables/llx_projet_task_time.sql @@ -26,5 +26,7 @@ create table llx_projet_task_time task_duration double, fk_user integer, thm double(24,8), + invoice_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice id here + invoice_line_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice line id here note text )ENGINE=innodb; From 6493438e876168be2f31795d697197340125a591 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 16:20:09 +0100 Subject: [PATCH 36/45] NEW The clicktodial module is now able to provide link "tel:" on phone numbers. So it is also possible to use clicktodial with a client solution like the "xivo" local client. --- htdocs/admin/clicktodial.php | 22 +++++++++++++++++----- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/langs/en_US/admin.lang | 4 +++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 1550c0ebef7..6b82c5237ea 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -36,10 +36,13 @@ $action = GETPOST("action"); /* * Actions */ + if ($action == 'setvalue' && $user->admin) { - $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity); - if ($result >= 0) + $result=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity); + $result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity); + + if ($result1 >= 0 && $result2 >= 0) { setEventMessage($langs->trans("SetupSaved")); } @@ -73,13 +76,22 @@ $var=true; print ''; print ''; -print ''; +print ''; print ''; print "\n"; + $var=!$var; -print ''; + +$var=!$var; +print '"; +print ''; +print '"; - print ''; - print '\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name")); +} +print "\n\n"; +$found++; +$var=!$var; +print ""; +print ''; +print '"; - print ''; - print '\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name")); +} +print "\n\n"; +$found++; +//if (! empty($conf->expedition->enabled)) +//{ +$var=!$var; +print ""; +print ''; +print '"; - print ''; - print '\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")); +} +print "\n\n"; +$found++; -if (! $found) +/*if (! $found) { $var=!$var; print ""; - print ''; + print ''; print "\n"; -} +}*/ print '
'.$langs->trans("Name").''.$langs->trans("Name").''.$langs->trans("Value").'
'; +print '
'; +print $langs->trans("ClickToDialUseTelLink").''; +print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'
'; +print '
'; +print $langs->trans("ClickToDialUseTelLinkDesc"); +print '
'; print $langs->trans("DefaultLink").''; -print '
'; +print 'global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'">
'; print '
'; print $langs->trans("ClickToDialUrlDesc").'
'; print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b7db522458e..5b990ac509c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1544,9 +1544,9 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep } } - if (! empty($addlink)) // Link on phone number + link to add action (if conf->global->AGENDA_ADDACTIONFORPHONE set) + if (! empty($addlink)) // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set) { - if (! empty($conf->browser->phone)) // If phone, we use link of phone + if (! empty($conf->browser->phone) || (! empty($conf->clicktodial->enabled) && ! empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) // If phone or option for, we use link of phone { $newphone =''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c924d80639e..f6399bffa6b 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1560,7 +1560,9 @@ AGENDA_DEFAULT_FILTER_TYPE=Set automatically this type of event into search filt AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda ##### ClickToDial ##### -ClickToDialDesc=This module allows to add an icon after phone numbers. A click on this icon will call a server with a particular URL you define below. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. +ClickToDialDesc=This module allows to make phone numbers clickable. A click on this icon will call make your phone to call the phone number. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. +ClickToDialUseTelLink=Use just a link "tel:" on phone numbers +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or an interface install on same computer than the browser, and called when you click on a link in your browser that start with "tel:". If you need a full server solution, you must set this to "No" and fill next field. ##### Point Of Sales (CashDesk) ##### CashDesk=Point of sales CashDeskSetup=Point of sales module setup From 6f1d758eaecd2105fab08f2f676a5f8e657baa24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 16:42:31 +0100 Subject: [PATCH 37/45] Fix print feature for md theme --- htdocs/theme/md/style.css.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 55ef8a3b991..a4da1e4205b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -560,11 +560,16 @@ td.showDragHandle { } #id-right { /* This must stay id-right and not be replaced with echo $right */ width: 100%; + padding-left: 194px; padding-top: 12px; + } .side-nav { + + display: none; + background: #FFF; border-right: 1px solid rgba(0,0,0,0.2); bottom: 0; @@ -600,6 +605,7 @@ td.showDragHandle { -webkit-overflow-scrolling: touch; overflow-x: hidden; overflow-y: auto; + } .side-nav-vert { margin-left: 194px; From 24c3491ff74bb2a81dc32e49f5a75960aee3ae16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 22:56:54 +0100 Subject: [PATCH 38/45] Code comment --- htdocs/install/mysql/tables/llx_actioncomm_resources.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_actioncomm_resources.sql b/htdocs/install/mysql/tables/llx_actioncomm_resources.sql index 484cd39fb82..7632b1fd810 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm_resources.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm_resources.sql @@ -16,8 +16,8 @@ -- along with this program. If not, see . -- -- ============================================================================ --- Table used for relations between elements of different types: --- invoice-propal, propal-order, etc... +-- Table used for relations between an action event and a resource (in most cases +-- a 'user', but can also be a 'resource' like a room, or a hardware) -- ============================================================================ create table llx_actioncomm_resources From 0a3ba3a0c601afd5293d2124f920ada4f38cf0aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2015 23:36:05 +0100 Subject: [PATCH 39/45] Fix picto --- htdocs/theme/md/img/search.png | Bin 432 -> 215 bytes htdocs/theme/md/img/searchclear.png | Bin 436 -> 356 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/theme/md/img/search.png b/htdocs/theme/md/img/search.png index 4c52b1e401ebbd8410dce1b60d40fc1d3e8e8e18..f0d4e97577508554557c9073d1607218a48a9215 100644 GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|m=6Sj}hEy$!Cb2S zz#@wSU0t@Pto$0DvY0ANJfO+Jc_%@IDc0TTlGYW4ge=dxOQv65K9}b?`&LHRx8cR% ztCu6g?)Y}Lt=ngk@Z`Zl(KEKD3~YMen&xf}*ET;G_$_N8$FwfNh9@fAYVY{i6n=)3 zDh2b4Yjdk#-9FRh%B|g+o6h-co%%=f<|?zlxr?K|Z{I4PY&&VA`EOR~T>aDCXT#Nj PE@kj^^>bP0l+XkKwR2O_ literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJdx@v7EBjSec0Oh;MG5s+Kq1Zo zkH}&M25un`X1sK_?hjCqCEd~2k%3`jKlh(RRv>?SfKP}kkoJ<`2(q+{(&R|Clt_;1 zNltDlw&W=G(kw3SDPDT7c4>$Mgqj+X4~mbJ%P_P%d9 z_r2vB5dH6Q;^+x7?AiLfXYcc#Yu|hB{hxB|`IP7X=VV*XS-W@6-g|S--JA3L`<(ax zmma&e^!@*}*_vxxoYr2uw>4X0Ymd{`bN9A>|G)MB|Gnp~?fw3L@BjbDiY1Qy|9|fP z|7-vM-&-1V@BjbjYrURtje7q5|E#$=-+)eMED7=pW^j0RBMr#O_jGX#k+__kpupwP zeM&?5^Uk9wsi{u|Yw8SZm3c#XOLs6#Uo&yy#El!xVjLV|9Pghw6T`1}K%Grw!dk*Ar0Tg0#W>&W=bkYi;y X{D&*ed<(lF&}s%xS3j3^P6k44ofy`glX(f`FeQ1ryDPOuQjAy=R>RjeHIlm#&Bx0?Lj!2J-!4EEu9*0Yh+!B-dghS1mI!_+) z{TX@3;h*1^%pmx(qFq`qOR~OOQQ_ehFp<~e@qe;c9A07?}b@ew9jMY=B?C+a+-N@`}V1eSS8?&9w`Gg-g wX9vdq_`A$8HYB?Ds?F`luZoGLpWTn9*sC$qb+%OS+@4BLl<6e(pbstU&(u0G|+7Anhf=5oBo@rOAHGg{vo+VYIIX>QZ)>*1)*h#==k9I&{(tNL|9j6}+xz|h-v9rP6-ylZ|Nq?o z|JVNizqd5#-v9s4*LpqQ8uk49|5-qMG()Oq)nSPeR5#)aq+tE;T+0!F8#rzsYXVVjIOnDb988Xc+Q;p`XK9%BO*)A zEXkQNp=atP^UYHpiMT~5FIu$rh#IT0nAb+FsF@rKcl3o{k7}27ZHYY16xzopr0Dc3&>Hq)$ From b90c56fbb52d95e441df0aeeff5adc6d090be363 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 27 Oct 2015 06:29:18 +0100 Subject: [PATCH 40/45] HRM : move migration into 3.8 to 3.9 --- .../install/mysql/migration/3.8.0-3.9.0.sql | 68 ++++++++++++++ .../install/mysql/migration/3.9.0-4.0.0.sql | 88 ------------------- 2 files changed, 68 insertions(+), 88 deletions(-) delete mode 100644 htdocs/install/mysql/migration/3.9.0-4.0.0.sql diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 92ab08d141d..97ef7e3c1d4 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -105,6 +105,74 @@ ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy; ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1; +CREATE TABLE IF NOT EXISTS llx_c_hrm_function +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + c_level tinyint DEFAULT 0 NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5,'EXECBOARD', 'Executive board', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1); +INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1); + +CREATE TABLE IF NOT EXISTS llx_c_hrm_department +( + rowid integer PRIMARY KEY, + pos tinyint DEFAULT 0 NOT NULL, + code varchar(16) NOT NULL, + label varchar(50), + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1); +INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1); + +CREATE TABLE IF NOT EXISTS llx_establishment ( + rowid integer NOT NULL auto_increment PRIMARY KEY, + entity integer NOT NULL DEFAULT 1, + name varchar(50), + address varchar(255), + zip varchar(25), + town varchar(50), + fk_state integer DEFAULT 0, + fk_country integer DEFAULT 0, + profid1 varchar(20), + profid2 varchar(20), + profid3 varchar(20), + phone varchar(20), + fk_user_author integer NOT NULL, + fk_user_mod integer NOT NULL, + datec datetime NOT NULL, + tms timestamp NOT NULL, + status tinyint DEFAULT 1 +) ENGINE=InnoDB; + ALTER TABLE llx_projet_task_time ADD COLUMN invoice_id integer DEFAULT NULL; ALTER TABLE llx_projet_task_time ADD COLUMN invoice_line_id integer DEFAULT NULL; diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql deleted file mode 100644 index accf65266c1..00000000000 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ /dev/null @@ -1,88 +0,0 @@ --- --- Be carefull to requests order. --- This file must be loaded by calling /install/index.php page --- when current version is 3.9.0 or higher. --- --- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; --- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; --- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); --- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; --- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); --- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; --- To restrict request to Mysql version x.y use -- VMYSQLx.y --- To restrict request to Pgsql version x.y use -- VPGSQLx.y --- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; --- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE --- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; --- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; --- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); --- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); - -CREATE TABLE IF NOT EXISTS llx_c_hrm_function -( - rowid integer PRIMARY KEY, - pos tinyint DEFAULT 0 NOT NULL, - code varchar(16) NOT NULL, - label varchar(50), - c_level tinyint DEFAULT 0 NOT NULL, - active tinyint DEFAULT 1 NOT NULL -)ENGINE=innodb; - -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5,'EXECBOARD', 'Executive board', 0, 1); -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1); -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1); -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1); -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1); -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1); -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1); -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1); -INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1); - -CREATE TABLE IF NOT EXISTS llx_c_hrm_department -( - rowid integer PRIMARY KEY, - pos tinyint DEFAULT 0 NOT NULL, - code varchar(16) NOT NULL, - label varchar(50), - active tinyint DEFAULT 1 NOT NULL -)ENGINE=innodb; - -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1); -INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1); - -CREATE TABLE IF NOT EXISTS llx_establishment ( - rowid integer NOT NULL auto_increment PRIMARY KEY, - entity integer NOT NULL DEFAULT 1, - name varchar(50), - address varchar(255), - zip varchar(25), - town varchar(50), - fk_state integer DEFAULT 0, - fk_country integer DEFAULT 0, - profid1 varchar(20), - profid2 varchar(20), - profid3 varchar(20), - phone varchar(20), - fk_user_author integer NOT NULL, - fk_user_mod integer NOT NULL, - datec datetime NOT NULL, - tms timestamp NOT NULL, - status tinyint DEFAULT 1 -) ENGINE=InnoDB; - From 93d340e4979b6e60b0710074571456b9377104e1 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 27 Oct 2015 07:26:57 +0100 Subject: [PATCH 41/45] HRM module : continue to work --- htdocs/hrm/admin/admin_establishment.php | 2 +- htdocs/hrm/admin/admin_hrm.php | 2 +- htdocs/hrm/class/employee.class.php | 226 +++++++++++++++++++++++ htdocs/hrm/employee/index.html | 0 htdocs/hrm/employee/list.php | 223 ++++++++++++++++++++++ htdocs/langs/en_US/admin.lang | 2 + htdocs/langs/en_US/hrm.lang | 1 + 7 files changed, 454 insertions(+), 2 deletions(-) create mode 100644 htdocs/hrm/class/employee.class.php create mode 100644 htdocs/hrm/employee/index.html create mode 100644 htdocs/hrm/employee/list.php diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 6a9cf961960..771f2e243bc 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -53,7 +53,7 @@ dol_htmloutput_mesg($mesg); // Subheader $linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans($page_name), $linkback); +print load_fiche_titre($langs->trans("HRMSetup"), $linkback); // Configuration header $head = hrm_admin_prepare_head(); diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index bc0487bad94..7dba4392740 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -48,7 +48,7 @@ dol_htmloutput_mesg($mesg); // Subheader $linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans($page_name), $linkback); +print load_fiche_titre($langs->trans("HRMSetup"), $linkback); // Configuration header $head = hrm_admin_prepare_head(); diff --git a/htdocs/hrm/class/employee.class.php b/htdocs/hrm/class/employee.class.php new file mode 100644 index 00000000000..4014bb717f2 --- /dev/null +++ b/htdocs/hrm/class/employee.class.php @@ -0,0 +1,226 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/class/employee.class.php + * \ingroup HRM + * \brief File of class to manage employees + */ + +require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; + +/** + * Class to manage establishments + */ +class Employee extends CommonObject +{ + public $element='employee'; + public $table_element='user'; + public $table_element_line = ''; + public $fk_element = 'fk_user'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + var $rowid; + + var $name; + var $address; + var $zip; + var $town; + var $status; // 0=open, 1=closed + var $entity; + + var $statuts=array(); + var $statuts_short=array(); + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + + $this->statuts_short = array(0 => 'Opened', 1 => 'Closed'); + $this->statuts = array(0 => 'Opened', 1 => 'Closed'); + + return 1; + } + + /** + * Load an object from database + * + * @param int $id Id of record to load + * @return int <0 if KO, >0 if OK + */ + function fetch($id) + { + $sql = "SELECT rowid, firstname, lastname, status, fk_user"; + $sql.= " FROM ".MAIN_DB_PREFIX."user"; + $sql.= " WHERE rowid = ".$id; + + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $result = $this->db->query($sql); + if ( $result ) + { + $obj = $this->db->fetch_object($result); + + $this->id = $obj->rowid; + $this->name = $obj->name; + $this->address = $obj->address; + $this->zip = $obj->zip; + $this->town = $obj->town; + $this->status = $obj->status; + + return 1; + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } + } + + /** + * Return a link to the employee card (with optionaly the picto) + * Use this->id,this->lastname, this->firstname + * + * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo) + * @param string $option On what the link point to + * @param integer $notooltip 1=Disable tooltip on picto and name + * @param int $maxlen Max length of visible employee name + * @param int $hidethirdpartylogo Hide logo of thirdparty + * @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login + * @param string $morecss Add more css on link + * @return string String with URL + */ + function getNomUrl($withpictoimg=0, $option='', $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='') + { + global $langs, $conf; + + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0; + + $result = ''; + $companylink = ''; + $link = ''; + + $label = '' . $langs->trans("Employee") . ''; + $label.= '
'; + $label.= '' . $langs->trans('Name') . ': ' . $this->getFullName($langs,'',''); + $label.= '
' . $langs->trans("EMail").': '.$this->email; + $label.='
'; + if (! empty($this->photo)) + { + $label.= '
'; + $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1); + $label.= '
'; + } + + $link.= 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $langs->load("users"); + $label=$langs->trans("ShowUser"); + $link.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $link.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $link.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } + $link.= '>'; + $linkend=''; + + //if ($withpictoimg == -1) $result.='
'; + $result.=$link; + if ($withpictoimg) + { + $paddafterimage=''; + if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; + if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'
'; + $result.=$picto; + } + if (abs($withpictoimg) != 2) + { + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; + if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen); + else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
'; + } + $result.=$linkend; + //if ($withpictoimg == -1) $result.='
'; + $result.=$companylink; + return $result; + } + + /** + * Return status label of an employee + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label of status + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->statut,$mode); + } + + /** + * Return label of given status + * + * @param int $statut Id statut + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label of status + */ + function LibStatut($statut,$mode=0) + { + global $langs; + $langs->load('users'); + + if ($mode == 0) + { + $prefix=''; + if ($statut == 1) return $langs->trans('Enabled'); + if ($statut == 0) return $langs->trans('Disabled'); + } + if ($mode == 1) + { + if ($statut == 1) return $langs->trans('Enabled'); + if ($statut == 0) return $langs->trans('Disabled'); + } + if ($mode == 2) + { + if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + } + if ($mode == 3) + { + if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4'); + if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5'); + } + if ($mode == 4) + { + if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + } + if ($mode == 5) + { + if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); + if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + } + } +} diff --git a/htdocs/hrm/employee/index.html b/htdocs/hrm/employee/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/hrm/employee/list.php b/htdocs/hrm/employee/list.php new file mode 100644 index 00000000000..1635ba41cda --- /dev/null +++ b/htdocs/hrm/employee/list.php @@ -0,0 +1,223 @@ + + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Alexandre Spangaro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/hrm/employee/list.php + * \ingroup core + * \brief Page of users + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/employee.class.php'; + +if (! $user->rights->hrm->employee->read) + accessforbidden(); + +$langs->load("users"); +$langs->load("companies"); +$langs->load("hrm"); + +// Security check (for external users) +$socid=0; +if ($user->societe_id > 0) + $socid = $user->societe_id; + +$sall=GETPOST('sall','alpha'); +$search_user=GETPOST('search_user','alpha'); +$search_login=GETPOST('search_login','alpha'); +$search_lastname=GETPOST('search_lastname','alpha'); +$search_firstname=GETPOST('search_firstname','alpha'); +$search_statut=GETPOST('search_statut','alpha'); +$search_thirdparty=GETPOST('search_thirdparty','alpha'); +$optioncss = GETPOST('optioncss','alpha'); + +if ($search_statut == '') $search_statut='1'; + +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); +if ($page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +$limit = $conf->liste_limit; +if (! $sortfield) $sortfield="u.login"; +if (! $sortorder) $sortorder="ASC"; + +$employeestatic = new Employee($db); +$companystatic = new Societe($db); +$form = new Form($db); + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) +{ + $search_user=""; + $search_login=""; + $search_lastname=""; + $search_firstname=""; + $search_statut=""; + $search_thirdparty=""; +} + + +/* + * View + */ + +llxHeader('',$langs->trans("ListOfEmployees")); + +$buttonviewhierarchy=''; + +print load_fiche_titre($langs->trans("ListOfEmployees"), $buttonviewhierarchy); + +$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.gender,"; +$sql.= " u.datec,"; +$sql.= " u.tms as datem,"; +$sql.= " u.ldap_sid, u.statut, u.entity,"; +$sql.= " u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2,"; +$sql.= " s.nom as name, s.canvas"; +$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; +$sql.= " WHERE u.employee >= '1'"; +$sql.= " AND u.entity IN (".getEntity('user',1).")"; + +if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; +if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); +if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty); +if ($search_login != '') $sql.= natural_search("u.login", $search_login); +if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); +if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); +if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; +if ($sall) $sql.= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $sall); +$sql.=$db->order($sortfield,$sortorder); + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows($result); + $i = 0; + + print '
'."\n"; + if ($optioncss != '') print ''; + + $param="search_user=".$search_user."&sall=".$sall; + $param.="&search_statut=".$search_statut; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + + print ''; + print ''; + print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); + if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) + { + print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder); + } + print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + print "\n"; + + // Search bar + if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) $colspan++; + print ''; + print ''; + print ''; + print ''; + print ''; + + // Status + print ''; + + print ''; + + print "\n"; + + $employee2=new Employee($db); + + $var=True; + while ($i < $num) + { + $obj = $db->fetch_object($result); + $var=!$var; + + $employeestatic->id=$obj->rowid; + $employeestatic->ref=$obj->label; + $employeestatic->login=$obj->login; + $employeestatic->statut=$obj->statut; + $employeestatic->email=$obj->email; + $employeestatic->gender=$obj->gender; + $employeestatic->societe_id=$obj->fk_soc; + $employeestatic->firstname=''; + $employeestatic->lastname=$obj->login; + + $li=$employeestatic->getNomUrl(1,'',0,0,24,1); + + print ""; + print ''; + print ''; + print ''; + + // Resp + print ''; + + // Statut + $employeestatic->statut=$obj->statut; + print ''; + print ''; + print "\n"; + $i++; + } + print "
 '; + print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); + print ''; + print ''; + print '
'; + print $li; + if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) + { + print img_picto($langs->trans("SuperAdministrator"),'redstar'); + } + else if ($obj->admin) + { + print img_picto($langs->trans("Administrator"),'star'); + } + print ''.ucfirst($obj->lastname).''.ucfirst($obj->firstname).''; + if ($obj->login2) + { + $employee2->login=$obj->login2; + //$employee2->lastname=$obj->lastname2; + //$employee2->firstname=$obj->firstname2; + $employee2->lastname=$employee2->login; + $employee2->firstname=''; + print $employee2->getNomUrl(1); + } + print ''.$employeestatic->getLibStatut(5).' 
"; + print "
\n"; + $db->free($result); +} +else +{ + dol_print_error($db); +} + +llxFooter(); + +$db->close(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f6399bffa6b..cf1689031a4 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1126,6 +1126,8 @@ EncryptedPasswordInDatabase=To allow the encryption of the passwords in the data DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page UsersSetup=Users module setup UserMailRequired=EMail required to create a new user +##### HRM setup ##### +HRMSetup=HRM module setup ##### Company setup ##### CompanySetup=Companies module setup CompanyCodeChecker=Module for third parties code generation and checking (customer or supplier) diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 33c6c271261..b2e9387d62f 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -8,6 +8,7 @@ DeleteEstablishment=Delete establishment ConfirmDeleteEstablishment=Are-you sure to delete this establishment ? OpenEtablishment=Open establishment CloseEtablishment=Close establishment +ListOfEmployees=List of employees Employees=Employees Employee=Employee NewEmployee=New employee From 12e7c7b9e4aca2673ed136fa2ddafaae77a68993 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Tue, 27 Oct 2015 13:42:00 +0100 Subject: [PATCH 42/45] [Qual] Uniformize code --- htdocs/admin/contract.php | 2 +- htdocs/admin/events.php | 2 +- htdocs/admin/expedition.php | 22 +++++++++++----------- htdocs/admin/expensereport.php | 24 ++++++++++++------------ htdocs/admin/facture.php | 32 ++++++++++++++++---------------- htdocs/admin/fckeditor.php | 6 +++--- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 3198ad51448..acfe7de156f 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -63,7 +63,7 @@ if ($action == 'updateMask') } else { - setEventMessage($langs->trans("Error"), null, 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 04a46071142..a2b5a24c82a 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -61,7 +61,7 @@ if ($action == "save") } $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 9710929ee17..555badf11d8 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -65,9 +65,9 @@ if ($action == 'updateMask') if (isset($res)) { if ($res > 0) - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); else - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -77,9 +77,9 @@ else if ($action == 'set_SHIPPING_FREE_TEXT') $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); if ($res > 0) - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); else - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') @@ -88,9 +88,9 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); if ($res > 0) - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); else - setEventMessage($langs->trans("Error"), 'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } else if ($action == 'specimen') @@ -127,13 +127,13 @@ else if ($action == 'specimen') } else { - setEventMessage($module->error, 'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"), 'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -158,12 +158,12 @@ else if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index ab5f7fb013f..5c8fa9732e4 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2013 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * 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 @@ -60,11 +60,11 @@ if ($action == 'updateMask') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -102,13 +102,13 @@ else if ($action == 'specimen') // For fiche inter } else { - setEventMessage($obj->error,'errors'); - dol_syslog($obj->error, LOG_ERR); + setEventMessages($module->error, $module->errors,'errors'); + dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -133,12 +133,12 @@ if ($action == 'setModuleOptions') if (! $error) { $db->commit(); - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -196,11 +196,11 @@ else if ($action == 'set_EXPENSEREPORT_FREE_TEXT') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -214,11 +214,11 @@ else if ($action == 'set_EXPENSEREPORT_DRAFT_WATERMARK') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 568cd5dca21..dee1789d6ec 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -69,11 +69,11 @@ if ($action == 'updateMask') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -111,13 +111,13 @@ if ($action == 'specimen') } else { - setEventMessage($module->error,'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } @@ -139,11 +139,11 @@ if ($action == 'setModuleOptions') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -200,11 +200,11 @@ if ($action == 'setribchq') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -218,11 +218,11 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -236,11 +236,11 @@ if ($action == 'set_INVOICE_FREE_TEXT') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -254,11 +254,11 @@ if ($action == 'setforcedate') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -272,11 +272,11 @@ if ($action == 'set_FAC_AUTO_FILLJS') if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index b605da7e07b..b5bd4d045f6 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -121,11 +121,11 @@ if (GETPOST('save','alpha')) if (! $error) { - setEventMessage($langs->trans("SetupSaved")); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - setEventMessage($langs->trans("Error"),'errors'); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -143,7 +143,7 @@ $var=true; if (empty($conf->use_javascript_ajax)) { - setEventMessage(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), 'errors'); + setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors'); } else { From fb28586f3259708251f77250a1c05e447bbb8231 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Oct 2015 19:18:22 +0100 Subject: [PATCH 43/45] Better visible of what is possible for stock management --- htdocs/admin/stock.php | 126 +++++++++++++++++++++------------ htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/en_US/stocks.lang | 4 +- 3 files changed, 83 insertions(+), 49 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 2ed2f4f869e..b446f5355ad 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -141,58 +141,75 @@ $var=true; $found=0; +$var=!$var; +print "
'.$langs->trans("DeStockOnBill").''; if (! empty($conf->facture->enabled)) { - $var=!$var; - print "
'.$langs->trans("DeStockOnBill").''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled); print ''; - print "
\n
'.$langs->trans("DeStockOnValidateOrder").''; if (! empty($conf->commande->enabled)) { - $var=!$var; - print "
'.$langs->trans("DeStockOnValidateOrder").''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled); print ''; - print "
\n
'.$langs->trans("DeStockOnShipment").''; if (! empty($conf->expedition->enabled)) { - $var=!$var; - print "
'.$langs->trans("DeStockOnShipment").''; print "
"; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled); print ''; - print "
\n
'.$langs->trans("NoModueToManageStockDecrease").''.$langs->trans("NoModuleToManageStockDecrease").'
'; @@ -208,57 +225,74 @@ $var=true; $found=0; +$var=!$var; +print ""; +print ''.$langs->trans("ReStockOnBill").''; +print ''; if (! empty($conf->fournisseur->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("ReStockOnBill").''; - print ''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); +} +print "\n\n"; +$found++; + +$var=!$var; +print ""; +print ''.$langs->trans("ReStockOnValidateOrder").''; +print ''; if (! empty($conf->fournisseur->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("ReStockOnValidateOrder").''; - print ''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); +} +print "\n\n"; +$found++; + +$var=!$var; +print ""; +print ''.$langs->trans("ReStockOnDispatchOrder").''; +print ''; if (! empty($conf->fournisseur->enabled)) { - $var=!$var; - print ""; - print ''.$langs->trans("ReStockOnDispatchOrder").''; - print ''; - print "
"; + print ""; print ''; print ""; print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled); print ''; - print "
\n\n\n"; - $found++; + print "\n"; } +else +{ + print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); +} +print "\n\n"; +$found++; -if (! $found) +/*if (! $found) { $var=!$var; print ""; print ''.$langs->trans("NoModueToManageStockIncrease").''; print "\n"; -} +}*/ print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f6399bffa6b..f53df55b6c5 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -356,7 +356,7 @@ ThemeDir=Skins directory ConnectionTimeout=Connexion timeout ResponseTimeout=Response timeout SmsTestMessage=Test message from __PHONEFROM__ to __PHONETO__ -ModuleMustBeEnabledFirst=Module %s must be enabled first before using this feature. +ModuleMustBeEnabledFirst=Module %s must be enabled first if you need this feature. SecurityToken=Key to secure URLs NoSmsEngine=No SMS sender manager available. SMS sender manager are not installed with default distribution (because they depends on an external supplier) but you can find some on %s PDF=PDF diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 8a46433ff9c..2ac77f8a489 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -53,8 +53,8 @@ QtyDispatched=Quantity dispatched QtyDispatchedShort=Qty dispatched QtyToDispatchShort=Qty to dispatch OrderDispatch=Stock dispatching -RuleForStockManagementDecrease=Rule for stock management decrease -RuleForStockManagementIncrease=Rule for stock management increase +RuleForStockManagementDecrease=Rule for automatic stock management decrease (manual decrease is always possible, even if an automatic decrease rule is activated) +RuleForStockManagementIncrease=Rule for automatic stock management increase (manual increase is always possible, even if an automatic increase rule is activated) DeStockOnBill=Decrease real stocks on customers invoices/credit notes validation DeStockOnValidateOrder=Decrease real stocks on customers orders validation DeStockOnShipment=Decrease real stocks on shipping validation From 76ded0aceadbad8843b80619ae6f83f5648fa780 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Oct 2015 19:26:33 +0100 Subject: [PATCH 44/45] Fix using DATE_FORMAT is forbidden --- htdocs/core/boxes/box_task.php | 35 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index d6a65884ffb..97767dd15d1 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -82,52 +82,51 @@ class box_task extends ModeleBoxes $sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt"; - $sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = '".date("Y")."' "; + $sql.= " WHERE pt.datec BETWEEN '".$this->db->idate(dol_get_first_day(date("Y"), 1))."' AND '".$this->db->idate(dol_get_last_day(date("Y"), 12))."'"; $sql.= " AND pt.rowid = ptt.fk_task"; $sql.= " GROUP BY pt.fk_statut "; $sql.= " ORDER BY pt.fk_statut DESC"; $sql.= $db->plimit($max, 0); $result = $db->query($sql); - - if ($result) { + if ($result) + { $num = $db->num_rows($result); $i = 0; - while ($i < $num) { - $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projecttask'); - + while ($i < $num) + { $objp = $db->fetch_object($result); - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0), + 'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0), ); - $this->info_box_contents[$i][2] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => $objp->nb." ".$langs->trans("Tasks"), 'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut, ); $totalnb += $objp->nb; - $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); $totalplannedtot += $objp->plannedtot; - $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); $totaldurationtot += $objp->durationtot; - $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); + $this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); $i++; } } + else dol_print_error($this->db); } // Add the sum à the bottom of the boxes - $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead); - $this->info_box_contents[$i][1] = array('td' => '', 'text' => ""); - $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); - $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); - $this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); - $this->info_box_contents[$i][5] = array('td' => '', 'text' => ""); + $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead); + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); + $this->info_box_contents[$i][] = array('td' => '', 'text' => ""); } From f9c9c58cba2d8aae545756e3cea906252be2419e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Oct 2015 20:36:27 +0100 Subject: [PATCH 45/45] Label must be cheque or transfer --- htdocs/langs/en_US/bills.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 94e1fa60251..8ff109b2b09 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -351,7 +351,7 @@ ExtraInfos=Extra infos RegulatedOn=Regulated on ChequeNumber=Check N° ChequeOrTransferNumber=Check/Transfer N° -ChequeMaker=Check transmitter +ChequeMaker=Check/Transfer transmitter ChequeBank=Bank of Check CheckBank=Check NetToBePaid=Net to be paid