diff --git a/dev/initdata/img/applepieproduct.jpg b/dev/initdata/img/applepieproduct.jpg new file mode 100644 index 00000000000..f63ddacc770 Binary files /dev/null and b/dev/initdata/img/applepieproduct.jpg differ diff --git a/dev/initdata/img/dolidroid_114x114.png b/dev/initdata/img/dolidroid_114x114.png new file mode 100644 index 00000000000..88c6bf0c3da Binary files /dev/null and b/dev/initdata/img/dolidroid_114x114.png differ diff --git a/dev/initdata/img/dolidroid_512x512_en.png b/dev/initdata/img/dolidroid_512x512_en.png new file mode 100644 index 00000000000..9de25fb5ce9 Binary files /dev/null and b/dev/initdata/img/dolidroid_512x512_en.png differ diff --git a/dev/initdata/img/dolidroid_screenshot_home_720x1280.png b/dev/initdata/img/dolidroid_screenshot_home_720x1280.png new file mode 100644 index 00000000000..34bcfbb6628 Binary files /dev/null and b/dev/initdata/img/dolidroid_screenshot_home_720x1280.png differ diff --git a/dev/initdata/img/genericcustomer.png b/dev/initdata/img/genericcustomer.png new file mode 100644 index 00000000000..4c41073c3fa Binary files /dev/null and b/dev/initdata/img/genericcustomer.png differ diff --git a/dev/initdata/img/indiancompany.png b/dev/initdata/img/indiancompany.png new file mode 100644 index 00000000000..f38da8ae4b1 Binary files /dev/null and b/dev/initdata/img/indiancompany.png differ diff --git a/dev/initdata/img/logo_nltechno_94x100.png b/dev/initdata/img/logo_nltechno_94x100.png new file mode 100644 index 00000000000..7e00ab58884 Binary files /dev/null and b/dev/initdata/img/logo_nltechno_94x100.png differ diff --git a/dev/initdata/img/nocountrycomp.png b/dev/initdata/img/nocountrycomp.png new file mode 100644 index 00000000000..71db7eed091 Binary files /dev/null and b/dev/initdata/img/nocountrycomp.png differ diff --git a/dev/initdata/img/pearpieproduct.jpg b/dev/initdata/img/pearpieproduct.jpg new file mode 100644 index 00000000000..3eb696c54bf Binary files /dev/null and b/dev/initdata/img/pearpieproduct.jpg differ diff --git a/dev/initdata/img/pinkdressproduct.jpg b/dev/initdata/img/pinkdressproduct.jpg new file mode 100644 index 00000000000..f38b413f8e5 Binary files /dev/null and b/dev/initdata/img/pinkdressproduct.jpg differ diff --git a/dev/initdata/img/printcompany.png b/dev/initdata/img/printcompany.png index f3e51e3b5a7..b745fc77174 100644 Binary files a/dev/initdata/img/printcompany.png and b/dev/initdata/img/printcompany.png differ diff --git a/dev/initdata/img/rolluproduct.jpg b/dev/initdata/img/rolluproduct.jpg new file mode 100644 index 00000000000..0ba89e82d66 Binary files /dev/null and b/dev/initdata/img/rolluproduct.jpg differ diff --git a/dev/initdata/img/spanishcompany.png b/dev/initdata/img/spanishcompany.png new file mode 100644 index 00000000000..730d8382aa0 Binary files /dev/null and b/dev/initdata/img/spanishcompany.png differ diff --git a/dev/initdata/img/swisstouch.png b/dev/initdata/img/swisstouch.png new file mode 100644 index 00000000000..49dcb0aeb6d Binary files /dev/null and b/dev/initdata/img/swisstouch.png differ diff --git a/dev/initdata/img/teclibcompany.png b/dev/initdata/img/teclibcompany.png new file mode 100644 index 00000000000..23e65218842 Binary files /dev/null and b/dev/initdata/img/teclibcompany.png differ diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 7239ee89a4b..b43235ca1ec 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -177,7 +177,7 @@ if ($action == 'edit') $var=false; print ''; - print ''.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',(isset($conf->global->MAIN_DISABLE_METEO)?1:0),1) . ''; + print ''.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . ''; print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 911372733f1..418e164bc94 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -9,6 +9,7 @@ * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2011-2015 Alexandre Spangaro + * Copyright (C) 2015 Ferran Marcet * * 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 diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 68eb6994e5a..e91ffe18d45 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -421,6 +421,20 @@ class ActionComm extends CommonObject $this->id=0; + if (!is_object($fuser)) + { + if ($fuser > 0) + { + $u = new User($db); + $u->fetch($fuser); + $fuser = $u; + } + else + { + $fuser = $user; + } + } + // Create clone $result=$this->add($fuser); if ($result < 0) $error++; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index dbe0722c77d..8a2ee5bce35 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -276,7 +276,7 @@ if ($action == 'create') // Label print ''.$langs->trans("LabelBankCashAccount").''; - print ''; + print ''; // Type print ''.$langs->trans("AccountType").''; @@ -477,19 +477,19 @@ if ($action == 'create') if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { print ''.$langs->trans("AccountancyCode").''; - print 'account_number).'">'; + print 'account_number).'">'; } else { print ''.$langs->trans("AccountancyCode").''; - print 'account_number).'">'; + print 'account_number).'">'; } // Accountancy journal if (! empty($conf->accounting->enabled)) { print ''.$langs->trans("AccountancyJournal").''; - print 'accountancy_journal).'">'; + print 'accountancy_journal).'">'; } print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index de1cba15e17..eb3f969890b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3667,7 +3667,7 @@ else if ($id > 0 || ! empty($ref)) } else { - print ''; + print ''; } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cd3386d5d90..78f544cc8ab 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2918,6 +2918,7 @@ abstract class CommonObject /** * Return if a country is inside the EEC (European Economic Community) + * TODO Add a field into dictionary * * @return boolean true = country inside EEC, false = country outside EEC */ @@ -2939,7 +2940,8 @@ abstract class CommonObject 'FR', // France 'GB', // United Kingdom 'GR', // Greece - 'NL', // Holland + 'HR', // Croatia + 'NL', // Holland 'HU', // Hungary 'IE', // Ireland 'IM', // Isle of Man - Included in UK @@ -2949,7 +2951,7 @@ abstract class CommonObject 'LV', // Latvia 'MC', // Monaco - Included in France 'MT', // Malta - //'NO', // Norway + //'NO', // Norway 'PL', // Poland 'PT', // Portugal 'RO', // Romania diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 528abfcd6a5..03eb651e4db 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -93,10 +93,14 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt //dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress); $countryid=$seller->country_id; + + if (is_numeric($uselocaltax1_rate)) $uselocaltax1_rate=(float) $uselocaltax1_rate; + if (is_numeric($uselocaltax2_rate)) $uselocaltax2_rate=(float) $uselocaltax2_rate; + if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj; if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj; - dol_syslog('Price.lib::calcul_price_total qty='.$qty.' pu='.$pu.' remise_percent_ligne='.$remise_percent_ligne.' txtva='.$txtva.' uselocaltax1_rate='.$uselocaltax1_rate.' uselocaltax2_rate='.$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress); + dol_syslog('Price.lib::calcul_price_total qty='.$qty.' pu='.$pu.' remise_percent_ligne='.$remise_percent_ligne.' txtva='.$txtva.' uselocaltax1_rate='.$uselocaltax1_rate.' uselocaltax2_rate='.$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$price_base_type.' type='.$type.' progress='.$progress); // Now we search localtaxes information ourself (rates and types). $localtax1_type=0; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index e967f6781ea..7a4621cc396 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -250,6 +250,9 @@ class pdf_crabe extends ModelePDFFactures global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + // Set nblignes with the new facture lines content after hook + $nblignes = count($object->lines); + // Create pdf instance $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 31172a32f43..2b60695db51 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -585,9 +585,9 @@ class doc_generic_task_odt extends ModelePDFTask $odfHandler->mergeSegment($listlinestaskres); } - //Time ressources + // Time ressources $sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note"; - $sql.= ", u.name, u.firstname"; + $sql.= ", u.lastname, u.firstname"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE t.fk_task =".$object->id; @@ -607,6 +607,7 @@ class doc_generic_task_odt extends ModelePDFTask if (!empty($row['fk_user'])) { $objectdetail=new User($this->db); $objectdetail->fetch($row['fk_user']); + // TODO Use a cache to aoid fetch for same user $row['fullcivname']=$objectdetail->getFullName($outputlangs,1); } else { $row['fullcivname']=''; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 006b349c965..b881f45dab0 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -1088,7 +1088,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetTextColor(0,0,60); $usehourmin='day'; - if (empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour'; + if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour'; if (! empty($object->date_livraison)) { $posy+=4; diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 4316ab0b318..4de0bfd1743 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -341,7 +341,7 @@ if (! empty($conf->margin->enabled)) setTimeout(function () { rate.focus() }, 50); return false; } - if (npRate == "np_markRate" && rate.val() >= 100) + if (npRate == "np_markRate" && rate.val() > 100) { alert('transnoentitiesnoconv("markRateShouldBeLesserThan100"); ?>'); e.stopPropagation(); @@ -362,7 +362,7 @@ if (! empty($conf->margin->enabled)) price = ((bpjs * (1 + (ratejs / 100))) / (1 - remisejs / 100)); else if (npRate == "np_markRate") { - if (ratejs != 100) + if (ratejs != 100) // If markRate is 100, it means buying price is 0, so it is not possible to retreive price from it and markRate. We keep it unchange { price = ((bpjs / (1 - (ratejs / 100))) / (1 - remisejs / 100)); } diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index fe775139362..8a58541772a 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -222,7 +222,7 @@ if ($resql) print_liste_field_titre($langs->trans("TotalHT"),$_SERVER["PHP_SELF"],"d.total_ht","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("TotalVAT"),$_SERVER["PHP_SELF"],"d.total_tva","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("TotalTTC"),$_SERVER["PHP_SELF"],"d.total_ttc","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Statut"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a72a6f61aa3..ce03c9ba1c8 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -458,6 +458,9 @@ if (empty($reshook)) break; } } + + // Now reload line + $object->fetch_lines(); } else { @@ -1321,7 +1324,6 @@ if ($action == 'create') $datedue=($datetmp==''?-1:$datetmp); } - dol_fiche_head(); print '
'; print ''; @@ -1329,6 +1331,8 @@ if ($action == 'create') print ''; print ''; + dol_fiche_head(); + print ''; // Ref diff --git a/htdocs/langs/en_US/sms.lang b/htdocs/langs/en_US/sms.lang index 4e89bb24730..70066caac96 100644 --- a/htdocs/langs/en_US/sms.lang +++ b/htdocs/langs/en_US/sms.lang @@ -49,5 +49,6 @@ SendSms=Send SMS SmsInfoCharRemain=Nb of remaining characters SmsInfoNumero= (format international ie : +33899701761) DelayBeforeSending=Delay before sending (minutes) +SmsNoPossibleSenderFound=No sender available. Check setup of your SMS provider. SmsNoPossibleRecipientFound=No target available. Check setup of your SMS provider. diff --git a/htdocs/opensurvey/wizard/index.php b/htdocs/opensurvey/wizard/index.php index 68f75f3bce7..0fdde4bbe40 100644 --- a/htdocs/opensurvey/wizard/index.php +++ b/htdocs/opensurvey/wizard/index.php @@ -1,6 +1,7 @@ - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2013 Laurent Destailleur + * Copyright (C) 2014 Marcos García + * Copyright (C) 2016 Regis Houssin * * 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 @@ -22,7 +23,7 @@ //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 76e1a22dd37..615ee04cd44 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Charles-Fr Benke * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -115,9 +116,9 @@ if ($result) while ($objp = $db->fetch_object($result)) { $found=0; - if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { $found=1; $third['prospect']++; } - if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found=1; $third['customer']++; } - if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found=1; $third['supplier']++; } + if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { $found=1; $third['prospect']++; } + if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found=1; $third['customer']++; } + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found=1; $third['supplier']++; } if (! empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { $found=1; $third['other']++; } if ($found) $total++; } @@ -130,9 +131,9 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou { print '"; $statstring.= ''; $statstring.= ""; } - if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) + if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $statstring.= ""; $statstring.= ''; $statstring.= ""; } - if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) + if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire) { $statstring2 = ""; $statstring2.= '';
'; $dataseries=array(); - if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect'])); - if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer'])); - if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier'])); + if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect'])); + if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer'])); + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier'])); if (! empty($conf->societe->enabled)) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other'])); $data=array('series'=>$dataseries); dol_print_graph('stats',300,180,$data,1,'pie',0,'',0); @@ -140,19 +141,19 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou } else { - if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) + if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = "
'.$langs->trans("Prospects").''.round($third['prospect']).'
'.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'