mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a158f5ab9d | ||
|
|
61ee071f43 | ||
|
|
2c3a696b78 | ||
|
|
65b6b142bd | ||
|
|
f92129dcdb | ||
|
|
9fe1d8462a | ||
|
|
ffb408f440 | ||
|
|
ac08dec2c3 | ||
|
|
cf49c274a6 | ||
|
|
1a956cce9a | ||
|
|
5a81073cd8 | ||
|
|
45136de664 | ||
|
|
ba3581354a | ||
|
|
5cc02ac97f | ||
|
|
c8f323b706 | ||
|
|
c91f70cbf4 | ||
|
|
a01bb27d7e | ||
|
|
4445c34af0 | ||
|
|
91644d2145 | ||
|
|
982fca541d | ||
|
|
18ca96e285 |
@@ -2,6 +2,9 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
***** ChangeLog for 5.0.6 compared to 5.0.5 *****
|
||||||
|
FIX: Removed a bad symbolic link into custom directory.
|
||||||
|
FIX: Renaming a resouce ref rename also the directory of attached files.
|
||||||
|
|
||||||
***** ChangeLog for 5.0.5 compared to 5.0.4 *****
|
***** ChangeLog for 5.0.5 compared to 5.0.4 *****
|
||||||
FIX: #7075 : bad path for document
|
FIX: #7075 : bad path for document
|
||||||
@@ -32,6 +35,7 @@ FIX: User id correction on holiday request
|
|||||||
FIX: value of user id filled to 0 in llx_bank_url when recording an expense report.
|
FIX: value of user id filled to 0 in llx_bank_url when recording an expense report.
|
||||||
FIX: we have to check if contact doesn't already exist on add_contact() function
|
FIX: we have to check if contact doesn't already exist on add_contact() function
|
||||||
FIX: We should be able to insert data with value '0' into const
|
FIX: We should be able to insert data with value '0' into const
|
||||||
|
FIX: install process with DoliWamp
|
||||||
|
|
||||||
***** ChangeLog for 5.0.4 compared to 5.0.3 *****
|
***** ChangeLog for 5.0.4 compared to 5.0.3 *****
|
||||||
FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
|
FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
|||||||
* Main
|
* Main
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (empty($argv[1]))
|
if (empty($argv[1]))
|
||||||
{
|
{
|
||||||
print "Usage: ".$script_file." release=x.y.z\n";
|
print "Usage: ".$script_file." release=x.y.z\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
@@ -54,7 +54,7 @@ if ($release != DOL_VERSION)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||||
$outputdir=dirname(__FILE__).'/../htdocs/install';
|
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||||
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||||
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
||||||
|
|
||||||
|
|||||||
@@ -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++;
|
||||||
}
|
}
|
||||||
@@ -594,7 +594,9 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
print "Remove subdir of custom dir\n";
|
print "Remove subdir of custom dir\n";
|
||||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep dir
|
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep files only
|
||||||
|
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
|
||||||
|
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep files only
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build package for each target
|
# Build package for each target
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.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
|
||||||
@@ -121,7 +121,7 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
|
|||||||
$donotclearsession=1;
|
$donotclearsession=1;
|
||||||
if ($action == 'add') $action = 'create';
|
if ($action == 'add') $action = 'create';
|
||||||
if ($action == 'update') $action = 'edit';
|
if ($action == 'update') $action = 'edit';
|
||||||
|
|
||||||
$listUserAssignedUpdated = true;
|
$listUserAssignedUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,6 +572,11 @@ if ($action == 'mupdate')
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Actions to delete doc
|
||||||
|
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete));
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@@ -724,7 +729,7 @@ if ($action == 'create')
|
|||||||
print '<div class="assignedtouser">';
|
print '<div class="assignedtouser">';
|
||||||
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
if (in_array($user->id,array_keys($listofuserid)))
|
if (in_array($user->id,array_keys($listofuserid)))
|
||||||
{
|
{
|
||||||
print '<div class="myavailability">';
|
print '<div class="myavailability">';
|
||||||
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked':'').'> '.$langs->trans("Busy");
|
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked':'').'> '.$langs->trans("Busy");
|
||||||
@@ -851,11 +856,11 @@ if ($id > 0)
|
|||||||
$result3=$object->fetch_contact();
|
$result3=$object->fetch_contact();
|
||||||
$result4=$object->fetch_userassigned();
|
$result4=$object->fetch_userassigned();
|
||||||
$result5=$object->fetch_optionals($id,$extralabels);
|
$result5=$object->fetch_optionals($id,$extralabels);
|
||||||
|
|
||||||
if ($listUserAssignedUpdated || $donotclearsession)
|
if ($listUserAssignedUpdated || $donotclearsession)
|
||||||
{
|
{
|
||||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||||
|
|
||||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||||
|
|
||||||
@@ -872,7 +877,7 @@ if ($id > 0)
|
|||||||
//$object->societe->id = $_POST["socid"]; // deprecated
|
//$object->societe->id = $_POST["socid"]; // deprecated
|
||||||
//$object->contact->id = $_POST["contactid"]; // deprecated
|
//$object->contact->id = $_POST["contactid"]; // deprecated
|
||||||
$object->fk_project = GETPOST("projectid",'int');
|
$object->fk_project = GETPOST("projectid",'int');
|
||||||
|
|
||||||
$object->note = GETPOST("note");
|
$object->note = GETPOST("note");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1064,11 +1069,11 @@ if ($id > 0)
|
|||||||
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="assignedtouser">';
|
print '<div class="assignedtouser">';
|
||||||
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
if (in_array($user->id,array_keys($listofuserid)))
|
if (in_array($user->id,array_keys($listofuserid)))
|
||||||
{
|
{
|
||||||
print '<div class="myavailability">';
|
print '<div class="myavailability">';
|
||||||
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
||||||
@@ -1086,10 +1091,10 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Thirdparty - Contact
|
// Thirdparty - Contact
|
||||||
@@ -1200,11 +1205,11 @@ if ($id > 0)
|
|||||||
$out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
$out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||||
$linkback.=$out;
|
$linkback.=$out;
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
// Affichage fiche action en mode visu
|
// Affichage fiche action en mode visu
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@@ -1268,7 +1273,7 @@ if ($id > 0)
|
|||||||
print '<div class="assignedtouser">';
|
print '<div class="assignedtouser">';
|
||||||
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
||||||
{
|
{
|
||||||
print '<div class="myavailability">';
|
print '<div class="myavailability">';
|
||||||
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
|
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
|
||||||
@@ -1449,7 +1454,7 @@ if ($id > 0)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
|
|
||||||
$genallowed=$user->rights->agenda->myactions->create;
|
$genallowed=$user->rights->agenda->myactions->create;
|
||||||
$delallowed=$user->rights->agenda->myactions->delete;
|
$delallowed=$user->rights->agenda->myactions->delete;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
|||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if ($page == -1) { $page = 0; }
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@@ -127,9 +127,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|||||||
$search_number='';
|
$search_number='';
|
||||||
$search_statut='';
|
$search_statut='';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@@ -299,9 +299,9 @@ if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titr
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
@@ -435,7 +435,7 @@ $var=true;
|
|||||||
foreach ($accounts as $key=>$type)
|
foreach ($accounts as $key=>$type)
|
||||||
{
|
{
|
||||||
if ($i >= $limit) break;
|
if ($i >= $limit) break;
|
||||||
|
|
||||||
$found++;
|
$found++;
|
||||||
|
|
||||||
$acc = new Account($db);
|
$acc = new Account($db);
|
||||||
@@ -452,7 +452,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
{
|
{
|
||||||
$lastcurrencycode=$acc->currency_code;
|
$lastcurrencycode=$acc->currency_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@@ -461,14 +461,14 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '<td>'.$acc->getNomUrl(1).'</td>';
|
print '<td>'.$acc->getNomUrl(1).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
if (! empty($arrayfields['b.label']['checked']))
|
if (! empty($arrayfields['b.label']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$acc->label.'</td>';
|
print '<td>'.$acc->label.'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account type
|
// Account type
|
||||||
if (! empty($arrayfields['accountype']['checked']))
|
if (! empty($arrayfields['accountype']['checked']))
|
||||||
{
|
{
|
||||||
@@ -477,14 +477,14 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number
|
// Number
|
||||||
if (! empty($arrayfields['b.number']['checked']))
|
if (! empty($arrayfields['b.number']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$acc->number.'</td>';
|
print '<td>'.$acc->number.'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
if (! empty($arrayfields['b.account_number']['checked']))
|
if (! empty($arrayfields['b.account_number']['checked']))
|
||||||
{
|
{
|
||||||
@@ -492,7 +492,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '<td>'.length_accountg($acc->account_number).'</td>';
|
print '<td>'.length_accountg($acc->account_number).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accountancy journal
|
// Accountancy journal
|
||||||
if (! empty($arrayfields['b.accountancy_journal']['checked']))
|
if (! empty($arrayfields['b.accountancy_journal']['checked']))
|
||||||
{
|
{
|
||||||
@@ -500,7 +500,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '<td>'.length_accountg($acc->accountancy_journal).'</td>';
|
print '<td>'.length_accountg($acc->accountancy_journal).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transactions to reconcile
|
// Transactions to reconcile
|
||||||
if (! empty($arrayfields['toreconcile']['checked']))
|
if (! empty($arrayfields['toreconcile']['checked']))
|
||||||
{
|
{
|
||||||
@@ -519,13 +519,13 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
print '<td';
|
print '<td';
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
@@ -558,14 +558,14 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
if (! empty($arrayfields['b.clos']['checked']))
|
if (! empty($arrayfields['b.clos']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.$acc->getLibStatut(5).'</td>';
|
print '<td align="center">'.$acc->getLibStatut(5).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Balance
|
// Balance
|
||||||
if (! empty($arrayfields['balance']['checked']))
|
if (! empty($arrayfields['balance']['checked']))
|
||||||
{
|
{
|
||||||
@@ -576,7 +576,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
|
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
|
||||||
$totalarray['totalbalance'] += $solde;
|
$totalarray['totalbalance'] += $solde;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowrap" align="center">';
|
||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
@@ -587,7 +587,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$total[$acc->currency_code] += $solde;
|
$total[$acc->currency_code] += $solde;
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
|
|||||||
|
|
||||||
$check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
|
$check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
|
||||||
$checksoc = array('societe'); // Test for societe object
|
$checksoc = array('societe'); // Test for societe object
|
||||||
$checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...).
|
$checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...).
|
||||||
$checkproject = array('projet','project'); // Test for project object
|
$checkproject = array('projet','project'); // Test for project object
|
||||||
$checktask = array('projet_task');
|
$checktask = array('projet_task');
|
||||||
$nocheck = array('barcode','stock','fournisseur'); // No test
|
$nocheck = array('barcode','stock','fournisseur'); // No test
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
||||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||||
|
|
||||||
if (! defined('EURO')) define('EURO',chr(128));
|
if (! defined('EURO')) define('EURO',chr(128));
|
||||||
|
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ if (! $error && $db->connected && $action == "set")
|
|||||||
print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>';
|
print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>';
|
||||||
|
|
||||||
// Si creation utilisateur admin demandee, on le cree
|
// Si creation utilisateur admin demandee, on le cree
|
||||||
if (isset($db_create_user) && $db_create_user == "on") {
|
if (isset($db_create_user) && ($db_create_user == "1" || $db_create_user == "on")) {
|
||||||
dolibarr_install_syslog("step1: create database user: " . $dolibarr_main_db_user);
|
dolibarr_install_syslog("step1: create database user: " . $dolibarr_main_db_user);
|
||||||
|
|
||||||
//print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->port;
|
//print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->port;
|
||||||
@@ -614,7 +614,7 @@ if (! $error && $db->connected && $action == "set")
|
|||||||
|
|
||||||
|
|
||||||
// If database creation is asked, we create it
|
// If database creation is asked, we create it
|
||||||
if (!$error && (isset($db_create_database) && $db_create_database == "on")) {
|
if (!$error && (isset($db_create_database) && ($db_create_database == "1" || $db_create_database == "on"))) {
|
||||||
dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user);
|
dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user);
|
||||||
$newdb=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port);
|
$newdb=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port);
|
||||||
//print 'eee'.$conf->db->type." ".$conf->db->host." ".$userroot." ".$passroot." ".$conf->db->port." ".$newdb->connected." ".$newdb->forcecharset;exit;
|
//print 'eee'.$conf->db->type." ".$conf->db->host." ".$userroot." ".$passroot." ".$conf->db->port." ".$newdb->connected." ".$newdb->forcecharset;exit;
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ class Dolresource extends CommonObject
|
|||||||
var $type_label;
|
var $type_label;
|
||||||
var $tms='';
|
var $tms='';
|
||||||
|
|
||||||
|
var $oldcopy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@@ -230,85 +232,108 @@ class Dolresource extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user=null, $notrigger=0)
|
function update($user=null, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (isset($this->ref)) $this->ref=trim($this->ref);
|
if (isset($this->ref)) $this->ref=trim($this->ref);
|
||||||
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);
|
||||||
|
|
||||||
// Update request
|
if (empty($this->oldcopy))
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
{
|
||||||
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
$org=new self($this->db);
|
||||||
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
|
$org->fetch($this->id);
|
||||||
$sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").",";
|
$this->oldcopy=$org;
|
||||||
$sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null')."";
|
}
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
|
||||||
|
|
||||||
$this->db->begin();
|
// Update request
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
||||||
|
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
||||||
|
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
|
||||||
|
$sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").",";
|
||||||
|
$sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null')."";
|
||||||
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
$this->db->begin();
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
|
||||||
|
|
||||||
if (! $error)
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
{
|
$resql = $this->db->query($sql);
|
||||||
if (! $notrigger)
|
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||||
{
|
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
|
||||||
// want this action calls a trigger.
|
|
||||||
|
|
||||||
//// Call triggers
|
if (! $error)
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
{
|
||||||
$interface=new Interfaces($this->db);
|
if (! $notrigger)
|
||||||
$result=$interface->run_triggers('RESOURCE_MODIFY',$this,$user,$langs,$conf);
|
{
|
||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// Call trigger
|
||||||
//// End call triggers
|
$result=$this->call_trigger('RESOURCE_MODIFY',$user);
|
||||||
}
|
if ($result < 0) $error++;
|
||||||
}
|
// End call triggers
|
||||||
if (! $error)
|
}
|
||||||
{
|
}
|
||||||
$action='update';
|
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref))
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
{
|
||||||
$hookmanager->initHooks(array('actioncommdao'));
|
// We remove directory
|
||||||
$parameters=array('actcomm'=>$this->id);
|
if (! empty($conf->resource->dir_output))
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
{
|
||||||
if (empty($reshook))
|
$olddir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->oldcopy->ref);
|
||||||
{
|
$newdir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (file_exists($olddir))
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$res = @rename($olddir, $newdir);
|
||||||
if ($result < 0)
|
if (! $res)
|
||||||
{
|
{
|
||||||
$error++;
|
$langs->load("errors");
|
||||||
}
|
$this->error=$langs->trans('ErrorFailToRenameDir',$olddir,$newdir);
|
||||||
}
|
$error++;
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
if (! $error)
|
||||||
if ($error)
|
{
|
||||||
{
|
$action='update';
|
||||||
foreach($this->errors as $errmsg)
|
|
||||||
{
|
// Actions on extra fields (by external module or standard code)
|
||||||
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
// TODO le hook fait double emploi avec le trigger !!
|
||||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
$hookmanager->initHooks(array('actioncommdao'));
|
||||||
}
|
$parameters=array('actcomm'=>$this->id);
|
||||||
$this->db->rollback();
|
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
return -1*$error;
|
if (empty($reshook))
|
||||||
}
|
{
|
||||||
else
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$result=$this->insertExtraFields();
|
||||||
return 1;
|
if ($result < 0)
|
||||||
}
|
{
|
||||||
}
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($reshook < 0) $error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit or rollback
|
||||||
|
if ($error)
|
||||||
|
{
|
||||||
|
foreach($this->errors as $errmsg)
|
||||||
|
{
|
||||||
|
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
||||||
|
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||||
|
}
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1*$error;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load object in memory from database
|
* Load object in memory from database
|
||||||
@@ -375,65 +400,84 @@ class Dolresource extends CommonObject
|
|||||||
* @param int $notrigger Disable all triggers
|
* @param int $notrigger Disable all triggers
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function delete($rowid, $notrigger=0)
|
function delete($rowid, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " WHERE rowid =".$rowid;
|
$sql.= " WHERE rowid =".$rowid;
|
||||||
|
|
||||||
dol_syslog(get_class($this), LOG_DEBUG);
|
dol_syslog(get_class($this), LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources";
|
||||||
$sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid);
|
$sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid);
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (!$resql)
|
if (!$resql)
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$result=$this->deleteExtraFields();
|
$result=$this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('RESOURCE_DELETE',$user);
|
$result=$this->call_trigger('RESOURCE_DELETE',$user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
// We remove directory
|
||||||
return 1;
|
$ref = dol_sanitizeFileName($this->ref);
|
||||||
}
|
if (! empty($conf->resource->dir_output))
|
||||||
else
|
{
|
||||||
{
|
$dir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||||
$this->db->rollback();
|
if (file_exists($dir))
|
||||||
return -1;
|
{
|
||||||
}
|
$res=@dol_delete_dir_recursive($dir);
|
||||||
}
|
if (! $res)
|
||||||
|
{
|
||||||
|
$this->errors[] = 'ErrorFailToDeleteDir';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load resource objects into $this->lines
|
* Load resource objects into $this->lines
|
||||||
|
|||||||
Reference in New Issue
Block a user