Skip to content

Commit

Permalink
Merge remote-tracking branch 'uptream/develop' into 7.0-SPEC1
Browse files Browse the repository at this point in the history
  • Loading branch information
aspangaro committed Oct 31, 2017
2 parents e7832e3 + b29f321 commit a0d186b
Show file tree
Hide file tree
Showing 66 changed files with 428 additions and 197 deletions.
27 changes: 27 additions & 0 deletions ChangeLog
Expand Up @@ -28,6 +28,33 @@ Following changes may create regressions for some external modules, but were nec
* Remove js library fileupload that was not used by core code.


***** ChangeLog for 6.0.3 compared to 6.0.2 *****
FIX: #7211 Update qty dispatched on qty change
FIX: #7458
FIX: #7593
FIX: #7616
FIX: #7619
FIX: #7626
FIX: #7648
FIX: #7675
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
FIX: API to get object does not return data of linked objects
FIX: Bad localtax apply
FIX: Bad ressource list in popup in gantt view
FIX: bankentries search conciliated if val 0
FIX: hook formObjectOptions() must use $expe and not $object which i…
FIX: hook formObjectOptions() must use $expe and not $object which is an order here
FIX: make of link to other object during creation
FIX: Missing function getLinesArray
FIX: old batch not shown in multi shipping
FIX: paid supplier invoices are shown as abandoned
FIX: selection of thirdparty was lost on stats page of invoices
FIX: sql syntax error because of old field accountancy_journal
FIX: Stats on invoices show nothing
FIX: substitution in ODT of thirdparties documents
FIX: wrong key in selectarray
FIX: wrong personnal project time spent

***** ChangeLog for 6.0.2 compared to 6.0.1 *****
FIX: #7148
FIX: #7288
Expand Down
51 changes: 33 additions & 18 deletions dev/initdata/purge-data.php
Expand Up @@ -78,15 +78,17 @@
'DELETE FROM '.MAIN_DB_PREFIX.'propaldet',
'DELETE FROM '.MAIN_DB_PREFIX.'propal',
),
'supplier_order'=>array(
'supplier_proposal'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposaldet',
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposal',
),
'supplier_order'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet',
'DELETE FROM '.MAIN_DB_PREFIX.'commande_fournisseur',
),
'supplier_invoice'=>array(
'supplier_invoice'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det',
'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn',
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposaldet',
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposal',
),
'delivery'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'livraisondet',
Expand Down Expand Up @@ -114,8 +116,10 @@
'DELETE FROM '.MAIN_DB_PREFIX.'product_lang',
'DELETE FROM '.MAIN_DB_PREFIX.'product_price',
'DELETE FROM '.MAIN_DB_PREFIX.'product_fournisseur_price',
'DELETE FROM '.MAIN_DB_PREFIX.'product_stock',
'DELETE FROM '.MAIN_DB_PREFIX.'product',
'DELETE FROM '.MAIN_DB_PREFIX.'product_batch',
'DELETE FROM '.MAIN_DB_PREFIX.'product_stock',
'DELETE FROM '.MAIN_DB_PREFIX.'product_lot',
'DELETE FROM '.MAIN_DB_PREFIX.'product',
),
'project'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'projet_task_time',
Expand All @@ -128,12 +132,13 @@
),
'thirdparty'=>array(
'@contact',
'DELETE FROM '.MAIN_DB_PREFIX.'cabinetmed_cons',
'DELETE FROM '.MAIN_DB_PREFIX.'cabinetmed_cons',
'UPDATE '.MAIN_DB_PREFIX.'adherent SET fk_soc = NULL',
'DELETE FROM '.MAIN_DB_PREFIX.'categorie_fournisseur',
'DELETE FROM '.MAIN_DB_PREFIX.'categorie_societe',
'DELETE FROM '.MAIN_DB_PREFIX.'societe_remise_except',
'DELETE FROM '.MAIN_DB_PREFIX.'societe',
'DELETE FROM '.MAIN_DB_PREFIX.'societe_rib',
'DELETE FROM '.MAIN_DB_PREFIX.'societe',
)
);

