Skip to content

Commit

Permalink
Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed May 21, 2014
2 parents 366bd64 + 5641540 commit b146dca
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 40 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -26,6 +26,7 @@ Fix: [ bug #1381 ] PHP Warning when listing stock transactions page.
Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error.
Fix: TCPDF error file not found in member card generation.
Fix: [ bug #1380 ] Customer invoices are not grouped in company results report.
Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice.

***** ChangeLog for 3.5.2 compared to 3.5.1 *****
Fix: Can't add user for a task.
Expand Down
41 changes: 20 additions & 21 deletions htdocs/admin/boxes.php
Expand Up @@ -57,7 +57,7 @@

$db->begin();

// Initialize distinctfkuser with all already existing values of fk_user (user that use a personalized view of boxes for pos)
// Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos")
$distinctfkuser=array();
if (! $error)
{
Expand Down Expand Up @@ -85,14 +85,31 @@
}
}

$distinctfkuser['0']='0'; // Add entry for fk_user = 0. We must use string as key and val

foreach($distinctfkuser as $fk_user)
{
if (! $error && $fk_user != 0) // We will add fk_user = 0 later.
if (! $error && $fk_user != '')
{
$nbboxonleft=$nbboxonright=0;
$sql = "SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE position = ".GETPOST("pos","alpha")." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
dol_syslog("boxes.php activate box sql=".$sql);
$resql = $db->query($sql);
if ($resql)
{
while($obj = $db->fetch_object($resql))
{
$boxorder=$obj->box_order;
if (preg_match('/A/',$boxorder)) $nbboxonleft++;
if (preg_match('/B/',$boxorder)) $nbboxonright++;
}
}
else dol_print_error($db);

$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
$sql.= "box_id, position, box_order, fk_user, entity";
$sql.= ") values (";
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', ".$fk_user.", ".$conf->entity;
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
$sql.= ")";

dol_syslog("boxes.php activate box sql=".$sql);
Expand All @@ -105,24 +122,6 @@
}
}

// If value 0 was not included, we add it.
if (! $error)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
$sql.= "box_id, position, box_order, fk_user, entity";
$sql.= ") values (";
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', 0, ".$conf->entity;
$sql.= ")";

dol_syslog("boxes.php activate box sql=".$sql);
$resql = $db->query($sql);
if (! $resql)
{
$errmesg=$db->lasterror();
$error++;
}
}

if (! $error)
{
header("Location: boxes.php");
Expand Down
6 changes: 4 additions & 2 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -2516,7 +2516,7 @@ function load_board($user)
$this->nbtodo=$this->nbtodolate=0;
$clause = " WHERE";

$sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut";
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
Expand All @@ -2535,7 +2535,9 @@ function load_board($user)
while ($obj=$this->db->fetch_object($resql))
{
$this->nbtodo++;
if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;

$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
}
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/expedition/class/expedition.class.php
Expand Up @@ -203,8 +203,8 @@ function create($user)
$sql.= ") VALUES (";
$sql.= "'(PROV)'";
$sql.= ", ".$conf->entity;
$sql.= ", ".($this->ref_customer?"'".$this->ref_customer."'":"null");
$sql.= ", ".($this->ref_int?"'".$this->ref_int."'":"null");
$sql.= ", ".($this->ref_customer?"'".$this->db->escape($this->ref_customer)."'":"null");
$sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null");
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", ".$user->id;
$sql.= ", ".($this->date_expedition>0?"'".$this->db->idate($this->date_expedition)."'":"null");
Expand Down
1 change: 1 addition & 0 deletions htdocs/fourn/facture/fiche.php
Expand Up @@ -461,6 +461,7 @@
$db->commit();

if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
Expand Down
2 changes: 1 addition & 1 deletion test/phpunit/CategorieTest.php
Expand Up @@ -336,4 +336,4 @@ public function testCategorieStatic()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/CompanyBankAccountTest.php
Expand Up @@ -233,4 +233,4 @@ public function testCompanyBankAccountOther($localobject)
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/CoreTest.php
Expand Up @@ -297,4 +297,4 @@ function test_sql_and_script_inject($val, $type)
$this->assertEquals($result,$expectedresult);
}
}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/DateLibTzFranceTest.php
Expand Up @@ -199,4 +199,4 @@ public function testDolPrintDateTzFrance()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/ExportTest.php
Expand Up @@ -265,4 +265,4 @@ public function testExportModulesDatasets()
return true;
}
}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/FactureTest.php
Expand Up @@ -329,4 +329,4 @@ public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('
return $retAr;
}
}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/FactureTestRounding.php
Expand Up @@ -333,4 +333,4 @@ public function testFactureAddLine3()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/ImportTest.php
Expand Up @@ -134,4 +134,4 @@ public function testImportSample1()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/JsonLibTest.php
Expand Up @@ -170,4 +170,4 @@ public function testJsonEncode()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/ModulesTest.php
Expand Up @@ -146,4 +146,4 @@ public function testModulesInit()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/PropalTest.php
Expand Up @@ -287,4 +287,4 @@ public function testVerifyNumRef()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/WebservicesInvoicesTest.php
Expand Up @@ -176,4 +176,4 @@ public function testWSInvoicesXxx()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/WebservicesOrdersTest.php
Expand Up @@ -175,4 +175,4 @@ public function testWSOrderXxx()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/WebservicesOtherTest.php
Expand Up @@ -176,4 +176,4 @@ public function testWSOtherGetVersions()
}

}
?>
?>
2 changes: 1 addition & 1 deletion test/phpunit/WebservicesThirdpartyTest.php
Expand Up @@ -176,4 +176,4 @@ public function testWSThirdpartyXxx()
}

}
?>
?>

0 comments on commit b146dca

Please sign in to comment.