Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
3e9679f273
@ -334,7 +334,7 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
|
|||||||
}
|
}
|
||||||
foreach my $target (sort keys %CHOOSEDPUBLISH) {
|
foreach my $target (sort keys %CHOOSEDPUBLISH) {
|
||||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||||
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; }
|
||||||
if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
||||||
$nboftargetok++;
|
$nboftargetok++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,6 +163,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/bookmarks
|
%_datadir/dolibarr/htdocs/bookmarks
|
||||||
%_datadir/dolibarr/htdocs/cashdesk
|
%_datadir/dolibarr/htdocs/cashdesk
|
||||||
%_datadir/dolibarr/htdocs/categories
|
%_datadir/dolibarr/htdocs/categories
|
||||||
|
%_datadir/dolibarr/htdocs/collab
|
||||||
%_datadir/dolibarr/htdocs/comm
|
%_datadir/dolibarr/htdocs/comm
|
||||||
%_datadir/dolibarr/htdocs/commande
|
%_datadir/dolibarr/htdocs/commande
|
||||||
%_datadir/dolibarr/htdocs/compta
|
%_datadir/dolibarr/htdocs/compta
|
||||||
|
|||||||
@ -884,7 +884,7 @@ if ($mode == 'deploy')
|
|||||||
{
|
{
|
||||||
dol_fiche_head($head, $mode, '', -1);
|
dol_fiche_head($head, $mode, '', -1);
|
||||||
|
|
||||||
|
$dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT);
|
||||||
$allowonlineinstall=true;
|
$allowonlineinstall=true;
|
||||||
$allowfromweb=1;
|
$allowfromweb=1;
|
||||||
if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false;
|
if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false;
|
||||||
@ -911,7 +911,6 @@ if ($mode == 'deploy')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
|
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
|
||||||
$allowfromweb=0;
|
$allowfromweb=0;
|
||||||
}
|
}
|
||||||
@ -975,7 +974,6 @@ if ($mode == 'deploy')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! empty($result['return']))
|
if (! empty($result['return']))
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -989,8 +987,6 @@ if ($mode == 'deploy')
|
|||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($mode == 'develop')
|
if ($mode == 'develop')
|
||||||
{
|
{
|
||||||
dol_fiche_head($head, $mode, '', -1);
|
dol_fiche_head($head, $mode, '', -1);
|
||||||
|
|||||||
@ -799,6 +799,7 @@ TitleSetToDraft=Go back to draft
|
|||||||
ConfirmSetToDraft=Are you sure you want to go back to Draft status ?
|
ConfirmSetToDraft=Are you sure you want to go back to Draft status ?
|
||||||
ImportId=Import id
|
ImportId=Import id
|
||||||
Websites=Web sites
|
Websites=Web sites
|
||||||
|
Events=Events
|
||||||
# Week day
|
# Week day
|
||||||
Monday=Monday
|
Monday=Monday
|
||||||
Tuesday=Tuesday
|
Tuesday=Tuesday
|
||||||
|
|||||||
@ -180,19 +180,20 @@ $sql = "SELECT";
|
|||||||
$sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,";
|
$sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,";
|
||||||
if ($client) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,";
|
if ($client) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,";
|
||||||
$sql.= " sum(d.total_ht) as selling_price,";
|
$sql.= " sum(d.total_ht) as selling_price,";
|
||||||
// Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this)
|
// Note: qty and buy_price_ht is always positive (if not, your database may be corrupted, you can update this)
|
||||||
$sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,";
|
$sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,";
|
||||||
$sql.= " sum(".$db->ifsql('d.total_ht < 0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge";
|
$sql.= " sum(".$db->ifsql('d.total_ht < 0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||||
|
if ($socid > 0) $sql.= ' AND s.rowid = '.$socid;
|
||||||
|
if (!$user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " AND f.fk_statut > 0";
|
$sql.= " AND f.fk_statut > 0";
|
||||||
$sql.= ' AND s.entity IN ('.getEntity('societe').')';
|
$sql.= ' AND s.entity IN ('.getEntity('societe').')';
|
||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
$sql.= " AND (d.product_type = 0 OR d.product_type = 1)";
|
$sql.= " AND (d.product_type = 0 OR d.product_type = 1)";
|
||||||
if ($client)
|
|
||||||
$sql.= " AND f.fk_soc = ".$socid;
|
|
||||||
if (!empty($startdate))
|
if (!empty($startdate))
|
||||||
$sql.= " AND f.datef >= '".$db->idate($startdate)."'";
|
$sql.= " AND f.datef >= '".$db->idate($startdate)."'";
|
||||||
if (!empty($enddate))
|
if (!empty($enddate))
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -70,7 +70,9 @@ $hookmanager->initHooks(array('projecttaskcard','globalcard'));
|
|||||||
$progress=GETPOST('progress', 'int');
|
$progress=GETPOST('progress', 'int');
|
||||||
$label=GETPOST('label', 'alpha');
|
$label=GETPOST('label', 'alpha');
|
||||||
$description=GETPOST('description');
|
$description=GETPOST('description');
|
||||||
$planned_workload=GETPOST('planned_workloadhour')*3600+GETPOST('planned_workloadmin')*60;
|
$planned_workloadhour=(GETPOST('planned_workloadhour','int')?GETPOST('planned_workloadhour','int'):0);
|
||||||
|
$planned_workloadmin=(GETPOST('planned_workloadmin','int')?GETPOST('planned_workloadmin','int'):0);
|
||||||
|
$planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60;
|
||||||
|
|
||||||
$userAccess=0;
|
$userAccess=0;
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,8 @@ class Dolresource extends CommonObject
|
|||||||
public $type_label;
|
public $type_label;
|
||||||
public $tms='';
|
public $tms='';
|
||||||
|
|
||||||
|
var $oldcopy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -241,6 +243,13 @@ class Dolresource extends CommonObject
|
|||||||
if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource);
|
if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource);
|
||||||
if (isset($this->description)) $this->description=trim($this->description);
|
if (isset($this->description)) $this->description=trim($this->description);
|
||||||
|
|
||||||
|
if (empty($this->oldcopy))
|
||||||
|
{
|
||||||
|
$org=new self($this->db);
|
||||||
|
$org->fetch($this->id);
|
||||||
|
$this->oldcopy=$org;
|
||||||
|
}
|
||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
||||||
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
||||||
@ -259,17 +268,33 @@ class Dolresource extends CommonObject
|
|||||||
{
|
{
|
||||||
if (! $notrigger)
|
if (! $notrigger)
|
||||||
{
|
{
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Call trigger
|
||||||
// want this action calls a trigger.
|
$result=$this->call_trigger('RESOURCE_MODIFY',$user);
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//// Call triggers
|
if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref))
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
{
|
||||||
$interface=new Interfaces($this->db);
|
// We remove directory
|
||||||
$result=$interface->run_triggers('RESOURCE_MODIFY',$this,$user,$langs,$conf);
|
if (! empty($conf->resource->dir_output))
|
||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
{
|
||||||
//// End call triggers
|
$olddir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->oldcopy->ref);
|
||||||
|
$newdir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||||
|
if (file_exists($olddir))
|
||||||
|
{
|
||||||
|
$res = @rename($olddir, $newdir);
|
||||||
|
if (! $res)
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
$this->error=$langs->trans('ErrorFailToRenameDir',$olddir,$newdir);
|
||||||
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$action='update';
|
$action='update';
|
||||||
@ -424,6 +449,25 @@ class Dolresource extends CommonObject
|
|||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
// We remove directory
|
||||||
|
$ref = dol_sanitizeFileName($this->ref);
|
||||||
|
if (! empty($conf->resource->dir_output))
|
||||||
|
{
|
||||||
|
$dir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||||
|
if (file_exists($dir))
|
||||||
|
{
|
||||||
|
$res=@dol_delete_dir_recursive($dir);
|
||||||
|
if (! $res)
|
||||||
|
{
|
||||||
|
$this->errors[] = 'ErrorFailToDeleteDir';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user