Expand All @@ -152,27 +157,37 @@
$option = $argv[2];

if (empty($mode) || ! in_array($mode,array('test','confirm'))) {
print "Usage: $script_file (test|confirm) (all|option)\n";
print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option can be ".implode(',',array_keys($sqls))."\n";
exit(-1);
}

if (empty($option) || ! in_array($option, array_merge(array('all'),array_keys($sqls))) ) {
print "Usage: $script_file (test|confirm) (all|option)\n";
print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option can be ".implode(',',array_keys($sqls))."\n";
exit(-1);
}

// Replace database handler
if (! empty($argv[3]))
{
$db->close();
unset($db);
$db=getDoliDBInstance($argv[3], $argv[4], $argv[5], $argv[6], $argv[7], $argv[8]);
$user=new User($db);
}

//var_dump($user->db->database_name);
$ret=$user->fetch('','admin');
if (! $ret > 0)
{
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
print 'An admin user with login "admin" must exists to use this script.'."\n";
exit;
}
$user->getrights();
//$user->getrights();


print "Purge all data for this database:\n";
print "Server = ".$db->database_host."\n";
Expand All @@ -190,14 +205,14 @@

/**
* Process sql requests of a family
*
*
* @param string $family Name of family key of array $sqls
* @return int -1 if KO, 1 if OK
*/
function processfamily($family)
{
global $db, $sqls;

$error=0;
foreach($sqls[$family] as $sql)
{
Expand All @@ -207,7 +222,7 @@ function processfamily($family)
processfamily($newfamily);
continue;
}

print "Run sql: ".$sql."\n";
$resql=$db->query($sql);
if (! $resql)
Expand All @@ -217,15 +232,15 @@ function processfamily($family)
$error++;
}
}

if ($error)
{
print $db->lasterror();
$error++;
break;
}
}

if ($error) return -1;
else return 1;
}
Expand All @@ -242,7 +257,7 @@ function processfamily($family)
$oldfamily = $family;

