Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.6' into 3.6_backported
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 20, 2014
2 parents 2f16fca + 321fd47 commit 49e167e
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 13 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,8 @@
English Dolibarr ChangeLog
--------------------------------------------------------------

***** ChangeLog for 3.5.7 compared to 3.5.6 *****
Fix: Paypal link were broken dur to SSL v3 closed.

***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
Expand All @@ -16,6 +18,7 @@ English Dolibarr ChangeLog
- Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state
- Fix: Show sender Country on PDF docs when sender Country <> receiver Country
- Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS
- Fix: [ bug #1749 ] Undefined $mailchimp

***** ChangeLog for 3.6.1 compared to 3.6.* *****
For users:
Expand Down
117 changes: 112 additions & 5 deletions dev/codesniffer/ruleset.xml
Expand Up @@ -6,17 +6,34 @@
<exclude-pattern>*/conf.php</exclude-pattern>
<exclude-pattern>*/includes/*</exclude-pattern>
<exclude-pattern>*/documents/*</exclude-pattern>
<exclude-pattern>*/dev/vagrant/*</exclude-pattern>
<exclude-pattern>*/custom/*</exclude-pattern>
<exclude-pattern>*/nltechno*</exclude-pattern>
<!-- List of all tests -->

<!-- List of all tests -->

<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>

<rule ref="Generic.CodeAnalysis.EmptyStatement" />


<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCATCH">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedFOREACH">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIF">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSE">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSEIF">
<severity>0</severity>
</rule>

<rule ref="Generic.CodeAnalysis.EmptyStatement.NotAllowed">
<severity>0</severity>
</rule>
Expand Down Expand Up @@ -105,7 +122,7 @@
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="80" />
<property name="absoluteComplexity" value="200" />
<property name="absoluteComplexity" value="250" />
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel">
Expand Down Expand Up @@ -162,7 +179,75 @@
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
<severity>0</severity>
</rule>

<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>

<!--
<rule ref="PEAR.Commenting.FileComment" />
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
Expand Down Expand Up @@ -219,6 +304,24 @@
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity>
</rule>

<rule ref="PEAR.Functions.ValidDefaultValue" />

Expand All @@ -236,6 +339,10 @@
</rule>

<rule ref="PEAR.NamingConventions.ValidFunctionName" />

<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid">
<severity>0</severity>
</rule>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/boxes/box_activity.php
Expand Up @@ -114,7 +114,7 @@ function loadBox($max=5)
$billurl="viewstatut=2&paye=1&year=".$objp->annee;

$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/liste.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills"
'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills"
);

