Skip to content

Commit

Permalink
Merge branch '3.3' of https://github.com/Dolibarr/dolibarr.git into 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
FHenry committed Apr 20, 2013
2 parents a3c5bef + fa69f69 commit 880659a
Show file tree
Hide file tree
Showing 24 changed files with 311 additions and 186 deletions.
5 changes: 3 additions & 2 deletions ChangeLog
Expand Up @@ -6,7 +6,7 @@ English Dolibarr ChangeLog

***** ChangeLog for 3.3.2 compared to 3.3.1 *****

- Fix: Ducth (nl_NL) translation
- Fix: Dutch (nl_NL) translation
- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
- Generalize fix: file with a specific mask not found, again
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
Expand All @@ -19,11 +19,12 @@ English Dolibarr ChangeLog
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #789 ] VAT not being calculated in POS
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #810 ] Cannot update ODT template path
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)


***** ChangeLog for 3.3.1 compared to 3.3 *****
Expand Down
29 changes: 20 additions & 9 deletions htdocs/admin/dict.php
Expand Up @@ -383,7 +383,7 @@

// Define localtax_typeList (used for dictionnary "c_tva")
$localtax_typeList = array();
if (GETPOST("id") == 10)
if ($id == 10)
{
$localtax_typeList = array(
"0" => $langs->trans("No"),
Expand Down Expand Up @@ -433,22 +433,32 @@
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';

$msg.=$langs->trans("ErrorFieldRequired",$langs->transnoentities($fieldnamekey)).'<br>';
$msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'<br>';
}
}
// Other checks
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
$ok=0;
$msg.="Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record.<br>";
$msg.= $langs->transnoentities('ErrorReservedTypeSystemSystemAuto').'<br>';
}
if (isset($_POST["code"]) && $_POST["code"]=='0') {
$ok=0;
$msg.="Code can't contains value 0<br>";
if (isset($_POST["code"]))
{
if ($_POST["code"]=='0')
{
$ok=0;
$msg.= $langs->transnoentities('ErrorCodeCantContainZero').'<br>';
}
if (!is_numeric($_POST['code']))
{
$ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
}
}
if (isset($_POST["pays"]) && $_POST["pays"]=='0') {
$ok=0;
$msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'<br>';
$msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'<br>';
}

// Clean some parameters
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
Expand Down Expand Up @@ -510,7 +520,7 @@
else
{
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$msg=$langs->trans("ErrorRecordAlreadyExists").'<br>';
$msg=$langs->transnoentities("ErrorRecordAlreadyExists").'<br>';
}
else {
dol_print_error($db);
Expand Down Expand Up @@ -580,7 +590,7 @@
{
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
{
$msg='<div class="error">'.$langs->trans("ErrorRecordIsUsedByChild").'</div>';
$msg='<div class="error">'.$langs->transnoentities("ErrorRecordIsUsedByChild").'</div>';
}
else
{
Expand Down Expand Up @@ -978,6 +988,7 @@
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
}
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
$langs->load('agenda');
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
}
Expand Down
1 change: 1 addition & 0 deletions htdocs/admin/menus/edit.php
Expand Up @@ -29,6 +29,7 @@


$langs->load("admin");
$langs->load('other');

if (! $user->admin) accessforbidden();

Expand Down
4 changes: 2 additions & 2 deletions htdocs/comm/propal/list.php
Expand Up @@ -3,7 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
Expand Down Expand Up @@ -167,7 +167,7 @@
}
if ($search_montant_ht)
{
$sql.= " AND p.total_ht='".$db->escape(trim($search_montant_ht))."'";
$sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'";
}
if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%' OR pd.description LIKE '%".$db->escape($sall)."%')";
if ($socid) $sql.= ' AND s.rowid = '.$socid;
Expand Down
6 changes: 3 additions & 3 deletions htdocs/compta/facture/list.php
Expand Up @@ -3,7 +3,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
Expand Down Expand Up @@ -184,11 +184,11 @@
}
if ($search_montant_ht)
{
$sql.= ' AND f.total = \''.$db->escape(trim($search_montant_ht)).'\'';
$sql.= ' AND f.total = \''.$db->escape(price2num(trim($search_montant_ht))).'\'';
}
if ($search_montant_ttc)
{
$sql.= ' AND f.total_ttc = \''.$db->escape(trim($search_montant_ttc)).'\'';
$sql.= ' AND f.total_ttc = \''.$db->escape(price2num(trim($search_montant_ttc))).'\'';
}
if ($month > 0)
{
Expand Down
8 changes: 3 additions & 5 deletions htdocs/core/class/hookmanager.class.php
Expand Up @@ -138,8 +138,6 @@ function executeHooks($method, $parameters=false, &$object='', &$action='')
{
foreach($modules as $module => $actionclassinstance)
{
//var_dump(get_class($actionclassinstance).'->'.$method);

// jump to next class if method does not exists
if (! method_exists($actionclassinstance,$method)) continue;
// test to avoid to run twice a hook, when a module implements several active contexts
Expand All @@ -164,13 +162,13 @@ function executeHooks($method, $parameters=false, &$object='', &$action='')
}
// Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...)
else
{
{
// TODO. this should be done into the method by returning nothing
if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue;

$result = $actionclassinstance->$method($parameters, $object, $action, $this);

if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;

// TODO. remove this. array result must be set into $actionclassinstance->results
Expand All @@ -179,7 +177,7 @@ function executeHooks($method, $parameters=false, &$object='', &$action='')
if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result;
}

//print "method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction;
//print "method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction;
}
}
}
Expand Down

0 comments on commit 880659a

Please sign in to comment.