$result=processfamily($family);
if ($result < 0)
if ($result < 0)
{
$error++;
break;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/list.php
Expand Up @@ -130,7 +130,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/mails_senderprofile_list.php
Expand Up @@ -116,7 +116,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/translation.php
Expand Up @@ -437,8 +437,8 @@
// Now search into translation array
foreach($newlang->tab_translate as $key => $val)
{
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/', $key)) continue;
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/', $val)) continue;
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/i', $key)) continue;
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/i', $val)) continue;
$recordtoshow[$key]=$val;
}
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/api/index.php
Expand Up @@ -139,14 +139,14 @@
{
$module = strtolower($regmod[1]);
$moduledirforclass = getModuleDirForApiClass($module);
$moduleforperm = $module;
if ($module == 'propale') { $moduleforperm='propal'; }
$modulenameforenabled = $module;
if ($module == 'propale') { $moduleforenabled='propal'; }

//dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);

// Defined if module is enabled
$enabled=true;
if (empty($conf->$moduleforperm->enabled)) $enabled=false;
if (empty($conf->$moduleforenabled->enabled)) $enabled=false;

if ($enabled)
{
Expand Down
6 changes: 4 additions & 2 deletions htdocs/comm/action/class/actioncomm.class.php
Expand Up @@ -2,8 +2,8 @@
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -1341,6 +1341,7 @@ function build_exportfile($format,$type,$cachedelay,$filename,$filters)
{
// Note: Output of sql request is encoded in $conf->file->character_set_client
// This assignment in condition is not a bug. It allows walking the results.
$diff = 0;
while ($obj=$this->db->fetch_object($resql))
{
$qualified=true;
Expand Down Expand Up @@ -1377,6 +1378,7 @@ function build_exportfile($format,$type,$cachedelay,$filename,$filters)
{
$eventarray[]=$event;
}
$diff++;
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/propal/list.php
Expand Up @@ -158,7 +158,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/list.php
Expand Up @@ -142,7 +142,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/bank/bankentries_list.php
Expand Up @@ -151,7 +151,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/bank/list.php
Expand Up @@ -103,7 +103,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/invoicetemplate_list.php
Expand Up @@ -138,7 +138,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/list.php
Expand Up @@ -174,7 +174,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/contact/list.php
Expand Up @@ -160,7 +160,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
1 change: 0 additions & 1 deletion htdocs/contrat/card.php
Expand Up @@ -326,7 +326,6 @@
{
$label = $lines[$i]->product_label;
}

$desc = ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):'';
}
else {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/contrat/class/contrat.class.php
Expand Up @@ -2089,10 +2089,10 @@ function load_board($user,$mode)
if ($mode == 'inactives') {
$warning_delay = $conf->contrat->services->inactifs->warning_delay;
$label = $langs->trans("BoardNotActivatedServices");
$url = DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&amp;leftmenu=contracts&amp;mode=0';
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&amp;leftmenu=contracts&amp;mode=0';
} else {
$warning_delay = $conf->contrat->services->expires->warning_delay;
$url = DOL_URL_ROOT.'/contrat/services.php?mainmenu=commercial&amp;leftmenu=contracts&amp;mode=4&amp;filter=expired';
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&amp;leftmenu=contracts&amp;mode=4&amp;filter=expired';
$label = $langs->trans("BoardRunningServices");
}

Expand Down
8 changes: 4 additions & 4 deletions htdocs/contrat/index.php
Expand Up @@ -190,7 +190,7 @@

print '<tr class="oddeven">';
print '<td>'.$staticcontratligne->LibStatut($status,0,($bool?1:0)).'</td>';
print '<td align="right"><a href="services.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>';
print '<td align="right"><a href="services_list.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>';
print "</tr>\n";
}
if ($status==4 && ! $bool) $bool=true;
Expand All @@ -210,7 +210,7 @@
{
print '<tr class="oddeven">';
print '<td>'.$staticcontratligne->LibStatut($status,0,($bool?1:0)).'</td>';
print '<td align="right"><a href="services.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>';
print '<td align="right"><a href="services_list.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>';
if ($status==4 && ! $bool) $bool=true;
else $bool=false;
print "</tr>\n";
Expand Down Expand Up @@ -468,7 +468,7 @@

print '<table class="noborder" width="100%">';

print '<tr class="liste_titre"><th colspan="4">'.$langs->trans("NotActivatedServices").' <a href="'.DOL_URL_ROOT.'/contrat/services.php?mode=0"><span class="badge">'.$num.'</span></a></th>';
print '<tr class="liste_titre"><th colspan="4">'.$langs->trans("NotActivatedServices").' <a href="'.DOL_URL_ROOT.'/contrat/services_list.php?mode=0"><span class="badge">'.$num.'</span></a></th>';
print "</tr>\n";

while ($i < $num)
Expand Down Expand Up @@ -548,7 +548,7 @@

print '<table class="noborder" width="100%">';

print '<tr class="liste_titre"><th colspan="4">'.$langs->trans("ListOfExpiredServices").' <a href="'.DOL_URL_ROOT.'/contrat/services.php?mode=4&amp;filter=expired"><span class="badge">'.$num.'</span></a></th>';
print '<tr class="liste_titre"><th colspan="4">'.$langs->trans("ListOfExpiredServices").' <a href="'.DOL_URL_ROOT.'/contrat/services_list.php?mode=4&amp;filter=expired"><span class="badge">'.$num.'</span></a></th>';
print "</tr>\n";

while ($i < $num)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/contrat/list.php
Expand Up @@ -137,7 +137,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down

0 comments on commit a0d186b

Please sign in to comment.