$this->info_box_contents[$i][3] = array('td' => 'align="right"',
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -2221,10 +2221,10 @@ function insertExtraFields()
$this->array_options[$key] = price2num($this->array_options[$key]);
break;
case 'date':
$this->array_options[$key]=$this->db->idate($this->array_options[$key]);
if (is_numeric($this->array_options[$key])) $this->array_options[$key]=$this->db->idate($this->array_options[$key]);
break;
case 'datetime':
$this->array_options[$key]=$this->db->idate($this->array_options[$key]);
if (is_numeric($this->array_options[$key])) $this->array_options[$key]=$this->db->idate($this->array_options[$key]);
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions htdocs/core/class/hookmanager.class.php
Expand Up @@ -131,6 +131,7 @@ function executeHooks($method, $parameters=false, &$object='', &$action='')
// Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated.
$hooktype='output';
if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win.
if ($method =='insertExtraFields') $hooktype='returnvalue';
if (in_array(
$method,
array(
Expand Down
1 change: 1 addition & 0 deletions htdocs/core/class/html.formother.class.php
Expand Up @@ -1033,6 +1033,7 @@ function updateBoxOrder(closing) {
if ($nbboxactivated)
{
$langs->load("boxes");
$langs->load("projects");

$emptybox=new ModeleBoxes($db);

Expand Down
1 change: 0 additions & 1 deletion htdocs/core/db/mysqli.class.php
Expand Up @@ -351,7 +351,6 @@ function num_rows($resultset)
* @return int Nombre de lignes
* @see num_rows
*/

function affected_rows($resultset)
{
// If resultset not provided, we take the last used by connexion
Expand Down
25 changes: 25 additions & 0 deletions htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
Expand Up @@ -253,7 +253,32 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).'</strong>';
$desc=dol_htmlentitiesbr($objectligne->desc,1);

$pdf->startTransaction();
$pdf->writeHTMLCell(0, 0, $curX, $curY + 1, dol_concatdesc($txt,$desc), 0, 1, 0);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
$pdf->rollbackTransaction(true);
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
$pdf->writeHTMLCell(0, 0, $curX, $curY, $txt.'<br>'.$desc, LR, 1, 0);
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
{
$pdf->AddPage('','',true);
$pdf->setPage($pageposafter+1);
}
}
}
else // No pagebreak
{
$pdf->commitTransaction();
}

$nexY = $pdf->GetY();
$pageposafter=$pdf->getPage();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/langs/fr_FR/compta.lang
Expand Up @@ -199,7 +199,7 @@ AccountancyJournal=Code journal comptabilité
COMPTA_PRODUCT_BUY_ACCOUNT=Code comptable par défaut pour l'achat de produits
COMPTA_PRODUCT_SOLD_ACCOUNT=Code comptable par défaut pour la vente de produits
COMPTA_SERVICE_BUY_ACCOUNT=Code comptable par défaut pour l'achat de services
COMPTA_SERVICE_SOLD_ACCOUNT=Code comptable par défaut pour la vente de produits
COMPTA_SERVICE_SOLD_ACCOUNT=Code comptable par défaut pour la vente de services
COMPTA_VAT_ACCOUNT=Code comptable par défaut pour l'encaissement de TVA
COMPTA_VAT_BUY_ACCOUNT=Code comptable par défaut pour le versement de la TVA
COMPTA_ACCOUNT_CUSTOMER=Code comptable par défaut des tiers clients
Expand Down
1 change: 1 addition & 0 deletions htdocs/margin/agentMargins.php
Expand Up @@ -119,6 +119,7 @@
$sql.= ", ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND sc.fk_soc = f.fk_soc";
$sql.= " AND (d.product_type = 0 OR d.product_type = 1)";
if (! empty($conf->global->AGENT_CONTACT_TYPE))
$sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))";
else
Expand Down
1 change: 1 addition & 0 deletions htdocs/margin/customerMargins.php
Expand Up @@ -173,6 +173,7 @@
$sql.= " AND f.fk_statut > 0";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND d.fk_facture = f.rowid";
$sql.= " AND (d.product_type = 0 OR d.product_type = 1)";
if ($client)
$sql.= " AND f.fk_soc = ".$socid;
if (!empty($startdate))
Expand Down
3 changes: 2 additions & 1 deletion htdocs/projet/class/task.class.php
Expand Up @@ -1022,7 +1022,8 @@ function createFromClone($fromid,$project_id,$parent_task_id,$clone_change_dt=fa

$error=0;

$now=dol_now();
//Use 00:00 of today if time is use on task.
$now=dol_mktime(0,0,0,dol_print_date(dol_now(),'%m'),dol_print_date(dol_now(),'%d'),dol_print_date(dol_now(),'%Y'));

$datec = $now;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/projet/element.php
Expand Up @@ -212,7 +212,7 @@
$elementselectid = GETPOST("elementselect");
$result=$project->update_element($tablename, $elementselectid);
if ($result<0) {
setEventMessage($mailchimp->error,'errors');
setEventMessage($project->error,'errors');
}
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/odt2pdf/odt2pdf.sh
Expand Up @@ -22,7 +22,7 @@ if [ -f "$1.odt" ]
nbprocess=$(pgrep -c soffice)
if [ $nbprocess -ne 1 ]
then
soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless&
soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless &
retcode=$?
if [ $retcode -ne 0 ]
then
Expand Down

0 comments on commit 49e167e

Please sign in to comment.