diff --git a/build/doxygen/dolibarr-doxygen-build.pl b/build/doxygen/dolibarr-doxygen-build.pl old mode 100644 new mode 100755 diff --git a/build/doxygen/dolibarr-doxygen-filter.pl b/build/doxygen/dolibarr-doxygen-filter.pl old mode 100644 new mode 100755 diff --git a/build/doxygen/dolibarr-doxygen-getversion.pl b/build/doxygen/dolibarr-doxygen-getversion.pl old mode 100644 new mode 100755 diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index d4beb3ecdd97f..a4b9bdb7a5a2f 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -256,9 +256,9 @@ print ' '; print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index ac5b825b4217a..d733182f054cd 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -188,7 +188,7 @@ print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 9f4be55eb407d..81ea914e481aa 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -499,7 +499,7 @@ function del_type($obj,$type) $column_name=$type; if ($type=='contact') $column_name='socpeople'; if ($type=='fournisseur') $column_name='societe'; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".$type; $sql .= " WHERE fk_categorie = ".$this->id; $sql .= " AND fk_".$column_name." = ".$obj->id; @@ -571,6 +571,49 @@ function get_type($field,$classname,$category_table='',$object_table='') } } + /** + * check for the presence of an object in a category + * + * @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact') + * @param int $object_id id of the object to search + * @return int number of occurrences + */ + function containsObject($type, $object_id) + { + $field = ''; $classname = ''; $category_table = ''; $object_table = ''; + if ($type == 'product') { + $field = 'product'; + } + if ($type == 'customer') { + $field = 'societe'; + } + if ($type == 'supplier') { + $field = 'societe'; + $category_table = 'fournisseur'; + } + if ($type == 'member') { + $field = 'member'; + $category_table = ''; + } + if ($type == 'contact') { + $field = 'socpeople'; + $category_table = 'contact'; + } + if (empty($category_table)) { + $category_table = $field; + } + $sql = "SELECT COUNT(*) as nb FROM " . MAIN_DB_PREFIX . "categorie_" . $category_table; + $sql .= " WHERE fk_categorie = " . $this->id . " AND fk_" . $field . " = " . $object_id; + dol_syslog(get_class($this)."::containsObject sql=".$sql); + $resql = $this->db->query($sql); + if ($resql) { + return $this->db->fetch_object($resql)->nb; + } else { + $this->error=$this->db->error().' sql='.$sql; + dol_syslog(get_class($this)."::containsObject ".$this->error, LOG_ERR); + return -1; + } + } /** * Return childs of a category diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 5c85f745def0e..7f9d7ede4409b 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -141,7 +141,7 @@ print ''; print ''; print ' '; - print ''; + print ''; print "\n"; print ''; diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index ed12edd032a02..4e6ac38c81010 100644 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -233,9 +233,9 @@ print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print ''; $parameters=array(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 5b3ec5bfc1d9a..916a616366872 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -434,9 +434,9 @@ print ''; // Source print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 3510df7339eef..8d7f3ea988ada 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -1080,7 +1080,7 @@ { $out.= '
'; $out.= img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name']; - $out.= ' '; + $out.= ' '; $out.= '
'; } } diff --git a/htdocs/comm/mailing/liste.php b/htdocs/comm/mailing/liste.php index 41a4e57a7ac9e..81af4f4f6e680 100644 --- a/htdocs/comm/mailing/liste.php +++ b/htdocs/comm/mailing/liste.php @@ -121,7 +121,7 @@ print ' '; if (! $filteremail) print ' '; print ' '; - print ''; + print ''; print ""; print "\n"; print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 262ccbfe91e53..7a652631d676f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -309,7 +309,7 @@ print ''; $formpropal->select_propal_statut($viewstatut,1); print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 18038d3ed44f3..767a29f0b88ad 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -378,7 +378,7 @@ // Print the search button print ''; - print ''; + print ''; print ''; $parameters=array(); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 35a5891d60489..373775a0da09a 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -142,7 +142,7 @@ print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index aaf6b5312ae19..c4a416f1898a9 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -301,7 +301,7 @@ print ' '; print ' '; print ''; - print ''; + print ''; print ''; $var=true; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 806fd95a95795..aa2883ccb96a3 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -603,7 +603,7 @@ //SEARCH BUTTON print ''; - print ''; + print ''; //ALL/NONE print ''; diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 319ba7ab9d9ab..d85d6ff3b271b 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -422,7 +422,7 @@ print ''; print ''; print ' '; - print ''; + print ''; print "\n"; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 650733dbb9c59..a94e2fc5cd021 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -184,7 +184,7 @@ print ''; print ''; if (! empty($_REQUEST['bid'])) print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index f54f893d79c0b..4f6719adb145e 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -173,7 +173,7 @@ print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 330f493e6bab1..94a3a26a0f312 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -119,7 +119,7 @@ print ''; print ' '; print ''; - print ''; + print ''; print "\n"; $var=true; diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index 56c66d4fdce83..f045e82be71ac 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -144,7 +144,7 @@ print ''; print ' '; print ''; - print ''; + print ''; print "\n"; $var=True; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 3d792e343f0d5..d17507558351c 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -299,7 +299,7 @@ print ' '; print ' '; print ''; - print ''; + print ''; print ''; print ''; if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 83b9fd309458e..42d08c3b02cb3 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -317,7 +317,7 @@ print ' '; print ''; print ' '; - print ''; + print ''; print "\n"; if ($num > 0) diff --git a/htdocs/compta/paiement/cheque/liste.php b/htdocs/compta/paiement/cheque/liste.php index 1c1cf71b11c99..7f656a75c7998 100644 --- a/htdocs/compta/paiement/cheque/liste.php +++ b/htdocs/compta/paiement/cheque/liste.php @@ -102,7 +102,7 @@ print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index 5e1653b3ec351..16a6c1410e689 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -167,7 +167,7 @@ print ''; print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index d5c140be91e57..cd460f1aac22c 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -88,7 +88,7 @@ print '
'; print ''; print ' '; - print ''; + print ''; print '
'; print ''; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 3ae2b850aac7b..e48896458693f 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -114,7 +114,7 @@ print '
'; print ''; print ''; - print ''; + print ''; print ''; print '
'; diff --git a/htdocs/compta/prelevement/liste.php b/htdocs/compta/prelevement/liste.php index 5ed627dee587d..2cd859969a911 100644 --- a/htdocs/compta/prelevement/liste.php +++ b/htdocs/compta/prelevement/liste.php @@ -129,7 +129,7 @@ print ''; print ' '; print ' '; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 54cb9fc0c42d1..e96c53895299b 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -162,7 +162,7 @@ print ' '; print ' '; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index e24ca5dd56b83..ac82e2e342ac8 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -252,7 +252,7 @@ } print '>'; print ''; - print ''; + print ''; print ''; // Array header print ""; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 97333f1758cc3..9745ef1629086 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -322,7 +322,7 @@ } print'>'; print ''; -print ''; +print ''; print ''; print ''; // Array titles diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php index e8578e7dcf096..fbc8655717811 100644 --- a/htdocs/compta/ventilation/lignes.php +++ b/htdocs/compta/ventilation/lignes.php @@ -90,7 +90,7 @@ print ' '; print ' '; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 2b1c5e982df68..1c735d787b423 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -343,9 +343,9 @@ print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print ''; print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 40a6811e41b9a..38576f7e764c7 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -129,7 +129,7 @@ print ''; print ' '; //print ' '; - print ''; + print ''; print ""; print "\n"; print ''; diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index ea42df9e01dd9..2f42fc39c77ff 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -184,7 +184,7 @@ $filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year); print $form->select_date($filter_date2,'op2',0,0,1); print ''; - print ''; + print ''; print ""; print "\n"; print ''; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 64dd4c8b9fa09..903694128f9e4 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -156,15 +156,19 @@ function setValues($db) if ($value && preg_match('/^MAIN_MODULE_/',$key)) { - // If this is constant for a new tab page activated by a module. + // If this is constant for a new tab page activated by a module. It initializes modules_parts['tabs']. if (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i',$key)) { $partname = 'tabs'; $params=explode(':',$value,2); if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); } - $this->modules_parts[$partname][$params[0]][]=$value; + $this->modules_parts[$partname][$params[0]][]=$value; // $value may be a string or an array } - // If this is constant for all generic part activated by a module + // If this is constant for all generic part activated by a module. It initializes + // modules_parts['login'], modules_parts['menus'], modules_parts['substitutions'], modules_parts['triggers'], modules_parts['tpl'], + // modules_parts['models'], modules_parts['theme'] + // modules_parts['sms'], + // modules_parts['css'], ... elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i',$key,$reg)) { $modulename = strtolower($reg[1]); @@ -176,7 +180,7 @@ function setValues($db) else if (in_array($partname,array('models','theme'))) $value = '/'.$modulename.'/'; else if (in_array($partname,array('sms'))) $value = $modulename; else if ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe - $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); + $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); // $value may be a string or an array } // If this is a module constant (must be at end) elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i',$key,$reg)) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 9c0968436d3e4..172d65b4ca6b0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -796,7 +796,7 @@ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownlo { print ''; $tmp=explode('.',$file['name']); - $minifile=$tmp[0].'_mini.'.$tmp[1]; + $minifile=$tmp[0].'_mini.'.strtolower($tmp[1]); // Thumbs are created with filename in lower case if (image_format_supported($file['name']) > 0) print ''; else print ' '; print ''; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index bcd6c53d48989..a81eff0e5c3b4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -630,7 +630,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') // Edit print ''; - print ''; + print ''; print ''; print ""; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 3df77ec722a1f..dd4ff4b6ed39d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -538,13 +538,13 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1) $newpathofdestfile=dol_osencode($destfile); $result=@rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @ - if (! $result) + if (! $result) { - if ($destexists) + if ($destexists) { dol_syslog("files.lib.php::dol_move failed. We try to delete first and move after.", LOG_WARNING); // We force delete and try again. Rename function sometimes fails to replace dest file with some windows NTFS partitions. - dol_delete_file($destfile); + dol_delete_file($destfile); $result=@rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @ } else dol_syslog("files.lib.php::dol_move failed", LOG_WARNING); @@ -726,6 +726,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n $langs->load("other"); $langs->load("errors"); + dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook); + if (empty($nohook)) { $hookmanager->initHooks(array('fileslib')); @@ -1301,7 +1303,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu if (empty($modulepart)) return 'ErrorBadParameter'; if (empty($entity)) $entity=0; - dol_syslog('modulepart='.$modulepart.' original_file= '.$original_file); + dol_syslog('modulepart='.$modulepart.' original_file='.$original_file); // We define $accessallowed and $sqlprotectagainstexternals $accessallowed=0; $sqlprotectagainstexternals=''; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 4e88c56130687..76647f4a1b5d0 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -178,10 +178,10 @@ function __construct($db) $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("facture","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php index 06edca3c7c7c5..7bfc59641407b 100644 --- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php @@ -41,12 +41,17 @@ { if ($object->id) { - $urlfile = GETPOST('urlfile', 'alpha'); - $linkid = GETPOST('linkid', 'int'); + $urlfile = GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). + if (GETPOST('section')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir + else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. + { + $urlfile=basename($urlfile); + $file = $upload_dir . "/" . $urlfile; + } + $linkid = GETPOST('linkid', 'int'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). + if ($urlfile) { - $file = $upload_dir . "/" . $urlfile; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret = dol_delete_file($file, 0, 0, 0, $object); if ($ret) { setEventMessage($langs->trans("FileWasRemoved", $urlfile)); diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index fa3d21b92015a..731084c09260a 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -25,7 +25,7 @@ if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1; if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1; -$arrayofjs=array('/core/js/dst.js'); // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second +$arrayofjs=array('/core/js/dst.js'.(empty($conf->dol_use_jmobile)?'':'?version='.urlencode(DOL_VERSION))); // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second $titleofloginpage=$langs->trans('Login').' '.$title; // title is defined by dol_loginfunction in security2.lib.php print top_htmlhead('',$titleofloginpage,0,0,$arrayofjs); ?> @@ -33,12 +33,14 @@ +dol_use_jmobile)) { ?> +
@@ -205,7 +207,38 @@ } ?> + + + + + + +global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?> + +google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)) +{ + if (empty($conf->dol_use_jmobile)) + { + print "\n"; + print ''."\n"; + } +} +?> + google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT)) { if (empty($conf->dol_use_jmobile)) @@ -228,12 +261,6 @@ } ?> - - - - -global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?> -
diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 428001e7141fc..414c12bb46232 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -31,13 +31,14 @@ - +dol_use_jmobile)) { ?> +
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 8d27450eaf8d9..19a0d5cc3b18d 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -182,9 +182,9 @@ print $form->selectarray('status', array('0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")), $status, 1); print ''; print ' '; -print ''; +print ''; print '  '; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 93142ed2dc3cf..2a037a07563e0 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -124,7 +124,7 @@ print ' '; print ' '; print ' '; - print ''; + print ''; print "\n"; $companystatic=new Societe($db); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a237ef49a5fd0..060d2d51a83c2 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1378,7 +1378,7 @@ function load_board($user) while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->fournisseur->warning_delay)) $this->nbtodolate++; + if (! empty($obj->datefin) && $this->db->jdate($obj->datefin) < ($now - $conf->facture->fournisseur->warning_delay)) $this->nbtodolate++; } $this->db->free($resql); return 1; diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index bc4004e4fc114..d6c4bb9427dde 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -152,7 +152,7 @@ print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 87c3c7e6dc835..f7d62f8692e03 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -217,7 +217,7 @@ print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index bc7632350c168..dd8d778d63a8d 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -235,7 +235,7 @@ print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index f625cead27cfa..8f3f29098326a 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -463,7 +463,7 @@ print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index f59e692fb87fc..5ce488939b3b2 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -183,7 +183,7 @@ print ''; print ''; - print ''; + print ''; $parameters=array(); $formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php index 7806fdab1bd2d..76c34be703413 100644 --- a/htdocs/fourn/product/liste.php +++ b/htdocs/fourn/product/liste.php @@ -200,9 +200,9 @@ print ''; print ''; print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index 34443bfaa988d..e7c4b0a3d50c8 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -326,7 +326,7 @@ // ACTION print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 904144cad66c4..05defaed9eb5a 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -15,6 +15,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * Upgrade scripts can be ran from command line with syntax: + * + * cd htdocs/install + * php upgrade.php 3.4.0 3.5.0 + * php upgrade2.php 3.4.0 3.5.0 + * + * Return code is 0 if OK, >0 if error */ /** @@ -260,6 +268,7 @@ } } + /* * Remove deprecated indexes and constraints for Mysql */ @@ -343,12 +352,12 @@ { while (($file = readdir($handle))!==false) { - if (preg_match('/\.sql$/i',$file)) $filesindir[]=$file; + if (preg_match('/\.sql$/i',$file)) $filesindir[]=$file; } sort($filesindir); } else - { + { print '
'.$langs->trans("ErrorCanNotReadDir",$dir).'
'; } @@ -413,7 +422,6 @@ if ($db->connected) $db->close(); } - if (empty($actiondone)) { print '
'.$langs->trans("ErrorWrongParameters").'
'; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 78c223a98072b..593ae33ebcc22 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -16,6 +16,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * Upgrade scripts can be ran from command line with syntax: + * + * cd htdocs/install + * php upgrade.php 3.4.0 3.5.0 + * php upgrade2.php 3.4.0 3.5.0 + * + * Return code is 0 if OK, >0 if error */ /** diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index e4de38e621e43..88ac8d90d5ee1 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -28,6 +28,7 @@ EndBankBalance=End balance CurrentBalance=Current balance FutureBalance=Future balance ShowAllTimeBalance=Show balance from start +AllTime=From start Reconciliation=Reconciliation RIB=Bank Account Number IBAN=IBAN number diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e8342224c4b5e..3c48228613e3d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -680,8 +680,8 @@ function analyse_sql_and_script(&$var, $type) if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) $conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT; // Can be 0 if (isset($user->conf->PRODUIT_LIMIT_SIZE)) $conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; // Can be 0 - // Replace conf->css by personalized value - if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME) + // Replace conf->css by personalized value if theme not forced + if (empty($conf->global->MAIN_FORCETHEME) && ! empty($user->conf->MAIN_THEME)) { $conf->theme=$user->conf->MAIN_THEME; $conf->css = "/theme/".$conf->theme."/style.css.php"; @@ -972,41 +972,44 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs else print "".$appli.""; print "\n"; + $ext=''; + if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION); + if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax) { print ''."\n"; $jquerytheme = 'smoothness'; if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; - if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery - else print ''."\n"; // JQuery - print ''."\n"; // Tooltip - print ''."\n"; // JNotify + if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery + else print ''."\n"; // JQuery + print ''."\n"; // Tooltip + print ''."\n"; // JNotify /*if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD'))) // jQuery fileupload { - print ''."\n"; + print ''."\n"; }*/ if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES'))) // jQuery datatables { - //print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - //print ''."\n"; - print ''."\n"; + //print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + //print ''."\n"; + print ''."\n"; } if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT'))) // jQuery multiselect { - print ''."\n"; + print ''."\n"; } // jQuery Timepicker if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { - print ''."\n"; + print ''."\n"; } // jQuery jMobile if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile)) { - print ''."\n"; + print ''."\n"; } } @@ -1029,6 +1032,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs } } $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'').'&userid='.$user->id.'&entity='.$conf->entity; + $themeparam.=($ext?'&'.$ext:''); if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; if (GETPOST('dol_hide_topmenu')) { $themeparam.='&dol_hide_topmenu='.GETPOST('dol_hide_topmenu'); } if (GETPOST('dol_hide_leftmenu')) { $themeparam.='&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu'); } @@ -1047,6 +1051,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs $filescss=(array) $filescss; // To be sure filecss is an array foreach($filescss as $cssfile) { + if (empty($cssfile)) dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING); // cssfile is a relative path print ''."\n".''."\n"; } } - $ext='.js'; - // Output standard javascript links if (! defined('DISABLE_JQUERY') && ! $disablejs && ! empty($conf->use_javascript_ajax)) { // JQuery. Must be before other includes print ''."\n"; - if (constant('JS_JQUERY')) print ''."\n"; - else print ''."\n"; - if (constant('JS_JQUERY_UI')) print ''."\n"; - else print ''."\n"; - print ''."\n"; - print ''."\n"; + if (constant('JS_JQUERY')) print ''."\n"; + else print ''."\n"; + if (constant('JS_JQUERY_UI')) print ''."\n"; + else print ''."\n"; + print ''."\n"; + print ''."\n"; // jQuery Layout if (! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT')) { - print ''."\n"; + print ''."\n"; } // jQuery jnotify if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY')) { - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; } // jQuery blockUI if (! empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) || defined('REQUIRE_JQUERY_BLOCKUI')) { - print ''."\n"; + print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; } // Flot if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT)) { if (constant('JS_JQUERY_FLOT')) { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; } else { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; } } // jQuery jeditable if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; } // jQuery File Upload /* if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD'))) { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; }*/ // jQuery DataTables if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES'))) { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; } // jQuery Multiselect if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT'))) { - print ''."\n"; + print ''."\n"; } // jQuery Timepicker if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; } // jQuery jMobile if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0)) @@ -1188,7 +1191,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs }); '; } - if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n"; + if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n"; } } @@ -1206,15 +1209,15 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; } // Global js function print ''."\n"; - print ''."\n"; + print ''."\n"; // Add datepicker default options - print ''."\n"; + print ''."\n"; // JS forced by modules (relative url starting with /) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) @@ -1422,11 +1425,20 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"])); $appli='Dolibarr'; - if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) + { + $appli=$conf->global->MAIN_APPLICATION_TITLE; + if (preg_match('/\d\.\d/', $appli)) + { + if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + else $appli.=" ".DOL_VERSION; + } + else $appli.=" ".DOL_VERSION; // Link info $logouttext=''; - $logouthtmltext=$appli.' '.DOL_VERSION.'
'; + $logouthtmltext=$appli.'
'; $logouthtmltext.=$langs->trans("Logout").'
'; //$logouthtmltext.="
"; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') @@ -1620,10 +1632,16 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me if (preg_match('/es/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.es'; $appli='Dolibarr'; - if (! empty($conf->global->MAIN_APPLICATION_TITLE)) { + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) + { $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; + if (preg_match('/\d\.\d/', $appli)) + { + if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + else $appli.=" ".DOL_VERSION; } - $appli.=" ".DOL_VERSION; + else $appli.=" ".DOL_VERSION; print '
'; if ($doliurl) print ''; print $appli; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index e9fe0b60a03af..283305860705d 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -370,8 +370,8 @@ print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 00793b2ff8a9c..fcbcd780fb6eb 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -274,8 +274,8 @@ print ' '; print ' '; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index eb9391c869825..f8135b69566e3 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -452,9 +452,9 @@ print ''; print ''; print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print ''; print "\n"; print ''; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 788bd8fee092a..887a23ac0bc40 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -176,7 +176,7 @@ $sql.= ' p.price_ttc, p.price_base_type,p.fk_product_type,'; $sql.= ' p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,'; $sql.= ' p.desiredstock,'; -$sql.= ' SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").') as stock_physique'; +$sql.= ' SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").') as stock_physique'; $sql.= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; $sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s'; $sql.= ' ON p.rowid = s.fk_product'; @@ -219,7 +219,7 @@ $sql.= ' AND p.desiredstock > 0'; if ($salert == 'on') // Option to see when stock is lower than alert { - $sql .= ' AND SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").') < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'; + $sql .= ' AND SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").') < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'; $alertchecked = 'checked="checked"'; } $sql.= $db->order($sortfield,$sortorder); @@ -412,10 +412,8 @@ ' '. ' '. ''. - ''. - ''. + ''. + ''. ''. ''; @@ -611,4 +609,4 @@ function toggle(source) llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index a81a21c6c9b4a..974f7f5ef00ab 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -142,7 +142,7 @@ print ''; print ''; print ' '; - print ''; + print ''; print "\n"; while ($i < $num) diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php index 8795cf98486dc..8c626175d3dd5 100644 --- a/htdocs/projet/tasks/index.php +++ b/htdocs/projet/tasks/index.php @@ -116,7 +116,7 @@ print ''; print ' '; print ''; -print ''; +print ''; print "\n"; // Show all lines in taskarray (recursive function to go down on tree) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 03036f36a047c..d7c8616a2733b 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -269,8 +269,8 @@ print ''; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; print ''; diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index bf21bfecfa7ae..7d3e2e1a78d43 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -389,9 +389,9 @@ print ''; // Status print ''; - print ''; + print ''; print '  '; - print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/theme/eldy/thumb.png b/htdocs/theme/eldy/thumb.png index 208299ad19764..e17e091214736 100644 Binary files a/htdocs/theme/eldy/thumb.png and b/htdocs/theme/eldy/thumb.png differ diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 62ead1935eb35..baa704509cc76 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -126,7 +126,7 @@ print ''; print ''; - print ''; + print ''; print ''; print "\n";