Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into dev_compta
This commit is contained in:
commit
9b044ec5ec
@ -166,14 +166,13 @@ if ($action == 'writebookkeeping') {
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
foreach ( $tabfac as $key => $val ) {
|
foreach ($tabfac as $key => $val)
|
||||||
|
{
|
||||||
$companystatic = new Societe($db);
|
$companystatic = new Societe($db);
|
||||||
$invoicestatic = new FactureFournisseur($db);
|
$invoicestatic = new FactureFournisseur($db);
|
||||||
|
|
||||||
$invoicestatic->id = $key;
|
$invoicestatic->id = $key;
|
||||||
$invoicestatic->ref = $val["ref"];
|
$invoicestatic->ref = (string) $val["refsologest"];
|
||||||
$invoicestatic->ref = $val["refsologest"];
|
|
||||||
$invoicestatic->refsupplier = $val["refsuppliersologest"];
|
$invoicestatic->refsupplier = $val["refsuppliersologest"];
|
||||||
$invoicestatic->type = $val["type"];
|
$invoicestatic->type = $val["type"];
|
||||||
$invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32));
|
$invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32));
|
||||||
|
|||||||
@ -207,7 +207,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||||
|
|
||||||
$invoicestatic->id = $key;
|
$invoicestatic->id = $key;
|
||||||
$invoicestatic->ref = $val["ref"];
|
$invoicestatic->ref = (string) $val["ref"];
|
||||||
|
|
||||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
|
|||||||
@ -316,7 +316,7 @@ class Adherent extends CommonObject
|
|||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
$this->id=$id;
|
$this->id=$id;
|
||||||
$this->ref=$id;
|
$this->ref=(string) $id;
|
||||||
|
|
||||||
// Update minor fields
|
// Update minor fields
|
||||||
$result=$this->update($user,1,1,0,0,'add'); // nosync is 1 to avoid update data of user
|
$result=$this->update($user,1,1,0,0,'add'); // nosync is 1 to avoid update data of user
|
||||||
@ -1578,6 +1578,7 @@ class Adherent extends CommonObject
|
|||||||
$label.= '<br><b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs);
|
$label.= '<br><b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs);
|
||||||
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||||
|
|
||||||
|
$link=''; $linkend='';
|
||||||
if ($option == 'card')
|
if ($option == 'card')
|
||||||
{
|
{
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.$linkclose;
|
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.$linkclose;
|
||||||
|
|||||||
@ -213,7 +213,7 @@ class Cotisation extends CommonObject
|
|||||||
$result=$member->fetch($this->fk_adherent);
|
$result=$member->fetch($this->fk_adherent);
|
||||||
$result=$member->update_end_date($user);
|
$result=$member->update_end_date($user);
|
||||||
|
|
||||||
if ($accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
|
if (is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
|
||||||
{
|
{
|
||||||
$result=$accountline->delete($user); // Return false if refused because line is conciliated
|
$result=$accountline->delete($user); // Return false if refused because line is conciliated
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
|
|||||||
@ -62,6 +62,23 @@ if ($action == 'update')
|
|||||||
{
|
{
|
||||||
if (! $_POST['cancel'])
|
if (! $_POST['cancel'])
|
||||||
{
|
{
|
||||||
|
$leftmenu=''; $mainmenu='';
|
||||||
|
if (! empty($_POST['menuIdParent']) && ! is_numeric($_POST['menuIdParent']))
|
||||||
|
{
|
||||||
|
$tmp=explode('&',$_POST['menuIdParent']);
|
||||||
|
foreach($tmp as $s)
|
||||||
|
{
|
||||||
|
if (preg_match('/fk_mainmenu=/',$s))
|
||||||
|
{
|
||||||
|
$mainmenu=preg_replace('/fk_mainmenu=/','',$s);
|
||||||
|
}
|
||||||
|
if (preg_match('/fk_leftmenu=/',$s))
|
||||||
|
{
|
||||||
|
$leftmenu=preg_replace('/fk_leftmenu=/','',$s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$menu = new Menubase($db);
|
$menu = new Menubase($db);
|
||||||
$result=$menu->fetch($_POST['menuId']);
|
$result=$menu->fetch($_POST['menuId']);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -75,7 +92,18 @@ if ($action == 'update')
|
|||||||
$menu->perms=$_POST['perms'];
|
$menu->perms=$_POST['perms'];
|
||||||
$menu->target=$_POST['target'];
|
$menu->target=$_POST['target'];
|
||||||
$menu->user=$_POST['user'];
|
$menu->user=$_POST['user'];
|
||||||
$menu->fk_menu=$_POST['fk_menu'];
|
if (is_numeric($_POST['menuIdParent']))
|
||||||
|
{
|
||||||
|
$menu->fk_menu=$_POST['menuIdParent'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($_POST['type'] == 'top') $menu->fk_menu=0;
|
||||||
|
else $menu->fk_menu=-1;
|
||||||
|
$menu->fk_mainmenu=$mainmenu;
|
||||||
|
$menu->fk_leftmenu=$leftmenu;
|
||||||
|
}
|
||||||
|
|
||||||
$result=$menu->update($user);
|
$result=$menu->update($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -342,7 +370,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td><input type="text" size="20" id="menuId" name="menuId" value="'.($_POST["menuId"]?$_POST["menuId"]:'').'"></td>';
|
print '<td><input type="text" size="40" id="menuId" name="menuId" value="'.($_POST["menuId"]?$_POST["menuId"]:'').'"></td>';
|
||||||
}
|
}
|
||||||
print '<td>'.$langs->trans('DetailMenuIdParent');
|
print '<td>'.$langs->trans('DetailMenuIdParent');
|
||||||
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
||||||
@ -425,12 +453,15 @@ elseif ($action == 'edit')
|
|||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Type').'</td><td>'.$langs->trans(ucfirst($menu->type)).'</td><td>'.$langs->trans('DetailType').'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Type').'</td><td>'.$langs->trans(ucfirst($menu->type)).'</td><td>'.$langs->trans('DetailType').'</td></tr>';
|
||||||
|
|
||||||
// MenuId Parent
|
// MenuId Parent
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('MenuIdParent').'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('MenuIdParent');
|
||||||
|
print '</td>';
|
||||||
$valtouse=$menu->fk_menu;
|
$valtouse=$menu->fk_menu;
|
||||||
if ($menu->fk_mainmenu) $valtouse='fk_mainmenu='.$menu->fk_mainmenu;
|
if ($menu->fk_mainmenu) $valtouse='fk_mainmenu='.$menu->fk_mainmenu;
|
||||||
if ($menu->fk_leftmenu) $valtouse.='&fk_leftmenu='.$menu->fk_leftmenu;
|
if ($menu->fk_leftmenu) $valtouse.='&fk_leftmenu='.$menu->fk_leftmenu;
|
||||||
print '<td><input type="text" name="fk_menu" value="'.$valtouse.'" size="10"></td>';
|
print '<td><input type="text" name="menuIdParent" value="'.$valtouse.'" size="40"></td>';
|
||||||
print '<td>'.$langs->trans('DetailMenuIdParent').'</td></tr>';
|
print '<td>'.$langs->trans('DetailMenuIdParent');
|
||||||
|
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Niveau
|
// Niveau
|
||||||
//print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
|
//print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
|
||||||
|
|||||||
@ -361,7 +361,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
|
|
||||||
if (count($remainingdata))
|
if (count($remainingdata))
|
||||||
{
|
{
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("NotTopTreeMenuPersonalized").'</td>';
|
print '<td>'.$langs->trans("NotTopTreeMenuPersonalized").'</td>';
|
||||||
|
|||||||
@ -624,6 +624,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
|
|||||||
{
|
{
|
||||||
global $user,$langs,$form,$bc;
|
global $user,$langs,$form,$bc;
|
||||||
|
|
||||||
|
$title='NotDefined';
|
||||||
if ($typeid == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoriesShort");
|
if ($typeid == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoriesShort");
|
||||||
if ($typeid == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoriesShort");
|
if ($typeid == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoriesShort");
|
||||||
if ($typeid == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersProspectsCategoriesShort");
|
if ($typeid == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersProspectsCategoriesShort");
|
||||||
|
|||||||
@ -208,7 +208,7 @@ class ICal
|
|||||||
|
|
||||||
//print 'type='.$type.' key='.$key.' value='.$value.'<br>'."\n";
|
//print 'type='.$type.' key='.$key.' value='.$value.'<br>'."\n";
|
||||||
|
|
||||||
if ($key == false)
|
if (empty($key))
|
||||||
{
|
{
|
||||||
$key = $this->last_key;
|
$key = $this->last_key;
|
||||||
switch ($type)
|
switch ($type)
|
||||||
|
|||||||
@ -509,7 +509,7 @@ class FactureRec extends CommonInvoice
|
|||||||
|
|
||||||
$facid=$this->id;
|
$facid=$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG);
|
dol_syslog(get_class($this)."::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
@ -631,7 +631,7 @@ class FactureRec extends CommonInvoice
|
|||||||
|
|
||||||
$facid=$this->id;
|
$facid=$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG);
|
dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
|
|||||||
@ -633,7 +633,8 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog(get_class($this)."::fetch_name_optionals_label ".$this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $array_name_label;
|
return $array_name_label;
|
||||||
|
|||||||
@ -4548,9 +4548,9 @@ function dol_textishtml($msg,$option=0)
|
|||||||
if (preg_match('/<html/i',$msg)) return true;
|
if (preg_match('/<html/i',$msg)) return true;
|
||||||
elseif (preg_match('/<body/i',$msg)) return true;
|
elseif (preg_match('/<body/i',$msg)) return true;
|
||||||
elseif (preg_match('/<(b|em|i)>/i',$msg)) return true;
|
elseif (preg_match('/<(b|em|i)>/i',$msg)) return true;
|
||||||
elseif (preg_match('/<(br|div|font|li|span|strong|table)>/i',$msg)) return true;
|
elseif (preg_match('/<(br|div|font|li|p|span|strong|table)>/i',$msg)) return true;
|
||||||
elseif (preg_match('/<(br|div|font|li|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true;
|
elseif (preg_match('/<(br|div|font|li|p|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true;
|
||||||
elseif (preg_match('/<(br|div|font|li|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true;
|
elseif (preg_match('/<(br|div|font|li|p|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true;
|
||||||
elseif (preg_match('/<img\s+[^<>]*src[^<>]*>/i',$msg)) return true; // must accept <img src="http://example.com/aaa.png" />
|
elseif (preg_match('/<img\s+[^<>]*src[^<>]*>/i',$msg)) return true; // must accept <img src="http://example.com/aaa.png" />
|
||||||
elseif (preg_match('/<a\s+[^<>]*href[^<>]*>/i',$msg)) return true; // must accept <a href="http://example.com/aaa.png" />
|
elseif (preg_match('/<a\s+[^<>]*href[^<>]*>/i',$msg)) return true; // must accept <a href="http://example.com/aaa.png" />
|
||||||
elseif (preg_match('/<h[0-9]>/i',$msg)) return true;
|
elseif (preg_match('/<h[0-9]>/i',$msg)) return true;
|
||||||
|
|||||||
@ -1453,14 +1453,24 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// For external modules
|
$url = $shorturl = $menu_array[$i]['url'];
|
||||||
|
|
||||||
|
if (! preg_match("/^(http:\/\/|https:\/\/)/i",$menu_array[$i]['url']))
|
||||||
|
{
|
||||||
$tmp=explode('?',$menu_array[$i]['url'],2);
|
$tmp=explode('?',$menu_array[$i]['url'],2);
|
||||||
$url = $tmp[0];
|
$url = $shorturl = $tmp[0];
|
||||||
$param = (isset($tmp[1])?$tmp[1]:'');
|
$param = (isset($tmp[1])?$tmp[1]:'');
|
||||||
|
|
||||||
|
if (! preg_match('/mainmenu/i',$param) || ! preg_match('/leftmenu/i',$param)) $param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu=';
|
||||||
|
//$url.="idmenu=".$menu_array[$i]['rowid']; // Already done by menuLoad
|
||||||
$url = dol_buildpath($url,1).($param?'?'.$param:'');
|
$url = dol_buildpath($url,1).($param?'?'.$param:'');
|
||||||
|
$shorturl = $shorturl.($param?'?'.$param:'');
|
||||||
|
}
|
||||||
|
|
||||||
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
||||||
|
$shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
|
||||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||||
|
$shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
|
||||||
|
|
||||||
print '<!-- Process menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['level'].' enabled='.$menu_array[$i]['enabled'].', position='.$menu_array[$i]['position'].' -->'."\n";
|
print '<!-- Process menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['level'].' enabled='.$menu_array[$i]['enabled'].', position='.$menu_array[$i]['position'].' -->'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2015 Jean Heimburger <http://tiaris.eu>
|
* Copyright (C) 2015 Jean Heimburger <http://tiaris.eu>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -21,7 +21,6 @@
|
|||||||
* \file scripts/product/migrate_picture_path.php
|
* \file scripts/product/migrate_picture_path.php
|
||||||
* \ingroup scripts
|
* \ingroup scripts
|
||||||
* \brief Migrate pictures from old system prior to 3.7 to new path for 3.7+
|
* \brief Migrate pictures from old system prior to 3.7 to new path for 3.7+
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sapi_type = php_sapi_name();
|
$sapi_type = php_sapi_name();
|
||||||
@ -119,7 +118,7 @@ function migrate_product_photospath($product)
|
|||||||
$handle=opendir($origin_osencoded);
|
$handle=opendir($origin_osencoded);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
while (($file = readdir($handle)) != false)
|
while (($file = readdir($handle)) !== false)
|
||||||
{
|
{
|
||||||
if ($file != '.' && $file != '..' && is_dir($origin_osencoded.'/'.$file))
|
if ($file != '.' && $file != '..' && is_dir($origin_osencoded.'/'.$file))
|
||||||
{
|
{
|
||||||
@ -127,7 +126,7 @@ function migrate_product_photospath($product)
|
|||||||
if (is_resource($thumbs))
|
if (is_resource($thumbs))
|
||||||
{
|
{
|
||||||
dol_mkdir($destin.'/'.$file);
|
dol_mkdir($destin.'/'.$file);
|
||||||
while (($thumb = readdir($thumbs)) != false)
|
while (($thumb = readdir($thumbs)) !== false)
|
||||||
{
|
{
|
||||||
dol_move($origin.'/'.$file.'/'.$thumb, $destin.'/'.$file.'/'.$thumb);
|
dol_move($origin.'/'.$file.'/'.$thumb, $destin.'/'.$file.'/'.$thumb);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user