From 7a8f244ae986f190b178448712d7acd91ef32fac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Jul 2014 16:03:55 +0200 Subject: [PATCH 1/5] Fix: Translation --- htdocs/langs/fa_IR/main.lang | 30 +++++++++++++++--------------- test/phpunit/LangTest.php | 10 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/langs/fa_IR/main.lang b/htdocs/langs/fa_IR/main.lang index df308499c01..73252f2f85a 100644 --- a/htdocs/langs/fa_IR/main.lang +++ b/htdocs/langs/fa_IR/main.lang @@ -7,21 +7,21 @@ DIRECTION=لیتر FONTFORPDF=DejaVuSans FONTSIZEFORPDF=10 SeparatorDecimal=. -SeparatorThousand=، -FormatDateShort=٪ M /٪ د /٪ Y -FormatDateShortInput=٪ M /٪ د /٪ Y -FormatDateShortJava=MM / DD / YYYY -FormatDateShortJavaInput=MM / DD / YYYY -FormatDateShortJQuery=ماه / روز / سا -FormatDateShortJQueryInput=ماه / روز / سا -FormatHourShort=٪ I:٪ M٪ P -FormatHourShortDuration=٪ H:٪ M -FormatDateTextShort=٪ B٪ د،٪ Y -FormatDateText=٪ B٪ د،٪ Y -FormatDateHourShort=٪ M /٪ د /٪ Y٪ I:٪ M٪ P -FormatDateHourSecShort=٪ M /٪ د /٪ Y٪ I:٪ M:٪ S٪ P -FormatDateHourTextShort=٪ B٪ د،٪ Y،٪ I:٪ M٪ P -FormatDateHourText=٪ B٪ د،٪ Y،٪ I:٪ M٪ P +SeparatorThousand=None +FormatDateShort=%m/%d/%Y +FormatDateShortInput=%m/%d/%Y +FormatDateShortJava=MM/dd/yyyy +FormatDateShortJavaInput=MM/dd/yyyy +FormatDateShortJQuery=yy/dd/mm +FormatDateShortJQueryInput=yy/dd/mm +FormatHourShort=%I:%M +FormatHourShortDuration=%H:%M +FormatDateTextShort=%b %d %Y +FormatDateText=%B %d %Y +FormatDateHourShort=%m/%d/%Y %I:%M:%S %p +FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p +FormatDateHourTextShort=%b %d %Y %I:%M %p +FormatDateHourText=%B %d %Y %H:%M %p DatabaseConnection=اتصال به پایگاه داده NoTranslation=بدون ترجمه NoRecordFound=هیچ سابقه ای پیدا نشد diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 7d173481501..c0788feef8a 100755 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -146,7 +146,7 @@ class LangTest extends PHPUnit_Framework_TestCase { if (! preg_match('/^[a-z]+_[A-Z]+$/',$code)) continue; - print 'Check language file for code='.$code."\n"; + print 'Check language file for lang code='.$code."\n"; $tmplangs=new Translate('',$conf); $langcode=$code; $tmplangs->setDefaultLang($langcode); @@ -154,19 +154,19 @@ class LangTest extends PHPUnit_Framework_TestCase $result=$tmplangs->trans("SeparatorDecimal"); print __METHOD__." SeparatorDecimal=".$result."\n"; - $this->assertContains($result,array('.',',','/',' ','','None'), 'Error for code '.$code); + $this->assertContains($result,array('.',',','/',' ','','None'), 'Error for decimal separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported $result=$tmplangs->trans("SeparatorThousand"); print __METHOD__." SeparatorThousand=".$result."\n"; - $this->assertContains($result, array('.',',','/',' ','','None','Space'), 'Error for code '.$code); + $this->assertContains($result, array('.',',','/',' ','','None','Space'), 'Error for thousand separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported // Test java string contains only d,M,y,/,-,. and not m,... $result=$tmplangs->trans("FormatDateShortJava"); print __METHOD__." FormatDateShortJava=".$result."\n"; - $this->assertRegExp('/^[dMy\/\-\.]+$/',$result); + $this->assertRegExp('/^[dMy\/\-\.]+$/',$result,'FormatDateShortJava'); $result=$tmplangs->trans("FormatDateShortJavaInput"); print __METHOD__." FormatDateShortJavaInput=".$result."\n"; - $this->assertRegExp('/^[dMy\/\-\.]+$/',$result); + $this->assertRegExp('/^[dMy\/\-\.]+$/',$result,'FormatDateShortJavaInput'); unset($tmplangs); } From 109ccf9b74d8e334afdcb9a98a7f658fbe5bc301 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Jul 2014 22:40:53 +0200 Subject: [PATCH 2/5] Fix: SQL syntax error with pgsql Conflicts: htdocs/contrat/class/contrat.class.php --- htdocs/contrat/class/contrat.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index d384eea9b91..09900e14d49 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -448,14 +448,14 @@ class Contrat extends CommonObject $this->extraparams = (array) json_decode($result["extraparams"], true); $this->db->free($resql); - + // Retreive all extrafield for thirdparty // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $this->fetch_optionals($this->id,$extralabels); - + return $this->id; } @@ -728,7 +728,7 @@ class Contrat extends CommonObject $sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,"; $sql.= " ref, entity, note_private, note_public)"; $sql.= " VALUES ('".$this->db->idate($now)."',".$this->socid.",".$user->id; - $sql.= ",".$this->db->idate($this->date_contrat); + $sql.= ", '".$this->db->idate($this->date_contrat)."'"; $sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL"); $sql.= ",".($this->commercial_suivi_id>0?$this->commercial_suivi_id:"NULL"); $sql.= ",".($this->fk_project>0?$this->fk_project:"NULL"); @@ -761,8 +761,8 @@ class Contrat extends CommonObject // Insert contacts commerciaux ('SALESREPFOLL','contrat') $result=$this->add_contact($this->commercial_suivi_id,'SALESREPFOLL','internal'); if ($result < 0) $error++; - - + + if (! $error) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used From a9779ca1ffc7243e330d5872d925cb1ad493e6ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 02:18:21 +0200 Subject: [PATCH 3/5] Fix: bad colspan for line with date selector --- htdocs/core/tpl/objectline_create.tpl.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 170cc1e0fc7..68613492df8 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -244,7 +244,7 @@ else { table_element_line=='commandedet') { $newline = new OrderLine($this->db); @@ -259,7 +259,7 @@ else { print $newline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8)); } } - ?> + ?> service->enabled) && $dateSelector) { if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; else $colspan = 9; + if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc + if (in_array($object->element,array('propal','facture','invoice','commande','order'))) $colspan++; // With this, there is a column move button if (! empty($usemargins)) { From 8137fd7fe427bf42ab461842e826efc678432996 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 02:36:03 +0200 Subject: [PATCH 4/5] Fix: Type of line (product/service) could not be edited on supplier order/invoice. --- htdocs/core/class/html.form.class.php | 6 +++--- htdocs/fourn/commande/fiche.php | 12 +++++++----- htdocs/fourn/facture/fiche.php | 8 ++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1f5d14b7529..09730a93545 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -544,7 +544,7 @@ class Form * @param string $htmlname Name of field in html form * @param int $showempty Add an empty field * @param int $hidetext Do not show label before combo box - * @param string $forceall Force to show products and services in combo list, whatever are activated modules + * @param string $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service') * @return void */ function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0) @@ -552,8 +552,8 @@ class Form global $db,$langs,$user,$conf; // If product & services are enabled or both disabled. - if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) - || (empty($conf->product->enabled) && empty($conf->service->enabled))) + if ($forceall > 0 || (empty($forceall) && ! empty($conf->product->enabled) && ! empty($conf->service->enabled)) + || (empty($forceall) && empty($conf->product->enabled) && empty($conf->service->enabled)) ) { if (empty($hidetext)) print $langs->trans("Type").': '; print ''; - if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $object->lines[$i]->fk_product) + if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $object->lines[$i]->fk_product > 0) { print ''; $product_static=new ProductFournisseur($db); @@ -1964,9 +1964,9 @@ else print '
'; } else - { + { $forceall=1; // For suppliers, we always show all types - print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1); + print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1,0,$forceall); if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) print '
'; } From 5cbb39594f617aeb1d6712132f514c411c7f002c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 05:03:40 +0200 Subject: [PATCH 5/5] Fix: I hate duplicated documentation. --- README-FR.md | 4 ++-- README.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README-FR.md b/README-FR.md index 4fda8c4c3e6..aa8c3c1f5da 100644 --- a/README-FR.md +++ b/README-FR.md @@ -115,8 +115,8 @@ Divers: - Application simple à utiliser. - Plusieurs thèmes visuels. - Code simple et facilement personnalisable. -- Fonctionne avec PHP 5.3+, MySQL 4.1+ ou PostgreSql 8.1.4+. -- Compatible avec toutes les offres Cloud du marché respectant les prérequis MySQL et PHP. +- Requiert PHP et Mysql ou Postgresql (Voir versions exactes sur http://wiki.dolibarr.org/index.php/Prérequis). +- Compatible avec toutes les offres Cloud du marché respectant les prérequis MySQL et PHP ou Postgresql. ## CE QUE DOLIBARR NE PEUT PAS FAIRE (TACHES A FAIRE) diff --git a/README.md b/README.md index bf95452487b..93b9d275beb 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ See ChangeLog file found into package. - Very user friendly and easy to use. - Highly customizable: Enable only modules you need, user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one). - Works with PHP 5.3+, MySql 4.1 or PostgreSQL 8.1. +- Require PHP and Mysql or Postgresql (See exatc versions on http://wiki.dolibarr.org/index.php/Prerequisite). - Compatible with all Cloud solutions that match MySql, PHP or PostgreSQL prerequisites. - An easy to understand, maintain and code interfaces with your own system information (PHP with no heavy frameworks, trigger and hook architecture). - Support countries specific features: