commit
83c6c7e95a
@ -248,9 +248,9 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used.
|
||||
* Context for hook showSocinfoOnPrint has been moved from "showsocinfoonprint" to "main"
|
||||
* Library htdocs/includes/phpoffice/phpexcel as been removed (replaced with htdocs/includes/phpoffice/PhpSpreadsheet)
|
||||
* Databse transaction in your triggers must be correctly balanced (one close for one open). If not, an error will be returned by the trigger, even if trigger did return error code.
|
||||
* Database transaction in your triggers must be correctly balanced (one close for one open). If not, an error will be returned by the trigger, even if trigger did return error code.
|
||||
* Dolibarr v13 is still compatible with any PHP version between 5.6.0 and 7.4.*; Unit tests are OK with PHP 8.0 but some warnings or troubles may appears with PHP 8.0.
|
||||
|
||||
* All your Ajax services must contains such a line at begin of file: if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal
|
||||
|
||||
***** ChangeLog for 12.0.4 compared to 12.0.3 *****
|
||||
FIX: make formConfirm an addreplace-type hook
|
||||
|
||||
@ -4,7 +4,7 @@ Priority: optional
|
||||
Maintainer: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
|
||||
# Uploaders: Laurent Destailleur (eldy) <eldy@users.sourceforge.net> # Only if differs from Maintainer
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: http://www.dolibarr.org
|
||||
Homepage: https://www.dolibarr.org
|
||||
Build-Depends: debhelper (>= 9), po-debconf
|
||||
# This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ setup_empty_conf() {
|
||||
mkdir -p /etc/dolibarr
|
||||
touch /etc/dolibarr/conf.php
|
||||
chown root:www-data /etc/dolibarr/conf.php
|
||||
chmod 664 /etc/dolibarr/conf.php
|
||||
chmod 660 /etc/dolibarr/conf.php
|
||||
}
|
||||
|
||||
is_new_upstream_version() {
|
||||
|
||||
@ -105,8 +105,8 @@ if (empty($includecustom)) {
|
||||
}
|
||||
}
|
||||
|
||||
print "Release : ".$release."\n";
|
||||
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
||||
print "Release : ".$release."\n";
|
||||
print "Include custom in signature : ".$includecustom."\n";
|
||||
print "Include constants in signature : ";
|
||||
foreach ($includeconstants as $countrycode => $tmp) {
|
||||
|
||||
@ -370,7 +370,7 @@ class BookKeeping extends CommonObject
|
||||
$sql .= ", ".(!empty($this->subledger_account) ? ("'".$this->db->escape($this->subledger_account)."'") : "NULL");
|
||||
$sql .= ", ".(!empty($this->subledger_label) ? ("'".$this->db->escape($this->subledger_label)."'") : "NULL");
|
||||
$sql .= ", '".$this->db->escape($this->numero_compte)."'";
|
||||
$sql .= ", ".(!empty($this->label_operation) ? ("'".$this->db->escape($this->label_operation)."'") : "NULL");
|
||||
$sql .= ", ".(!empty($this->label_compte) ? ("'".$this->db->escape($this->label_compte)."'") : "NULL");
|
||||
$sql .= ", '".$this->db->escape($this->label_operation)."'";
|
||||
$sql .= ", ".$this->debit;
|
||||
$sql .= ", ".$this->credit;
|
||||
|
||||
@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch"));
|
||||
$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch", "products"));
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
@ -339,7 +339,7 @@ if ($result) {
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
|
||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch"));
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
|
||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch", "products"));
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
@ -334,16 +334,16 @@ if ($result) {
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
$checkpicto = $form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
||||
|
||||
@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch"));
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
|
||||
@ -33,7 +33,9 @@ $langs->load("admin");
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
if (empty($action)) $action = 'edit';
|
||||
|
||||
// Define list of managed delays
|
||||
$modules = array(
|
||||
'agenda' => array(
|
||||
array(
|
||||
@ -190,6 +192,10 @@ if ($action == 'update')
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
$action = 'edit';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -768,7 +768,7 @@ if ($action == 'edit')
|
||||
{
|
||||
if (function_exists('fsockopen') && $port && $server)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect&date='.dol_now().'#formmailaftertstconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
@ -844,6 +844,7 @@ if ($action == 'edit')
|
||||
// Run the test to connect
|
||||
if ($action == 'testconnect')
|
||||
{
|
||||
print '<div id="formmailaftertstconnect" name="formmailaftertstconnect"></div>';
|
||||
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
@ -858,6 +859,7 @@ if ($action == 'edit')
|
||||
}
|
||||
|
||||
setEventMessages($errormsg, null, 'errors');
|
||||
print $errormsg;
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ print load_fiche_titre($title, '', 'title_setup');
|
||||
// Version
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')</td><td>'.DOL_VERSION;
|
||||
// If current version differs from last upgrade
|
||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
|
||||
@ -139,7 +139,7 @@ print '<br>';
|
||||
// Session
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("SessionSavePath").'</td><td colspan="2">'.session_save_path().'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("SessionName").'</td><td colspan="2">'.session_name().'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("SessionId").'</td><td colspan="2">'.session_id().'</td></tr>'."\n";
|
||||
@ -180,7 +180,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
||||
print '<td>'.$langs->trans("NbOfEntries").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Address").'</td>';
|
||||
print '</tr>'."\n";
|
||||
@ -202,7 +202,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
||||
// Localisation
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").'</td><td>'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CurrentUserLanguage").'</td><td>'.$langs->getDefaultLang().'</td></tr>'."\n";
|
||||
// Thousands
|
||||
@ -222,7 +222,22 @@ if (($thousand != ',' && $thousand != '.') || ($thousand != ' '))
|
||||
print "</tr>\n";
|
||||
}
|
||||
print '<tr class="oddeven"><td> => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
|
||||
// Timezone
|
||||
|
||||
// Timezones
|
||||
|
||||
// Database timezone
|
||||
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
{
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
|
||||
$sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
$txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'<br>'."\n";
|
||||
$txt .= $langs->trans("PHPTZ").' (date_default_timezone_get() / php.ini date.timezone): '.(getServerTimeZoneString()." / ".(ini_get("date.timezone") ? ini_get("date.timezone") : $langs->trans("NotDefined")))."<br>\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ) ? $langs->trans("NotDefined") : $conf->global->MAIN_SERVER_TZ);
|
||||
@ -238,23 +253,10 @@ $val .= ' '.getServerTimeZoneString();
|
||||
$val .= ' '.$langs->trans("DaylingSavingTime").': '.($daylight === 'unknown' ? 'unknown' : ($a == $c ?yn($daylight) : yn(0).($daylight ? ' ('.$langs->trans('YesInSummer').')' : '')));
|
||||
print $form->textwithtooltip($val, $txt, 2, 1, img_info(''));
|
||||
print '</td></tr>'."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now(), 'dayhour', 'tzserver').'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver').'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td> => dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0, "dayhourtext").'</td>';
|
||||
print '<tr class="oddeven"><td> => dol_get_first_day(1970,1,false)</td><td>'.dol_get_first_day(1970, 1, false).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970, 1, false), 'dayhour').')</td>';
|
||||
print '<tr class="oddeven"><td> => dol_get_first_day(1970,1,true)</td><td>'.dol_get_first_day(1970, 1, true).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970, 1, true), 'dayhour').')</td>';
|
||||
// Database timezone
|
||||
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
{
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
|
||||
$sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
// Client
|
||||
$tz = (int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ClientTZ").'</td><td>'.($tz ? ($tz >= 0 ? '+' : '').$tz : '').' ('.($tz >= 0 ? '+' : '').($tz * 60 * 60).')';
|
||||
@ -265,7 +267,7 @@ else print yn(0);
|
||||
if (!empty($_SESSION['dol_dst_first'])) print ' ('.dol_print_date(dol_stringtotime($_SESSION['dol_dst_first']), 'dayhour', 'gmt').' - '.dol_print_date(dol_stringtotime($_SESSION['dol_dst_second']), 'dayhour', 'gmt').')';
|
||||
print '</td></tr>'."\n";
|
||||
print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now(), 'dayhour', 'tzuser').'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td> => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzuser').'</td></tr>'."\n";
|
||||
|
||||
$filesystemencoding = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)</td><td>'.$filesystemencoding.'</td></tr>'."\n";
|
||||
@ -340,7 +342,7 @@ $configfileparameters = array(
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("Parameters").' ';
|
||||
print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')';
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
|
||||
@ -69,13 +69,13 @@ if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2)
|
||||
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$ErrorPicturePath = "../../theme/eldy/img/error.png";
|
||||
$WarningPicturePath = "../../theme/eldy/img/warning.png";
|
||||
$OkayPicturePath = "../../theme/eldy/img/tick.png";
|
||||
|
||||
print '<tr><td width="220">'.$langs->trans("Version").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("Version").'</td><td>';
|
||||
|
||||
$arrayphpminversionerror = array(5, 5, 0);
|
||||
$arrayphpminversionwarning = array(5, 6, 0);
|
||||
@ -129,11 +129,8 @@ $loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="200">'.$langs->trans("Extension").'</td>';
|
||||
//print '<td align="center">'.$langs->trans("EnabledInSetup").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Loaded").'</td>';
|
||||
print '<td align="center">'.$langs->trans("FunctionTest").'</td>';
|
||||
print '<td>'.$langs->trans("Result").'</td>';
|
||||
print '<td class="titlefield">'.$langs->trans("Extension").'</td>';
|
||||
print '<td>'.$langs->trans("Test").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$functions = ["mb_check_encoding"];
|
||||
@ -141,9 +138,6 @@ $name = "MBString";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
print "</tr>";
|
||||
|
||||
@ -152,9 +146,6 @@ $name = "JSON";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
print "</tr>";
|
||||
|
||||
@ -163,8 +154,6 @@ $name = "GD";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
print "</tr>";
|
||||
|
||||
@ -173,8 +162,6 @@ $name = "Curl";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
print "</tr>";
|
||||
|
||||
@ -185,8 +172,6 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
print "</tr>";
|
||||
}
|
||||
@ -196,8 +181,6 @@ $name = "IMAP";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
print "</tr>";
|
||||
|
||||
@ -206,8 +189,6 @@ $name = "xDebug";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
print "</tr>";
|
||||
|
||||
@ -222,7 +203,7 @@ foreach ($phparray as $key => $value)
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="220px">'.$key.'</td>';
|
||||
print '<td class="titlefield">'.$key.'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -269,69 +250,6 @@ llxFooter();
|
||||
$db->close();
|
||||
|
||||
|
||||
/**
|
||||
* Return a table column with a indicator (okay or warning), based on the given name and list
|
||||
*
|
||||
* @param string $name The name to check inside the given list
|
||||
* @param array $list A list that should contains the given name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getTableColumn($name, array $list)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$name = strtolower($name);
|
||||
$html = "<td align='center'>";
|
||||
|
||||
if (in_array($name, $list))
|
||||
{
|
||||
if ($name == 'xdebug') $html .= '<img src="../../theme/eldy/img/warning.png" title="'.$langs->trans("ModuleActivated", "xdebug").'">';
|
||||
else $html .= '<img src="../../theme/eldy/img/tick.png" title="Ok">';
|
||||
} else {
|
||||
if ($name == 'xdebug') $html .= yn(0);
|
||||
else $html .= '<img src="../../theme/eldy/img/warning.png" title="Warning">';
|
||||
}
|
||||
|
||||
$html .= "</td>";
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a table column with a indicator (okay or warning), based on the given functions to check
|
||||
*
|
||||
* @param array $functions A list with functions to check
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getTableColumnFunction(array $functions)
|
||||
{
|
||||
if (count($functions) < 1)
|
||||
{
|
||||
return "<td align='center'>-</td>";
|
||||
}
|
||||
|
||||
$result = true;
|
||||
$html = "<td align='center'>";
|
||||
|
||||
foreach ($functions as $function)
|
||||
{
|
||||
$result = $result && function_exists($function);
|
||||
}
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$html .= '<img src="../../theme/eldy/img/tick.png" alt="Ok">';
|
||||
} else {
|
||||
$html .= '<img src="../../theme/eldy/img/warning.png" alt="Warning">';
|
||||
}
|
||||
|
||||
$html .= "</td>";
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a result column with a translated result text
|
||||
*
|
||||
@ -339,7 +257,6 @@ function getTableColumnFunction(array $functions)
|
||||
* @param array $activated A list with all activated PHP extensions. Deprecated.
|
||||
* @param array $loaded A list with all loaded PHP extensions
|
||||
* @param array $functions A list with all PHP functions to check
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getResultColumn($name, array $activated, array $loaded, array $functions)
|
||||
@ -347,6 +264,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function
|
||||
global $langs;
|
||||
|
||||
$result = true;
|
||||
|
||||
//$result = $result && in_array(strtolower($name), $activated);
|
||||
$result = $result && in_array(strtolower($name), $loaded);
|
||||
|
||||
@ -356,7 +274,29 @@ function getResultColumn($name, array $activated, array $loaded, array $function
|
||||
}
|
||||
|
||||
$html = "<td>";
|
||||
$html .= $result ? $langs->trans("PHPSupport", $name) : $langs->trans("ErrorPHPDoesNotSupport", $name);
|
||||
if ($result) {
|
||||
if (strtolower($name) == 'xdebug') $html .= img_warning($langs->trans("ModuleActivated", "xdebug"));
|
||||
else $html .= img_picto($langs->trans("Ok"), 'tick');
|
||||
if (in_array(strtolower($name), $loaded)) {
|
||||
$html .= ' '.$langs->trans("Loaded").' - ';
|
||||
} else {
|
||||
//$html .= ' '.$langs->trans("NotLoaded").' - ';
|
||||
}
|
||||
if (strtolower($name) == 'xdebug') {
|
||||
$html .= ' '.$langs->trans("ModuleActivated", "xdebug");
|
||||
} else {
|
||||
$html .= ' '.$langs->trans("PHPSupport", $name);
|
||||
}
|
||||
} else {
|
||||
if (strtolower($name) == 'xdebug') $html .= yn(0).' - ';
|
||||
else $html .= img_warning($langs->trans("ModuleActivated", "xdebug"));
|
||||
if (in_array(strtolower($name), $loaded)) {
|
||||
$html .= ' '.$langs->trans("Loaded").' - ';
|
||||
} else {
|
||||
//$html .= ' '.$langs->trans("NotLoaded").' - ';
|
||||
}
|
||||
$html .= ' '.$langs->trans("ErrorPHPDoesNotSupport", $name);
|
||||
}
|
||||
$html .= "</td>";
|
||||
|
||||
return $html;
|
||||
|
||||
@ -43,9 +43,6 @@ if (GETPOST('action', 'aZ09') == 'donothing')
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$nowstring = dol_print_date(dol_now(), 'dayhourlog');
|
||||
|
||||
llxHeader();
|
||||
|
||||
print load_fiche_titre($langs->trans("Security"), '', 'title_setup');
|
||||
@ -78,7 +75,7 @@ else {
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("ConfigFile"), '', 'folder');
|
||||
print load_fiche_titre($langs->trans("ConfigurationFile"), '', 'folder');
|
||||
|
||||
print '<strong>'.$langs->trans("dolibarr_main_prod").'</strong>: '.$dolibarr_main_prod;
|
||||
if (empty($dolibarr_main_prod)) {
|
||||
@ -90,7 +87,12 @@ print '<strong>'.$langs->trans("dolibarr_nocsrfcheck").'</strong>: '.$dolibarr_n
|
||||
if (!empty($dolibarr_nocsrfcheck)) {
|
||||
print img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
print '<strong>'.$langs->trans("dolibarr_main_restrict_ip").'</strong>: '.$dolibarr_main_restrict_ip;
|
||||
/*if (empty($dolibarr_main_restrict_ip)) {
|
||||
print ' '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1);
|
||||
}*/
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
@ -102,9 +104,17 @@ print '<strong>'.$langs->trans("PermissionsOnFilesInWebRoot").'</strong>: ';
|
||||
print 'TODO';
|
||||
print '<br>';
|
||||
|
||||
print '<strong>'.$langs->trans("PermissionsOnFile", 'conf.php').'</strong>: ';
|
||||
// TODO Check permission on file conf.php (read only for the web user)
|
||||
print 'TODO';
|
||||
print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: '; // $conffile is defined into filefunc.inc.php
|
||||
$perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
|
||||
if ($perms) {
|
||||
if (($perms & 0x0004) || ($perms & 0x0002)) {
|
||||
print img_warning().' '.$langs->trans("ConfFileIsReadableOrWritableByAnyUsers");
|
||||
} else {
|
||||
print img_picto('', 'tick');
|
||||
}
|
||||
} else {
|
||||
print img_warning().' '.$langs->trans("FailedToReadFile", $conffile);
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
@ -137,14 +147,15 @@ print '<br>';
|
||||
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder');
|
||||
|
||||
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
|
||||
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? 'unset' : '')." ";
|
||||
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? $langs->trans("Undefined") : '')." ";
|
||||
print '<span class="opacitymedium"> If unset: \'md5\'</span> ';
|
||||
print '<span class="opacitymedium"> - Recommanded value: \'password_hash\'</span><br>';
|
||||
print '<strong>MAIN_SECURITY_SALT</strong> = '.$conf->global->MAIN_SECURITY_SALT.'<br>';
|
||||
print '<strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? $langs->trans("Undefined") : '').'<br>';
|
||||
print '<br>';
|
||||
// TODO
|
||||
|
||||
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
|
||||
print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
|
||||
print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0);
|
||||
if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
|
||||
print ' - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
|
||||
|
||||
@ -425,7 +425,7 @@ class Documents extends DolibarrApi
|
||||
throw new RestException(500, 'Error while fetching object: '.$object->error);
|
||||
}
|
||||
|
||||
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
|
||||
}
|
||||
elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
||||
{
|
||||
|
||||
@ -22,6 +22,11 @@
|
||||
* \ingroup member
|
||||
* \brief Page to print sheets with barcodes using the document templates into core/modules/printsheets
|
||||
*/
|
||||
|
||||
if (!empty($_POST['mode']) && $_POST['mode'] === 'label') { // Page is called to build a PDF and output, we must ne renew the token.
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
|
||||
}
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -237,16 +242,22 @@ if ($action == 'builddoc')
|
||||
|
||||
$outfile = $langs->trans("BarCode").'_sheets_'.dol_print_date(dol_now(), 'dayhourlog').'.pdf';
|
||||
|
||||
if (!$mesg) $result = doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, $diroutput, $template, dol_sanitizeFileName($outfile));
|
||||
if (!$mesg) {
|
||||
$outputlangs = $langs;
|
||||
|
||||
// This generates and send PDF to output
|
||||
// TODO Move
|
||||
$result = doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, $diroutput, $template, dol_sanitizeFileName($outfile));
|
||||
}
|
||||
}
|
||||
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error('', $result);
|
||||
}
|
||||
if ($result <= 0 || $mesg) {
|
||||
if (empty($mesg)) {
|
||||
$mesg = 'Error '.$result;
|
||||
}
|
||||
|
||||
if (!$mesg)
|
||||
{
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
} else {
|
||||
$db->close();
|
||||
exit;
|
||||
}
|
||||
@ -275,10 +286,10 @@ dol_htmloutput_errors($mesg);
|
||||
//print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").'<br>';
|
||||
//print '<br>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; // The target is for brothers that open the file instead of downloading it
|
||||
print '<input type="hidden" name="mode" value="label">';
|
||||
print '<input type="hidden" name="action" value="builddoc">';
|
||||
print '<input type="hidden" name="token" value="'.newtoken().'">';
|
||||
print '<input type="hidden" name="token" value="'.currentToken().'">'; // The page will not renew the token but force download of a file, so we must use here currentToken
|
||||
|
||||
print '<div class="tagtable">';
|
||||
|
||||
|
||||
@ -318,7 +318,7 @@ switch ($action)
|
||||
if ($invoice->total_ttc == $obj_facturation->amountWithTax()
|
||||
&& $obj_facturation->getSetPaymentMode() != 'DIFF')
|
||||
{
|
||||
// We set status to payed
|
||||
// We set status to paid
|
||||
$result = $invoice->set_paid($user);
|
||||
//print 'set paid';exit;
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ llxHeader("", $langs->trans("Categories"), $helpurl);
|
||||
if ($user->rights->categorie->creer)
|
||||
{
|
||||
// Create or add
|
||||
if ($action == 'create' || $_POST["addcat"] == 'addcat')
|
||||
if ($action == 'create' || GETPOST("addcat") == 'addcat')
|
||||
{
|
||||
dol_set_focus('#label');
|
||||
|
||||
|
||||
@ -228,8 +228,8 @@ if (empty($reshook) && $action == 'add')
|
||||
$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
|
||||
|
||||
// Clean parameters
|
||||
$datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
$datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
|
||||
$datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
|
||||
|
||||
// Check parameters
|
||||
if (!$datef && $percentage == 100)
|
||||
@ -479,8 +479,8 @@ if (empty($reshook) && $action == 'update')
|
||||
$object->fetch_userassigned();
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
|
||||
|
||||
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
|
||||
$object->label = GETPOST("label", "alphanohtml");
|
||||
@ -953,7 +953,7 @@ if ($action == 'create')
|
||||
// Full day
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday') ? ' checked' : '').'></td></tr>';
|
||||
|
||||
$datep = ($datep ? $datep : $object->datep);
|
||||
$datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep));
|
||||
if (GETPOST('datep', 'int', 1)) $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 0);
|
||||
$datef = ($datef ? $datef : $object->datef);
|
||||
if (GETPOST('datef', 'int', 1)) $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 0);
|
||||
@ -1324,8 +1324,8 @@ if ($id > 0)
|
||||
{
|
||||
$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, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
|
||||
|
||||
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
|
||||
$object->label = GETPOST("label", "alphanohtml");
|
||||
@ -1430,23 +1430,23 @@ if ($id > 0)
|
||||
|
||||
// Full day event
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'></td></tr>';
|
||||
|
||||
print dol_print_date($object->datep, 'dayhour', 'gmt');
|
||||
// Date start - end
|
||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").'</span></td><td colspan="3">';
|
||||
if (GETPOST("afaire") == 1) {
|
||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart');
|
||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
|
||||
} elseif (GETPOST("afaire") == 2) {
|
||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
|
||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
|
||||
} else {
|
||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
|
||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
|
||||
}
|
||||
print ' - ';
|
||||
if (GETPOST("afaire") == 1) {
|
||||
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser');
|
||||
} elseif (GETPOST("afaire") == 2) {
|
||||
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser');
|
||||
} else {
|
||||
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1884,16 +1884,16 @@ if ($id > 0)
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td>';
|
||||
if (!$object->fulldayevent) print dol_print_date($object->datep, 'dayhour');
|
||||
else print dol_print_date($object->datep, 'day');
|
||||
if (!$object->fulldayevent) print dol_print_date($object->datep, 'dayhour', 'tzuser');
|
||||
else print dol_print_date($object->datep, 'day', 'tzuser');
|
||||
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td>';
|
||||
if (!$object->fulldayevent) print dol_print_date($object->datef, 'dayhour');
|
||||
else print dol_print_date($object->datef, 'day');
|
||||
if (!$object->fulldayevent) print dol_print_date($object->datef, 'dayhour', 'tzuser');
|
||||
else print dol_print_date($object->datef, 'day', 'tzuser');
|
||||
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1222,13 +1222,20 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
if (!$user->rights->agenda->allactions->read) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".$user->id;
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql .= " WHERE 1 = 1";
|
||||
if (empty($load_state_board)) $sql .= " AND a.percent >= 0 AND a.percent < 100";
|
||||
$sql .= " AND a.entity IN (".getEntity('agenda').")";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
|
||||
if ($user->socid) $sql .= " AND a.fk_soc = ".$user->socid;
|
||||
if (!$user->rights->agenda->allactions->read) $sql .= " AND (a.fk_user_author = ".$user->id." OR a.fk_user_action = ".$user->id." OR a.fk_user_done = ".$user->id.")";
|
||||
if (!$user->rights->agenda->allactions->read) {
|
||||
$sql .= " AND (a.fk_user_author = ".$user->id." OR a.fk_user_action = ".$user->id." OR a.fk_user_done = ".$user->id;
|
||||
$sql .= " OR ar.fk_element = ".$user->id; // Added by PV
|
||||
$sql .= ")";
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -514,7 +514,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
|
||||
{
|
||||
$s .= '<script type="text/javascript">'."\n";
|
||||
$s .= 'jQuery(document).ready(function () {
|
||||
jQuery("table input[name^=\"check_ext\"]").click(function() {
|
||||
jQuery("div input[name^=\"check_ext\"]").click(function() {
|
||||
var name = $(this).attr("name");
|
||||
jQuery(".family_ext" + name.replace("check_ext", "")).toggle();
|
||||
});
|
||||
@ -524,7 +524,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
|
||||
foreach ($showextcals as $val)
|
||||
{
|
||||
$htmlname = md5($val['name']);
|
||||
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" checked> '.$val['name'].' </div>';
|
||||
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" checked> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> </div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1716,7 +1716,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
// Hour start
|
||||
if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour)
|
||||
{
|
||||
$daterange .= dol_print_date($event->date_start_in_calendar, 'hour'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user
|
||||
$daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuser');
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar)
|
||||
{
|
||||
if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend)
|
||||
@ -1736,7 +1736,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar)
|
||||
{
|
||||
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
|
||||
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user
|
||||
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuser');
|
||||
}
|
||||
} else {
|
||||
if ($showinfo)
|
||||
|
||||
@ -136,9 +136,9 @@ $arrayfields = array(
|
||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||
'a.fk_contact'=>array('label'=>"Contact", 'checked'=>0),
|
||||
'a.fk_element'=>array('label'=>"LinkedObject", 'checked'=>1, 'enabled'=>(!empty($conf->global->AGENDA_SHOW_LINKED_OBJECT))),
|
||||
'a.percent'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
'a.datec'=>array('label'=>'DateCreation', 'checked'=>0),
|
||||
'a.tms'=>array('label'=>'DateModification', 'checked'=>0)
|
||||
'a.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>510),
|
||||
'a.tms'=>array('label'=>'DateModification', 'checked'=>0, 'position'=>520),
|
||||
'a.percent'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
@ -736,7 +736,7 @@ if ($resql)
|
||||
// Start date
|
||||
if (!empty($arrayfields['a.datep']['checked'])) {
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($db->jdate($obj->dp), $formatToUse);
|
||||
print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser');
|
||||
$late = 0;
|
||||
if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1;
|
||||
if ($obj->percent == 0 && !$obj->dp && $obj->dp2 && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1;
|
||||
@ -749,7 +749,7 @@ if ($resql)
|
||||
// End date
|
||||
if (!empty($arrayfields['a.datep2']['checked'])) {
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($db->jdate($obj->dp2), $formatToUse);
|
||||
print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -834,11 +834,11 @@ if ($resql)
|
||||
// Date creation
|
||||
if (!empty($arrayfields['a.datec']['checked'])) {
|
||||
// Status/Percent
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>';
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuser').'</td>';
|
||||
}
|
||||
// Date update
|
||||
if (!empty($arrayfields['a.tms']['checked'])) {
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuser').'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['a.percent']['checked'])) {
|
||||
// Status/Percent
|
||||
|
||||
@ -119,9 +119,8 @@ llxHeader('', $langs->trans("Mailing"), 'EN:Module_EMailing|FR:Module_Mailing|ES
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($filteremail)
|
||||
{
|
||||
$sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi,";
|
||||
if ($filteremail) {
|
||||
$sql = "SELECT m.rowid, m.titre as title, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi,";
|
||||
$sql .= " mc.statut as sendstatut";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE m.rowid = mc.fk_mailing AND m.entity = ".$conf->entity;
|
||||
@ -131,7 +130,7 @@ if ($filteremail)
|
||||
if (!$sortorder) $sortorder = "ASC";
|
||||
if (!$sortfield) $sortfield = "m.rowid";
|
||||
} else {
|
||||
$sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi";
|
||||
$sql = "SELECT m.rowid, m.titre as title, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
|
||||
$sql .= " WHERE m.entity = ".$conf->entity;
|
||||
if ($search_ref) $sql .= " AND m.rowid = '".$db->escape($search_ref)."'";
|
||||
@ -238,9 +237,10 @@ if ($resql)
|
||||
print $email->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
// Title
|
||||
print '<td>'.$obj->title.'</td>';
|
||||
// Date creation
|
||||
|
||||
// Date creation
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->datec), 'day');
|
||||
print '</td>';
|
||||
|
||||
@ -277,7 +277,7 @@ $help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'
|
||||
//llxHeader('',$langs->trans('Proposal'),$help_url);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " ava.rowid as availability,";
|
||||
|
||||
@ -615,7 +615,7 @@ if (empty($reshook))
|
||||
$result = $object->set_remise($user, GETPOST('remise_percent'));
|
||||
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
|
||||
$result = $object->set_remise_absolue($user, GETPOST('remise_absolue'));
|
||||
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha')) {
|
||||
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha')) {
|
||||
// Define vat_rate
|
||||
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
|
||||
$vat_rate = str_replace('*', '', $vat_rate);
|
||||
|
||||
@ -1824,6 +1824,8 @@ class Commande extends CommonOrder
|
||||
$this->project = null; // Clear if another value was already set by fetch_projet
|
||||
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->status = $obj->fk_statut;
|
||||
|
||||
$this->user_author_id = $obj->fk_user_author;
|
||||
$this->user_valid = $obj->fk_user_valid;
|
||||
$this->total_ht = $obj->total_ht;
|
||||
|
||||
@ -271,7 +271,7 @@ $help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_P
|
||||
// llxHeader('',$title,$help_url);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
|
||||
@ -283,7 +283,7 @@ if ($mode == 'customer')
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$cat_type = Categorie::TYPE_SUPPLIER;
|
||||
$cat_label = $langs->trans("Supplier").' '.lcfirst($langs->trans("Customer"));
|
||||
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
|
||||
}
|
||||
print '<tr><td>'.$cat_label.'</td><td>';
|
||||
print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
|
||||
|
||||
@ -424,6 +424,10 @@ if ($result)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$variousstatic->id = $obj->rowid;
|
||||
$variousstatic->ref = $obj->rowid;
|
||||
$variousstatic->label = $obj->label;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// No
|
||||
@ -433,15 +437,13 @@ if ($result)
|
||||
|
||||
// Ref
|
||||
if ($arrayfields['ref']['checked']) {
|
||||
$variousstatic->id = $obj->rowid;
|
||||
$variousstatic->ref = $obj->rowid;
|
||||
print "<td>".$variousstatic->getNomUrl(1)."</td>";
|
||||
print '<td>'.$variousstatic->getNomUrl(1)."</td>";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Label payment
|
||||
if ($arrayfields['label']['checked']) {
|
||||
print "<td>".dol_trunc($obj->label, 40)."</td>";
|
||||
print '<td class="tdoverflowmax150" title="'.$variousstatic->label.'">'.$variousstatic->label."</td>";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -460,7 +462,13 @@ if ($result)
|
||||
|
||||
// Type
|
||||
if ($arrayfields['type']['checked']) {
|
||||
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
||||
print '<td>';
|
||||
if ($obj->payment_code) {
|
||||
print $langs->trans("PaymentTypeShort".$obj->payment_code);
|
||||
print ' ';
|
||||
}
|
||||
print $obj->num_payment;
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
@ -923,7 +923,8 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("RepeatableInvoices"), 'ch-facture.html#s-fac-facture-rec');
|
||||
$help_url = '';
|
||||
llxHeader('', $langs->trans("RepeatableInvoices"), $help_url);
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
@ -1051,7 +1051,7 @@ class Invoices extends DolibarrApi
|
||||
}
|
||||
|
||||
if ($this->invoice->paye) {
|
||||
throw new RestException(500, 'Alreay payed');
|
||||
throw new RestException(500, 'Alreay paid');
|
||||
}
|
||||
|
||||
$this->invoice->fetch($id);
|
||||
|
||||
@ -1165,6 +1165,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
$object->id = 0;
|
||||
$object->statut = self::STATUS_DRAFT;
|
||||
$object->status = self::STATUS_DRAFT;
|
||||
|
||||
// Clear fields
|
||||
$object->date = (empty($this->date) ? dol_now() : $this->date);
|
||||
@ -1191,23 +1192,23 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
unset($object->lines[$i]);
|
||||
}
|
||||
// Bloc to update dates of service (month by month only if previously filled at 1d near start or end of month)
|
||||
|
||||
// Bloc to update dates of service (month by month only if previously filled and similare to start and end of month)
|
||||
// If it's a service with start and end dates
|
||||
if (!empty($line->date_start) && !empty($line->date_end)) {
|
||||
if (!empty($conf->global->INVOICE_AUTO_NEXT_MONTH_ON_LINES) && !empty($line->date_start) && !empty($line->date_end)) {
|
||||
// Get the dates
|
||||
$start = dol_getdate($line->date_start);
|
||||
$end = dol_getdate($line->date_end);
|
||||
|
||||
// Get the first and last day of the month
|
||||
$first = dol_get_first_day($start['year'], $start['mon']);
|
||||
$last = dol_get_first_day($end['year'], $end['mon']);
|
||||
$last = dol_get_last_day($end['year'], $end['mon']);
|
||||
|
||||
// Get diff betweend start/end of month and previously filled
|
||||
$diffFirst = num_between_day($first, dol_mktime($start['hours'], $start['minutes'], $start['seconds'], $start['mon'], $start['mday'], $start['year'], 'user'));
|
||||
$diffLast = num_between_day(dol_mktime($end['hours'], $end['minutes'], $end['seconds'], $end['mon'], $end['mday'], $end['year'], 'user'), $last);
|
||||
|
||||
// If there is <= 1d (or 2?) of start/or/end of month
|
||||
if ($diffFirst <= 2 && $diffLast <= 2) {
|
||||
//print dol_print_date(dol_mktime(0, 0, 0, $start['mon'], $start['mday'], $start['year'], 'gmt'), 'dayhour').' '.dol_print_date($first, 'dayhour').'<br>';
|
||||
//print dol_mktime(23, 59, 59, $end['mon'], $end['mday'], $end['year'], 'gmt').' '.$last.'<br>';exit;
|
||||
// If start date is first date of month and end date is last date of month
|
||||
if (dol_mktime(0, 0, 0, $start['mon'], $start['mday'], $start['year'], 'gmt') == $first
|
||||
&& dol_mktime(23, 59, 59, $end['mon'], $end['mday'], $end['year'], 'gmt') == $last) {
|
||||
$nextMonth = dol_get_next_month($end['mon'], $end['year']);
|
||||
$newFirst = dol_get_first_day($nextMonth['year'], $nextMonth['month']);
|
||||
$newLast = dol_get_last_day($nextMonth['year'], $nextMonth['month']);
|
||||
@ -1594,6 +1595,8 @@ class Facture extends CommonInvoice
|
||||
$this->project = null; // Clear if another value was already set by fetch_projet
|
||||
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->status = $obj->fk_statut;
|
||||
|
||||
$this->date_lim_reglement = $this->db->jdate($obj->dlr);
|
||||
$this->mode_reglement_id = $obj->fk_mode_reglement;
|
||||
$this->mode_reglement_code = $obj->mode_reglement_code;
|
||||
|
||||
@ -413,7 +413,7 @@ $formcompany = new FormCompany($db);
|
||||
$thirdpartystatic = new Societe($db);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
|
||||
$sql .= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
|
||||
$sql .= ' f.fk_user_author,';
|
||||
|
||||
@ -161,8 +161,9 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, f.fk_statut, f.paye,";
|
||||
$sql .= " s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,";
|
||||
$sql .= " s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,";
|
||||
$sql .= " cc.rowid, cc.code";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user";
|
||||
|
||||
// Add Group from hooks
|
||||
$parameters = array();
|
||||
@ -1089,7 +1090,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
}
|
||||
|
||||
/*
|
||||
* Unpayed supplier invoices
|
||||
* Unpaid supplier invoices
|
||||
*/
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
|
||||
@ -381,7 +381,7 @@ class Localtax extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* localtax payed
|
||||
* Total of localtax paid in invoice
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
@ -419,8 +419,7 @@ class Localtax extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* localtax payed
|
||||
* Total de la localtax payed
|
||||
* Total of localtax paid
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return int ???
|
||||
|
||||
@ -565,7 +565,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
/*
|
||||
* Payed
|
||||
* Paid
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->transcountry($LTPaid, $mysoc->country_code), '', '');
|
||||
|
||||
@ -162,7 +162,7 @@ print dol_get_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* List of social contributions payed
|
||||
* List of social contributions paid
|
||||
*/
|
||||
|
||||
$disable_delete = 0;
|
||||
@ -213,7 +213,7 @@ if ($resql)
|
||||
print '<td class="right">'.price($objp->sc_amount).'</td>';
|
||||
// Status
|
||||
print '<td class="center">'.$socialcontrib->getLibStatut(4, $objp->amount).'</td>';
|
||||
// Amount payed
|
||||
// Amount paid
|
||||
print '<td class="right">'.price($objp->amount).'</td>';
|
||||
print "</tr>\n";
|
||||
if ($objp->paye == 1) // If at least one invoice is paid, disable delete
|
||||
|
||||
@ -370,7 +370,7 @@ class BonPrelevement extends CommonObject
|
||||
$num = count($facs);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
/* Tag invoice as payed */
|
||||
/* Tag invoice as paid */
|
||||
dol_syslog(get_class($this)."::set_credite set_paid fac ".$facs[$i]);
|
||||
$fac = new Facture($this->db);
|
||||
$fac->fetch($facs[$i]);
|
||||
|
||||
@ -421,7 +421,7 @@ class ChargeSociales extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Tag social contribution as payed completely
|
||||
* Tag social contribution as paid completely
|
||||
*
|
||||
* @param User $user Object user making change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@ -439,7 +439,7 @@ class ChargeSociales extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Remove tag payed on social contribution
|
||||
* Remove tag paid on social contribution
|
||||
*
|
||||
* @param User $user Object user making change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@ -459,7 +459,7 @@ class ChargeSociales extends CommonObject
|
||||
* Retourne le libelle du statut d'une charge (impaye, payee)
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount paid if you have it, 1 otherwise)
|
||||
* @return string Label
|
||||
*/
|
||||
public function getLibStatut($mode = 0, $alreadypaid = -1)
|
||||
@ -473,7 +473,7 @@ class ChargeSociales extends CommonObject
|
||||
*
|
||||
* @param int $status Id status
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount paid if you have it, 1 otherwise)
|
||||
* @return string Label
|
||||
*/
|
||||
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
|
||||
|
||||
@ -110,7 +110,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
* Use this->amounts to have list of lines for the payment
|
||||
*
|
||||
* @param User $user User making payment
|
||||
* @param int $closepaidcontrib 1=Also close payed contributions to paid, 0=Do nothing more
|
||||
* @param int $closepaidcontrib 1=Also close paid contributions to paid, 0=Do nothing more
|
||||
* @return int <0 if KO, id of payment if OK
|
||||
*/
|
||||
public function create($user, $closepaidcontrib = 0)
|
||||
@ -178,7 +178,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
{
|
||||
$amount = price2num($amount);
|
||||
|
||||
// If we want to closed payed invoices
|
||||
// If we want to closed paid invoices
|
||||
if ($closepaidcontrib)
|
||||
{
|
||||
$contrib = new ChargeSociales($this->db);
|
||||
|
||||
@ -44,12 +44,12 @@ $nbofyear = 4;
|
||||
$year = GETPOST('year', 'int');
|
||||
if (empty($year))
|
||||
{
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$month_current = strftime("%m", dol_now());
|
||||
$year_current = dol_print_date(dol_now(), "%Y");
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year_current - ($nbofyear - 1);
|
||||
} else {
|
||||
$year_current = $year;
|
||||
$month_current = strftime("%m", dol_now());
|
||||
$month_current = dol_print_date(dol_now(), "%m");
|
||||
$year_start = $year - ($nbofyear - 1);
|
||||
}
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
@ -58,12 +58,12 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
// We define date_start and date_end
|
||||
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
{
|
||||
$q = GETPOST("q") ?GETPOST("q") : 0;
|
||||
$q = GETPOST("q") ? GETPOST("q") : 0;
|
||||
if ($q == 0)
|
||||
{
|
||||
// We define date_start and date_end
|
||||
$year_end = $year_start + ($nbofyear - 1);
|
||||
$month_start = GETPOST("month") ?GETPOST("month") : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
$month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
if (!GETPOST('month'))
|
||||
{
|
||||
if (!GETPOST("year") && $month_start > $month_current)
|
||||
@ -86,8 +86,10 @@ $userid = GETPOST('userid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$tmps = dol_getdate($date_start);
|
||||
$mothn_start = $tmps['mon'];
|
||||
$year_start = $tmps['year'];
|
||||
$tmpe = dol_getdate($date_end);
|
||||
$month_end = $tmpe['mon'];
|
||||
$year_end = $tmpe['year'];
|
||||
$nbofyear = ($year_end - $year_start) + 1;
|
||||
|
||||
@ -306,7 +308,7 @@ $now = dol_now();
|
||||
$casenow = dol_print_date($now, "%Y-%m");
|
||||
|
||||
// Loop on each month
|
||||
$nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START - 1) : 0;
|
||||
$nb_mois_decalage = GETPOSTISSET('date_startmonth') ? (GETPOST('date_startmonth', 'int') - 1) : (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 0 : ($conf->global->SOCIETE_FISCAL_MONTH_START - 1));
|
||||
for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++)
|
||||
{
|
||||
$mois_modulo = $mois; // ajout
|
||||
@ -338,68 +340,75 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++)
|
||||
if ($annee >= $year_start) // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output.
|
||||
{
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
// Valeur CA du mois w/o VAT
|
||||
// Value turnover of month w/o VAT
|
||||
print '<td class="right">';
|
||||
if ($cum_ht[$case])
|
||||
{
|
||||
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">'.price($cum_ht[$case], 1).'</a>';
|
||||
} else {
|
||||
if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; }
|
||||
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||
if ($cum_ht[$case]) {
|
||||
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">'.price($cum_ht[$case], 1).'</a>';
|
||||
} else {
|
||||
if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; }
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Valeur CA du mois
|
||||
// Value turnover of month
|
||||
print '<td class="right">';
|
||||
if ($cum[$case])
|
||||
{
|
||||
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||
if ($modecompta != 'BOOKKEEPING') print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">';
|
||||
print price($cum[$case], 1);
|
||||
if ($modecompta != 'BOOKKEEPING') print '</a>';
|
||||
} else {
|
||||
if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; }
|
||||
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||
if ($cum[$case]) {
|
||||
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||
if ($modecompta != 'BOOKKEEPING') print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">';
|
||||
print price($cum[$case], 1);
|
||||
if ($modecompta != 'BOOKKEEPING') print '</a>';
|
||||
} else {
|
||||
if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; }
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Pourcentage du mois
|
||||
if ($annee_decalage > $minyear && $case <= $casenow)
|
||||
{
|
||||
if ($cum[$caseprev] && $cum[$case])
|
||||
// Percentage of month
|
||||
print '<td class="borderrightlight right">';
|
||||
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
|
||||
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||
if ($annee_decalage > $minyear && $case <= $casenow)
|
||||
{
|
||||
$percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100);
|
||||
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
|
||||
print '<td class="borderrightlight right">'.($percent >= 0 ? "+$percent" : "$percent").'%</td>';
|
||||
if ($cum[$caseprev] && $cum[$case])
|
||||
{
|
||||
$percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100);
|
||||
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
|
||||
print ($percent >= 0 ? "+$percent" : "$percent").'%';
|
||||
}
|
||||
if ($cum[$caseprev] && !$cum[$case])
|
||||
{
|
||||
print '-100%';
|
||||
}
|
||||
if (!$cum[$caseprev] && $cum[$case])
|
||||
{
|
||||
//print '<td class="right">+Inf%</td>';
|
||||
print '-';
|
||||
}
|
||||
if (isset($cum[$caseprev]) && !$cum[$caseprev] && !$cum[$case])
|
||||
{
|
||||
print '+0%';
|
||||
}
|
||||
if (!isset($cum[$caseprev]) && !$cum[$case])
|
||||
{
|
||||
print '-';
|
||||
}
|
||||
} else {
|
||||
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; }
|
||||
}
|
||||
if ($cum[$caseprev] && !$cum[$case])
|
||||
{
|
||||
print '<td class="borderrightlight right">-100%</td>';
|
||||
}
|
||||
if (!$cum[$caseprev] && $cum[$case])
|
||||
{
|
||||
//print '<td class="right">+Inf%</td>';
|
||||
print '<td class="borderrightlight right">-</td>';
|
||||
}
|
||||
if (isset($cum[$caseprev]) && !$cum[$caseprev] && !$cum[$case])
|
||||
{
|
||||
print '<td class="borderrightlight right">+0%</td>';
|
||||
}
|
||||
if (!isset($cum[$caseprev]) && !$cum[$case])
|
||||
{
|
||||
print '<td class="borderrightlight right">-</td>';
|
||||
}
|
||||
} else {
|
||||
print '<td class="borderrightlight right">';
|
||||
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; }
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
if ($annee_decalage < $year_end || ($annee_decalage == $year_end && $mois > 12 && $annee < $year_end)) print '<td width="15"> </td>';
|
||||
}
|
||||
|
||||
$total_ht[$annee] += ((!empty($cum_ht[$case])) ? $cum_ht[$case] : 0);
|
||||
$total[$annee] += $cum[$case];
|
||||
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||
$total_ht[$annee] += ((!empty($cum_ht[$case])) ? $cum_ht[$case] : 0);
|
||||
$total[$annee] += $cum[$case];
|
||||
}
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
@ -470,34 +479,37 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++)
|
||||
}
|
||||
*/
|
||||
|
||||
// Affiche total
|
||||
// Show total
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td>';
|
||||
for ($annee = $year_start; $annee <= $year_end; $annee++)
|
||||
{
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
// Montant total HT
|
||||
if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear)))
|
||||
{
|
||||
print '<td class="nowrap right">'.($total_ht[$annee] ?price($total_ht[$annee]) : "0")."</td>";
|
||||
if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) {
|
||||
print '<td class="nowrap right">';
|
||||
print ($total_ht[$annee] ?price($total_ht[$annee]) : "0");
|
||||
print "</td>";
|
||||
} else {
|
||||
print '<td> </td>';
|
||||
}
|
||||
}
|
||||
|
||||
// Montant total
|
||||
if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear)))
|
||||
{
|
||||
print '<td class="nowrap right">'.($total[$annee] ?price($total[$annee]) : "0")."</td>";
|
||||
// Total amount
|
||||
if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) {
|
||||
print '<td class="nowrap right">';
|
||||
print ($total[$annee] ?price($total[$annee]) : "0");
|
||||
print "</td>";
|
||||
} else {
|
||||
print '<td> </td>';
|
||||
}
|
||||
|
||||
// Pourcentage total
|
||||
if ($annee > $minyear && $annee <= max($nowyear, $maxyear))
|
||||
{
|
||||
if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) {
|
||||
if ($total[$annee - 1] && $total[$annee]) {
|
||||
$percent = (round(($total[$annee] - $total[$annee - 1]) / $total[$annee - 1], 4) * 100);
|
||||
print '<td class="nowrap borderrightlight right">'.($percent >= 0 ? "+$percent" : "$percent").'%</td>';
|
||||
print '<td class="nowrap borderrightlight right">';
|
||||
print ($percent >= 0 ? "+$percent" : "$percent").'%';
|
||||
print '</td>';
|
||||
}
|
||||
if ($total[$annee - 1] && !$total[$annee])
|
||||
{
|
||||
|
||||
@ -413,7 +413,7 @@ class Tva extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* VAT payed
|
||||
* Total of VAT paid into invoice
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return double Amount
|
||||
@ -451,7 +451,7 @@ class Tva extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Total of the VAT payed
|
||||
* Total of the VAT paid
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return double Amount
|
||||
|
||||
@ -543,7 +543,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
/*
|
||||
* Payed
|
||||
* Paid
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("VATPaid"), '', '');
|
||||
|
||||
@ -658,7 +658,7 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
if (!empty($arrayfields['s.nom']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if ($obj->socid > 0) {
|
||||
// TODO Use a cache for this string
|
||||
print $socstatic->getNomUrl(1, '');
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2015-2021 Frederic France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -79,7 +79,7 @@ class box_clients extends ModeleBoxes
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||
$thirdpartystatic = new Client($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers", $max));
|
||||
|
||||
@ -26,7 +26,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage the box to show not payed suppliers invoices
|
||||
* Class to manage the box to show not paid suppliers invoices
|
||||
*/
|
||||
class box_factures_fourn_imp extends ModeleBoxes
|
||||
{
|
||||
|
||||
@ -110,7 +110,8 @@ class box_factures_imp extends ModeleBoxes
|
||||
$sql .= " AND fk_statut = 1";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||
$sql .= " GROUP BY s.nom, s.rowid, s.email, s.code_client, s.logo, f.ref, f.date_lim_reglement,";
|
||||
$sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,";
|
||||
$sql .= " f.ref, f.date_lim_reglement,";
|
||||
$sql .= " f.type, f.datef, f.total, f.tva, f.total_ttc, f.paye, f.fk_statut, f.rowid";
|
||||
//$sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||
$sql .= " ORDER BY datelimite ASC, f.ref ASC ";
|
||||
|
||||
@ -134,7 +134,7 @@ class box_last_ticket extends ModeleBoxes
|
||||
$thirdparty->name = $objp->company_name;
|
||||
$link = $thirdparty->getNomUrl(1);
|
||||
} else {
|
||||
$link = dol_print_email($objp->origin_email);
|
||||
$link = '<span title="'.$objp->origin_email.'">'.dol_print_email($objp->origin_email).'</span>';
|
||||
}
|
||||
|
||||
$r = 0;
|
||||
@ -149,15 +149,15 @@ class box_last_ticket extends ModeleBoxes
|
||||
|
||||
// Subject
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => '',
|
||||
'text' => $objp->subject, // Some event have no ref
|
||||
'td' => 'class="tdoverflowmax200"',
|
||||
'text' => '<span title="'.$objp->subject.'">'.$objp->subject.'</span>', // Some event have no ref
|
||||
'url' => DOL_URL_ROOT."/ticket/card.php?track_id=".$objp->track_id,
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Customer
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => '',
|
||||
'td' => 'class="tdoverflowmax100"',
|
||||
'text' => $link,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
@ -221,6 +221,12 @@ abstract class CommonObject
|
||||
*/
|
||||
public $statut;
|
||||
|
||||
/**
|
||||
* @var int The object's status
|
||||
* @see setStatut()
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @see getFullAddress()
|
||||
@ -1054,7 +1060,6 @@ abstract class CommonObject
|
||||
{
|
||||
$this->error = $this->db->errno();
|
||||
$this->db->rollback();
|
||||
echo 'err rollback';
|
||||
return -2;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
@ -5298,6 +5303,7 @@ abstract class CommonObject
|
||||
$mandatorypb = false;
|
||||
if ($attributeType == 'link' && $this->array_options[$key] == '-1') $mandatorypb = true;
|
||||
if ($this->array_options[$key] === '') $mandatorypb = true;
|
||||
if ($attributeType == 'sellist' && $this->array_options[$key] == '0') $mandatorypb = true;
|
||||
if ($mandatorypb)
|
||||
{
|
||||
dol_syslog("Mandatory extra field ".$key." is empty");
|
||||
|
||||
@ -1998,9 +1998,12 @@ class ExtraFields
|
||||
|
||||
if ($this->attributes[$object->table_element]['required'][$key]) // Value is required
|
||||
{
|
||||
// Check if empty without using GETPOST, value can be alpha, int, array, etc...
|
||||
if ((!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0')
|
||||
|| (!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select')
|
||||
// Check if functionally empty without using GETPOST (depending on the type of extrafield, a
|
||||
// technically non-empty value may be treated as empty functionally).
|
||||
// value can be alpha, int, array, etc...
|
||||
if ((!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0')
|
||||
|| (!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select')
|
||||
|| (!is_array($_POST["options_".$key]) && isset($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'sellist' && $_POST['options_'.$key] == '0')
|
||||
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
|
||||
{
|
||||
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
|
||||
|
||||
@ -1927,7 +1927,7 @@ class Form
|
||||
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
|
||||
*
|
||||
* @param int $selected Preselected products
|
||||
* @param string $htmlname Name of HTML select field (must be unique in page)
|
||||
* @param string $htmlname Name of HTML select field (must be unique in page).
|
||||
* @param int $filtertype Filter on product type (''=nofilter, 0=product, 1=service)
|
||||
* @param int $limit Limit on number of returned lines
|
||||
* @param int $price_level Level of price to show
|
||||
@ -1949,7 +1949,7 @@ class Form
|
||||
* @param string $nooutput No print, return the output into a string
|
||||
* @return void|string
|
||||
*/
|
||||
public function select_produits($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 0, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = array(), $nooutput = 0)
|
||||
public function select_produits($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 0, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = null, $nooutput = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
@ -1997,10 +1997,13 @@ class Form
|
||||
}
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
|
||||
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
if (!empty($conf->variants->enabled) && is_array($selected_combinations)) {
|
||||
// Code to automatically insert with javascript the select of attributes under the select of product
|
||||
// when a parent of variant has been selected.
|
||||
$out .= '
|
||||
<!-- script to auto show attributes select tags if a variant was selected -->
|
||||
<script>
|
||||
|
||||
// auto show attributes fields
|
||||
selected = '.json_encode($selected_combinations).';
|
||||
combvalues = {};
|
||||
|
||||
@ -2019,6 +2022,8 @@ class Form
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("A change has started. We get variants fields to inject html select");
|
||||
|
||||
jQuery.getJSON("'.DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
|
||||
id: jQuery(this).val()
|
||||
}, function (data) {
|
||||
@ -2035,8 +2040,7 @@ class Form
|
||||
span.append(
|
||||
jQuery(document.createElement(\'div\')).text(val.label).css({
|
||||
\'font-weight\': \'bold\',
|
||||
\'display\': \'table-cell\',
|
||||
\'text-align\': \'right\'
|
||||
\'display\': \'table-cell\'
|
||||
})
|
||||
);
|
||||
|
||||
@ -4170,7 +4174,7 @@ class Form
|
||||
$output .= '<option value="-1"> </option>';
|
||||
foreach ($cate_arbo as $key => $value)
|
||||
{
|
||||
if ($cate_arbo[$key]['id'] == $selected || ($selected == 'auto' && count($cate_arbo) == 1))
|
||||
if ($cate_arbo[$key]['id'] == $selected || ($selected === 'auto' && count($cate_arbo) == 1))
|
||||
{
|
||||
$add = 'selected ';
|
||||
} else {
|
||||
@ -5536,7 +5540,7 @@ class Form
|
||||
* @param int $stepminutes Specify step for minutes between 1 and 30
|
||||
* @param string $labeladddateof Label to use for the $adddateof parameter.
|
||||
* @param string $placeholder Placeholder
|
||||
* @param mixed $gm 'auto', 'gmt' or 'tzserver' or 'tzuserrel'
|
||||
* @param mixed $gm 'auto' (for backward compatibility, avoid this), 'gmt' or 'tzserver' or 'tzuserrel'
|
||||
* @return string Html for selectDate
|
||||
* @see form_date(), select_month(), select_year(), select_dayofweek()
|
||||
*/
|
||||
@ -5544,8 +5548,8 @@ class Form
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($gm == 'auto') {
|
||||
$gm = $conf->tzuserinputkey;
|
||||
if ($gm === 'auto') {
|
||||
$gm = (empty($conf) ? 'tzserver' : $conf->tzuserinputkey);
|
||||
}
|
||||
|
||||
$retstring = '';
|
||||
|
||||
@ -202,7 +202,7 @@ class FormActions
|
||||
$newcardbutton = '';
|
||||
if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create))
|
||||
{
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog')).'&origin='.urlencode($typeelement).'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -455,10 +455,13 @@ class FormMail extends Form
|
||||
// Zone to select email template
|
||||
if (count($modelmail_array) > 0)
|
||||
{
|
||||
$model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : $arraydefaultmessage->id;
|
||||
|
||||
// If list of template is filled
|
||||
$out .= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
||||
|
||||
$out .= '<span class="opacitymedium">'.$langs->trans('SelectMailModel').':</span> ';
|
||||
$out .= $this->selectarray('modelmailselected', $modelmail_array, 0, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1, '', 0, 1);
|
||||
$out .= $this->selectarray('modelmailselected', $modelmail_array, $model_mail_selected_id, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1, '', 0, 1);
|
||||
if ($user->admin) $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')), 1);
|
||||
$out .= ' ';
|
||||
$out .= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';
|
||||
|
||||
@ -144,10 +144,10 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
dataType: "json",
|
||||
minLength: '.$minLength.',
|
||||
select: function( event, ui ) { // Function ran once new value has been selected into javascript combo
|
||||
console.log("Call change on input '.$htmlname.' because of select definition of autocomplete select call on input#search_'.$htmlname.'");
|
||||
console.log("We will trigger change on input '.$htmlname.' because of the select definition of autocomplete code for input#search_'.$htmlname.'");
|
||||
console.log("Selected id = "+ui.item.id+" - If this value is null, it means you select a record with key that is null so selection is not effective");
|
||||
|
||||
//console.log(ui.item);
|
||||
console.log("Propagate before some properties");
|
||||
$("#'.$htmlname.'").attr("data-pbq", ui.item.pbq);
|
||||
$("#'.$htmlname.'").attr("data-pbqup", ui.item.price_ht);
|
||||
$("#'.$htmlname.'").attr("data-pbqbase", ui.item.pricebasetype);
|
||||
@ -155,6 +155,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
$("#'.$htmlname.'").attr("data-pbqpercent", ui.item.discount);
|
||||
|
||||
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
|
||||
|
||||
// Disable an element
|
||||
if (options.option_disabled) {
|
||||
console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled)
|
||||
@ -170,6 +171,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
$("#" + options.option_disabled).removeAttr("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
if (options.disabled) {
|
||||
console.log("Make action disabled on each "+options.option_disabled)
|
||||
$.each(options.disabled, function(key, value) {
|
||||
@ -182,6 +184,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
$("#" + value).show().trigger("show");
|
||||
});
|
||||
}
|
||||
|
||||
// Update an input
|
||||
if (ui.item.update) {
|
||||
console.log("Make action update on each ui.item.update")
|
||||
@ -202,7 +205,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log("ajax_autocompleter new value selected, we trigger change on original component so field #search_'.$htmlname.'");
|
||||
console.log("ajax_autocompleter new value selected, we trigger change also on original component so on field #search_'.$htmlname.'");
|
||||
|
||||
$("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code.
|
||||
}
|
||||
|
||||
@ -356,7 +356,8 @@ function dol_stringtotime($string, $gm = 1)
|
||||
}
|
||||
|
||||
|
||||
/** Return previous day
|
||||
/**
|
||||
* Return previous day
|
||||
*
|
||||
* @param int $day Day
|
||||
* @param int $month Month
|
||||
@ -371,7 +372,8 @@ function dol_get_prev_day($day, $month, $year)
|
||||
return array('year' => $tmparray['year'], 'month' => $tmparray['mon'], 'day' => $tmparray['mday']);
|
||||
}
|
||||
|
||||
/** Return next day
|
||||
/**
|
||||
* Return next day
|
||||
*
|
||||
* @param int $day Day
|
||||
* @param int $month Month
|
||||
@ -386,7 +388,8 @@ function dol_get_next_day($day, $month, $year)
|
||||
return array('year' => $tmparray['year'], 'month' => $tmparray['mon'], 'day' => $tmparray['mday']);
|
||||
}
|
||||
|
||||
/** Return previous month
|
||||
/**
|
||||
* Return previous month
|
||||
*
|
||||
* @param int $month Month
|
||||
* @param int $year Year
|
||||
@ -405,7 +408,8 @@ function dol_get_prev_month($month, $year)
|
||||
return array('year' => $prev_year, 'month' => $prev_month);
|
||||
}
|
||||
|
||||
/** Return next month
|
||||
/**
|
||||
* Return next month
|
||||
*
|
||||
* @param int $month Month
|
||||
* @param int $year Year
|
||||
@ -424,7 +428,8 @@ function dol_get_next_month($month, $year)
|
||||
return array('year' => $next_year, 'month' => $next_month);
|
||||
}
|
||||
|
||||
/** Return previous week
|
||||
/**
|
||||
* Return previous week
|
||||
*
|
||||
* @param int $day Day
|
||||
* @param int $week Week
|
||||
@ -442,7 +447,8 @@ function dol_get_prev_week($day, $week, $month, $year)
|
||||
return array('year' => $tmparray['year'], 'month' => $tmparray['mon'], 'day' => $tmparray['mday']);
|
||||
}
|
||||
|
||||
/** Return next week
|
||||
/**
|
||||
* Return next week
|
||||
*
|
||||
* @param int $day Day
|
||||
* @param int $week Week
|
||||
@ -461,7 +467,8 @@ function dol_get_next_week($day, $week, $month, $year)
|
||||
return array('year' => $tmparray['year'], 'month' => $tmparray['mon'], 'day' => $tmparray['mday']);
|
||||
}
|
||||
|
||||
/** Return GMT time for first day of a month or year
|
||||
/**
|
||||
* Return GMT time for first day of a month or year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $month Month
|
||||
@ -478,7 +485,9 @@ function dol_get_first_day($year, $month = 1, $gm = false)
|
||||
}
|
||||
|
||||
|
||||
/** Return GMT time for last day of a month or year
|
||||
/**
|
||||
* Return GMT time for last day of a month or year.
|
||||
* Note: The timestamp contains last day and last hours (23:59:59)
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $month Month
|
||||
@ -504,7 +513,8 @@ function dol_get_last_day($year, $month = 12, $gm = false)
|
||||
return $datelim;
|
||||
}
|
||||
|
||||
/** Return GMT time for last hour of a given GMT date (it removes hours, min and second part)
|
||||
/**
|
||||
* Return GMT time for last hour of a given GMT date (it removes hours, min and second part)
|
||||
*
|
||||
* @param int $date Date
|
||||
* @return int Date for last hour of a given date
|
||||
@ -515,7 +525,8 @@ function dol_get_last_hour($date)
|
||||
return dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], false);
|
||||
}
|
||||
|
||||
/** Return GMT time for first hour of a given GMT date (it removes hours, min and second part)
|
||||
/**
|
||||
* Return GMT time for first hour of a given GMT date (it removes hours, min and second part)
|
||||
*
|
||||
* @param int $date Date
|
||||
* @return int Date for last hour of a given date
|
||||
|
||||
@ -1513,6 +1513,7 @@ function dol_init_file_process($pathtoscan = '', $trackid = '')
|
||||
* @param int $generatethumbs 1=Generate also thumbs for uploaded image files
|
||||
* @param Object $object Object used to set 'src_object_*' fields
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @see dol_remove_file_process()
|
||||
*/
|
||||
function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesession = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null)
|
||||
{
|
||||
@ -1673,6 +1674,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
|
||||
* @param int $donotdeletefile 1=Do not delete physically file
|
||||
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict)
|
||||
* @return void
|
||||
* @see dol_add_file_process()
|
||||
*/
|
||||
function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletefile = 1, $trackid = '')
|
||||
{
|
||||
|
||||
@ -1984,7 +1984,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($tzoutput == 'auto') {
|
||||
if ($tzoutput === 'auto') {
|
||||
$tzoutput = (empty($conf) ? 'tzserver' : $conf->tzuserinputkey);
|
||||
}
|
||||
|
||||
@ -2209,9 +2209,10 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto',
|
||||
{
|
||||
global $conf;
|
||||
//print "- ".$hour.",".$minute.",".$second.",".$month.",".$day.",".$year.",".$_SERVER["WINDIR"]." -";
|
||||
//print 'gm:'.$gm.' gm==auto:'.($gm == 'auto').'<br>';
|
||||
|
||||
if ($gm == 'auto') {
|
||||
$gm = $conf->tzuserinputkey;
|
||||
if ($gm === 'auto') {
|
||||
$gm = (empty($conf) ? 'tzserver' : $conf->tzuserinputkey);
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
@ -2273,7 +2274,7 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto',
|
||||
/**
|
||||
* Return date for now. In most cases, we use this function without parameters (that means GMT time).
|
||||
*
|
||||
* @param string $mode 'auto'
|
||||
* @param string $mode 'auto' => for backward compatibility (avoid this),
|
||||
* 'gmt' => we return GMT timestamp,
|
||||
* 'tzserver' => we add the PHP server timezone
|
||||
* 'tzref' => we add the company timezone. Not implemented.
|
||||
@ -2284,8 +2285,8 @@ function dol_now($mode = 'auto')
|
||||
{
|
||||
$ret = 0;
|
||||
|
||||
if ($mode == 'auto') {
|
||||
$mode = 'tzserver';
|
||||
if ($mode === 'auto') {
|
||||
$mode = 'gmt';
|
||||
}
|
||||
|
||||
if ($mode == 'gmt') $ret = time(); // Time for now at greenwich.
|
||||
@ -3279,7 +3280,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'object_recruitmentjobposition', 'object_recruitmentcandidature',
|
||||
'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock',
|
||||
'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member',
|
||||
'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website',
|
||||
'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'object_movement',
|
||||
'off', 'on', 'order',
|
||||
'paiment', 'play', 'pdf', 'playdisabled', 'previous', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip',
|
||||
'setup', 'share-alt', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
|
||||
@ -3316,7 +3317,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle',
|
||||
'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group',
|
||||
'member'=>'users', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
|
||||
'trip'=>'wallet', 'group'=>'users',
|
||||
'trip'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
|
||||
'sign-out'=>'sign-out-alt',
|
||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
||||
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
||||
@ -3405,7 +3406,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'companies'=>'#6c6aa8', 'company'=>'#6c6aa8', 'contact'=>'#6c6aa8', 'dynamicprice'=>'#a69944',
|
||||
'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'help'=>'#bbb', 'listlight'=>'#999',
|
||||
'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944',
|
||||
'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944',
|
||||
'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944',
|
||||
'other'=>'#ddd',
|
||||
'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba',
|
||||
'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa',
|
||||
@ -5652,7 +5653,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
|
||||
$arrayforoldpath = array('cheque', 'category', 'holiday', 'supplier_invoice', 'invoice_supplier', 'mailing', 'supplier_payment');
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[] = 'product';
|
||||
if (!empty($level) && in_array($modulepart, $arrayforoldpath)) {
|
||||
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided.
|
||||
// This part should be removed once all code is using "get_exdir" to forge path, with parameter $object and $modulepart provided.
|
||||
if (empty($alpha)) $num = preg_replace('/([^0-9])/i', '', $num);
|
||||
else $num = preg_replace('/^.*\-/i', '', $num);
|
||||
$num = substr("000".$num, -$level);
|
||||
@ -5785,8 +5786,8 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
|
||||
// Example of $temp: <a href="/myurl" title="<u>A title</u>">0000-021</a>
|
||||
$temp = preg_replace($pattern, "", $temp); // pass 1 - $temp after pass 1: <a href="/myurl" title="A title">0000-021
|
||||
$temp = preg_replace($pattern, "", $temp); // pass 2 - $temp after pass 2: 0000-021
|
||||
// removed '<' into non closing html tags like '<a'
|
||||
$temp = preg_replace('/<(\w+)/', '\1', $temp);
|
||||
// Remove '<' into remainging, so non closing html tags like '<abc'. Note: '<123abc' is not a html tag (can be kept), but '<abc123' is (must be removed).
|
||||
$temp = preg_replace('/<([a-z]+)/i', '\1', $temp);
|
||||
}
|
||||
|
||||
$temp = dol_html_entity_decode($temp, ENT_COMPAT, $pagecodeto);
|
||||
@ -7391,6 +7392,7 @@ function picto_from_langcode($codelang, $moreatt = '')
|
||||
'da_DA' => 'dk',
|
||||
'fr_CA' => 'mq',
|
||||
'sv_SV' => 'se',
|
||||
'sw_SW' => 'unknown',
|
||||
'AQ' => 'unknown',
|
||||
'CW' => 'unknown',
|
||||
'IM' => 'unknown',
|
||||
|
||||
@ -315,7 +315,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
if ($usetable) print '</td><td>';
|
||||
else print ': ';
|
||||
print dol_print_date($object->date_validation, 'dayhour', 'tzserver');
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_validation, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_validation, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||
if ($usetable) print '</td></tr>';
|
||||
else print '<br>';
|
||||
}
|
||||
@ -349,7 +349,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
if ($usetable) print '</td><td>';
|
||||
else print ': ';
|
||||
print dol_print_date($object->date_approve, 'dayhour', 'tzserver');
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_approve, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_approve, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||
if ($usetable) print '</td></tr>';
|
||||
else print '<br>';
|
||||
}
|
||||
@ -377,7 +377,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
if ($usetable) print '</td><td>';
|
||||
else print ': ';
|
||||
print dol_print_date($object->date_approve2, 'dayhour', 'tzserver');
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_approve2, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_approve2, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||
if ($usetable) print '</td></tr>';
|
||||
else print '<br>';
|
||||
}
|
||||
@ -413,7 +413,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
if ($usetable) print '</td><td>';
|
||||
else print ': ';
|
||||
print dol_print_date($object->date_closing, 'dayhour', 'tzserver');
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_closing, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_closing, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||
if ($usetable) print '</td></tr>';
|
||||
else print '<br>';
|
||||
}
|
||||
@ -447,7 +447,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
if ($usetable) print '</td><td>';
|
||||
else print ': ';
|
||||
print dol_print_date($object->date_rappro, 'dayhour', 'tzserver');
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_rappro, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||
if ($usetable) print '</td></tr>';
|
||||
else print '<br>';
|
||||
}
|
||||
@ -460,7 +460,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
if ($usetable) print '</td><td>';
|
||||
else print ': ';
|
||||
print dol_print_date($object->date_envoi, 'dayhour', 'tzserver');
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_envoi, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_envoi, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||
if ($usetable) print '</td></tr>';
|
||||
else print '<br>';
|
||||
}
|
||||
|
||||
@ -51,6 +51,11 @@ function holiday_prepare_head($object)
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/holiday/info.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
|
||||
@ -43,7 +43,11 @@ function import_prepare_head($param, $maxstep = 0)
|
||||
$i = 1;
|
||||
while ($i <= $maxstep)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param;
|
||||
if ($i < 6) {
|
||||
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param;
|
||||
} else {
|
||||
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=5'.$param; // For step6, link is to step 5
|
||||
}
|
||||
$head[$h][1] = $langs->trans("Step")." ".$i;
|
||||
$head[$h][2] = 'step'.$i;
|
||||
$h++;
|
||||
|
||||
@ -2183,7 +2183,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
||||
$sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
|
||||
$sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
|
||||
$sql2 .= " WHERE p.rowid IN (".join(',', $arrayidofprojects).")";
|
||||
$sql2 .= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, s.nom, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_percent, p.opp_amount, p.dateo, p.datee";
|
||||
$sql2 .= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur,";
|
||||
$sql2 .= " s.logo, s.email, s.entity, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_percent, p.opp_amount, p.dateo, p.datee";
|
||||
$sql2 .= " ORDER BY p.title, p.ref";
|
||||
|
||||
$resql = $db->query($sql2);
|
||||
|
||||
@ -444,7 +444,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
|
||||
$checksoc = array('societe'); // Test for societe object
|
||||
$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
|
||||
$checktask = array('projet_task');
|
||||
$checktask = array('projet_task'); // Test for task object
|
||||
$nocheck = array('barcode', 'stock'); // No test
|
||||
//$checkdefault = 'all other not already defined'; // Test on entity and link to third party. Not allowed if link is empty (Ex: invoice, orders...).
|
||||
|
||||
@ -582,29 +582,35 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
|
||||
$sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
|
||||
$sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
||||
}
|
||||
} elseif (!in_array($feature, $nocheck)) // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield
|
||||
{
|
||||
} elseif (!in_array($feature, $nocheck)) { // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield
|
||||
// If external user: Check permission for external users
|
||||
if ($user->socid > 0)
|
||||
{
|
||||
if ($user->socid > 0) {
|
||||
if (empty($dbt_keyfield)) dol_print_error('', 'Param dbt_keyfield is required but not defined');
|
||||
$sql = "SELECT COUNT(dbt.".$dbt_keyfield.") as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
|
||||
$sql .= " WHERE dbt.rowid IN (".$objectid.")";
|
||||
$sql .= " AND dbt.".$dbt_keyfield." = ".$user->socid;
|
||||
} // If internal user: Check permission for internal users that are restricted on their objects
|
||||
elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && !$user->rights->societe->client->voir))
|
||||
{
|
||||
if (empty($dbt_keyfield)) dol_print_error('', 'Param dbt_keyfield is required but not defined');
|
||||
$sql = "SELECT COUNT(sc.fk_soc) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
|
||||
$sql .= " AND sc.fk_soc = dbt.".$dbt_keyfield;
|
||||
$sql .= " AND dbt.".$dbt_keyfield." = s.rowid";
|
||||
$sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
||||
$sql .= " AND sc.fk_user = ".$user->id;
|
||||
} elseif (!empty($conf->societe->enabled)) {
|
||||
// If internal user: Check permission for internal users that are restricted on their objects
|
||||
if ($feature != 'ticket' && !$user->rights->societe->client->voir) {
|
||||
if (empty($dbt_keyfield)) dol_print_error('', 'Param dbt_keyfield is required but not defined');
|
||||
$sql = "SELECT COUNT(sc.fk_soc) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
|
||||
$sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
||||
$sql .= " AND sc.fk_soc = dbt.".$dbt_keyfield;
|
||||
$sql .= " AND sc.fk_user = ".$user->id;
|
||||
}
|
||||
// On ticket, the thirdparty is not mandatory, so we need a special test to accept record with no thirdparties.
|
||||
if ($feature == 'ticket' && !$user->rights->societe->client->voir) {
|
||||
$sql = "SELECT COUNT(dbt.".$dbt_select.") as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = dbt.".$dbt_keyfield." AND sc.fk_user = ".$user->id;
|
||||
$sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
|
||||
$sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
||||
$sql .= " AND (sc.fk_user = ".$user->id." OR sc.fk_user IS NULL)";
|
||||
}
|
||||
} // If multicompany and internal users with all permissions, check user is in correct entity
|
||||
elseif (!empty($conf->multicompany->enabled))
|
||||
{
|
||||
|
||||
@ -283,7 +283,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
$out = '';
|
||||
$histo = array();
|
||||
$numaction = 0;
|
||||
$now = dol_now('tzuser');
|
||||
$now = dol_now();
|
||||
|
||||
// Open DSI -- Fix order by -- Begin
|
||||
$sortfield_list = explode(',', $sortfield);
|
||||
@ -622,7 +622,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
$out .= '<!-- timeline time label -->';
|
||||
$out .= '<li class="time-label">';
|
||||
$out .= '<span class="timeline-badge-date">';
|
||||
$out .= dol_print_date($histo[$key]['datestart'], 'daytext', 'tzserver', $langs);
|
||||
$out .= dol_print_date($histo[$key]['datestart'], 'daytext', 'tzuserrel', $langs);
|
||||
$out .= '</span>';
|
||||
$out .= '</li>';
|
||||
$out .= '<!-- /.timeline-label -->';
|
||||
@ -660,14 +660,14 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
$out .= '</span>';
|
||||
// Date
|
||||
$out .= '<span class="time"><i class="fa fa-clock-o"></i> ';
|
||||
$out .= dol_print_date($histo[$key]['datestart'], 'dayhour');
|
||||
$out .= dol_print_date($histo[$key]['datestart'], 'dayhour', 'tzuserrel');
|
||||
if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart']) {
|
||||
$tmpa = dol_getdate($histo[$key]['datestart'], true);
|
||||
$tmpb = dol_getdate($histo[$key]['dateend'], true);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) {
|
||||
$out .= '-'.dol_print_date($histo[$key]['dateend'], 'hour');
|
||||
$out .= '-'.dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel');
|
||||
} else {
|
||||
$out .= '-'.dol_print_date($histo[$key]['dateend'], 'dayhour');
|
||||
$out .= '-'.dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel');
|
||||
}
|
||||
}
|
||||
$late = 0;
|
||||
|
||||
@ -198,8 +198,8 @@ class MenuManager
|
||||
$submenu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1);
|
||||
$submenu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1);
|
||||
|
||||
$submenu->add("/admin/boxes.php", $langs->trans("Boxes"), 1);
|
||||
$submenu->add("/admin/delais.php", $langs->trans("Alerts"), 1);
|
||||
$submenu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"), 1);
|
||||
$submenu->add("/admin/delais.php?mainmenu=home", $langs->trans("Alerts"), 1);
|
||||
$submenu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"), 1);
|
||||
$submenu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1);
|
||||
$submenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
||||
@ -340,8 +340,8 @@ class MenuManager
|
||||
$this->menu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1);
|
||||
$this->menu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1);
|
||||
|
||||
$this->menu->add("/admin/boxes.php", $langs->trans("Boxes"), 1);
|
||||
$this->menu->add("/admin/delais.php", $langs->trans("Alerts"), 1);
|
||||
$this->menu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"), 1);
|
||||
$this->menu->add("/admin/delais.php?mainmenu=home", $langs->trans("Alerts"), 1);
|
||||
$this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"), 1);
|
||||
$this->menu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1);
|
||||
$this->menu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/modules/export/export_excel2007new.modules.php
|
||||
* \file htdocs/core/modules/export/export_excel2007.modules.php
|
||||
* \ingroup export
|
||||
* \brief File of class to generate export file with Excel format
|
||||
*/
|
||||
@ -32,7 +32,7 @@ use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
/**
|
||||
* Class to build export files with Excel format
|
||||
*/
|
||||
class ExportExcel2007new extends ModeleExports
|
||||
class ExportExcel2007 extends ModeleExports
|
||||
{
|
||||
/**
|
||||
* @var string ID
|
||||
@ -79,7 +79,7 @@ class ExportExcel2007new extends ModeleExports
|
||||
global $conf, $langs;
|
||||
$this->db = $db;
|
||||
|
||||
$this->id = 'excel2007new'; // Same value then xxx in file name export_xxx.modules.php
|
||||
$this->id = 'excel2007'; // Same value then xxx in file name export_xxx.modules.php
|
||||
$this->label = 'Excel 2007'; // Label of driver
|
||||
$this->desc = $langs->trans('Excel2007FormatDesc');
|
||||
$this->extension = 'xlsx'; // Extension for generated file by this driver
|
||||
@ -199,7 +199,7 @@ class ExportExcel2007new extends ModeleExports
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/Psr/autoloader.php';
|
||||
require_once PHPEXCELNEW_PATH.'Spreadsheet.php';
|
||||
|
||||
if ($this->id == 'excel2007new')
|
||||
if ($this->id == 'excel2007')
|
||||
{
|
||||
if (!class_exists('ZipArchive')) // For Excel2007, PHPSpreadSheet may need ZipArchive
|
||||
{
|
||||
@ -618,6 +618,7 @@ class ImportCsv extends ModeleImports
|
||||
if (!empty($objimport->array_import_regex[0][$val]) && ($newval != ''))
|
||||
{
|
||||
// If test is "Must exist in a field@table or field@table:..."
|
||||
$reg = array();
|
||||
if (preg_match('/^(.+)@([^:]+)(:.+)?$/', $objimport->array_import_regex[0][$val], $reg))
|
||||
{
|
||||
$field = $reg[1];
|
||||
@ -844,7 +845,7 @@ class ImportCsv extends ModeleImports
|
||||
$sqlend .= ', '.$user->id;
|
||||
}
|
||||
$sql = $sqlstart.$sqlend.')';
|
||||
dol_syslog("import_csv.modules", LOG_DEBUG);
|
||||
//dol_syslog("import_csv.modules", LOG_DEBUG);
|
||||
|
||||
// Run insert request
|
||||
if ($sql)
|
||||
|
||||
@ -636,6 +636,7 @@ class ImportXlsx extends ModeleImports
|
||||
// Test regexp
|
||||
if (!empty($objimport->array_import_regex[0][$val]) && ($newval != '')) {
|
||||
// If test is "Must exist in a field@table or field@table:..."
|
||||
$reg = array();
|
||||
if (preg_match('/^(.+)@([^:]+)(:.+)?$/', $objimport->array_import_regex[0][$val], $reg)) {
|
||||
$field = $reg[1];
|
||||
$table = $reg[2];
|
||||
@ -845,7 +846,7 @@ class ImportXlsx extends ModeleImports
|
||||
$sqlend .= ', ' . $user->id;
|
||||
}
|
||||
$sql = $sqlstart . $sqlend . ')';
|
||||
dol_syslog("import_xlsx.modules", LOG_DEBUG);
|
||||
//dol_syslog("import_xlsx.modules", LOG_DEBUG);
|
||||
|
||||
// Run insert request
|
||||
if ($sql) {
|
||||
|
||||
@ -271,7 +271,7 @@ class modCommande extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->import_code[$r] = 'commande_'.$r;
|
||||
$this->import_label[$r] = 'Sales Orders';
|
||||
$this->import_label[$r] = 'CustomersOrders';
|
||||
$this->import_icon[$r] = $this->picto;
|
||||
$this->import_entities_array[$r] = [];
|
||||
$this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX.'commande', 'extra' => MAIN_DB_PREFIX.'commande_extrafields'];
|
||||
@ -357,7 +357,7 @@ class modCommande extends DolibarrModules
|
||||
//Import CPV Lines
|
||||
$r++;
|
||||
$this->import_code[$r] = 'commande_lines_'.$r;
|
||||
$this->import_label[$r] = 'Order Details';
|
||||
$this->import_label[$r] = 'OrderLine';
|
||||
$this->import_icon[$r] = $this->picto;
|
||||
$this->import_entities_array[$r] = [];
|
||||
$this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX.'commandedet', 'extra' => MAIN_DB_PREFIX.'commandedet_extrafields'];
|
||||
|
||||
@ -177,6 +177,7 @@ class modTicket extends DolibarrModules
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||
$this->rights[$r][4] = 'manage';
|
||||
|
||||
/* Seems not used and in conflict with societe->client->voir (see all thirdparties)
|
||||
$r++;
|
||||
$this->rights[$r][0] = 56005; // id de la permission
|
||||
$this->rights[$r][1] = 'See all tickets, even if not assigned to (not effective for external users, always restricted to the thirdpardy they depends on)'; // libelle de la permission
|
||||
@ -184,6 +185,7 @@ class modTicket extends DolibarrModules
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||
$this->rights[$r][4] = 'view';
|
||||
$this->rights[$r][5] = 'all';
|
||||
*/
|
||||
|
||||
// Main menu entries
|
||||
$this->menus = array(); // List of menus to add
|
||||
|
||||
@ -321,24 +321,6 @@ class pdf_standardlabel extends CommonStickerGenerator
|
||||
if (!empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
// Output to http stream
|
||||
clearstatcache();
|
||||
|
||||
$attachment = true;
|
||||
if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment = false;
|
||||
$type = dol_mimetype($filename);
|
||||
|
||||
//if ($encoding) header('Content-Encoding: '.$encoding);
|
||||
if ($type) header('Content-Type: '.$type);
|
||||
if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
else header('Content-Disposition: inline; filename="'.$filename.'"');
|
||||
|
||||
// Ajout directives pour resoudre bug IE
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
header('Pragma: public');
|
||||
|
||||
readfile($file);
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
|
||||
return 1;
|
||||
|
||||
@ -359,23 +359,6 @@ class pdf_tcpdflabel extends CommonStickerGenerator
|
||||
if (!empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
// Output to http stream
|
||||
clearstatcache();
|
||||
|
||||
$attachment = true;
|
||||
if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment = false;
|
||||
$type = dol_mimetype($filename);
|
||||
|
||||
//if ($encoding) header('Content-Encoding: '.$encoding);
|
||||
if ($type) header('Content-Type: '.$type);
|
||||
if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
else header('Content-Disposition: inline; filename="'.$filename.'"');
|
||||
|
||||
// Ajout directives pour resoudre bug IE
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
header('Pragma: public');
|
||||
|
||||
readfile($file);
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
|
||||
|
||||
@ -150,6 +150,27 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp
|
||||
if ($obj->write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir, $filename) > 0)
|
||||
{
|
||||
$outputlangs->charset_output = $sav_charset_output;
|
||||
|
||||
$fullpath = $obj->result['fullpath'];
|
||||
|
||||
// Output to http stream
|
||||
clearstatcache();
|
||||
|
||||
$attachment = true;
|
||||
if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment = false;
|
||||
$type = dol_mimetype($filename);
|
||||
|
||||
//if ($encoding) header('Content-Encoding: '.$encoding);
|
||||
if ($type) header('Content-Type: '.$type);
|
||||
if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
else header('Content-Disposition: inline; filename="'.$filename.'"');
|
||||
|
||||
// Ajout directives pour resoudre bug IE
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
header('Pragma: public');
|
||||
|
||||
readfile($fullpath);
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
$outputlangs->charset_output = $sav_charset_output;
|
||||
|
||||
@ -243,7 +243,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
|
||||
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
|
||||
} else {
|
||||
$pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default
|
||||
$pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
|
||||
$pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
|
||||
}
|
||||
|
||||
|
||||
@ -242,7 +242,7 @@ class pdf_cyan extends ModelePDFPropales
|
||||
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
|
||||
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
|
||||
} else {
|
||||
$pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default
|
||||
$pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
|
||||
$pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
|
||||
}
|
||||
|
||||
|
||||
@ -748,7 +748,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
|
||||
// Payed
|
||||
// Paid
|
||||
$thirdparty = $object->thirdparty;
|
||||
|
||||
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
@ -214,8 +214,7 @@ if ($nolinesbefore) {
|
||||
if (empty($senderissupplier))
|
||||
{
|
||||
$statustoshow = 1;
|
||||
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS))
|
||||
{
|
||||
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
|
||||
} else {
|
||||
|
||||
@ -65,6 +65,7 @@ if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FA
|
||||
} else {
|
||||
print $langs->trans('VAT');
|
||||
}
|
||||
|
||||
if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT)
|
||||
{
|
||||
global $mysoc;
|
||||
|
||||
@ -184,7 +184,7 @@ if ($resql)
|
||||
print '<td class="right">'.price($objp->d_amount).'</td>';
|
||||
// Status
|
||||
print '<td class="center">'.$don->getLibStatut(4, $objp->amount).'</td>';
|
||||
// Amount payed
|
||||
// Amount paid
|
||||
print '<td class="right">'.price($objp->amount).'</td>';
|
||||
print "</tr>\n";
|
||||
if ($objp->paid == 1) {
|
||||
|
||||
@ -211,8 +211,9 @@ $helpurl = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Ex
|
||||
llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,";
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number,";
|
||||
$sql .= " l.date_delivery as date_reception,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
@ -242,11 +243,12 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid =
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target";
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON e.fk_user_author = u.rowid';
|
||||
|
||||
if ($search_user > 0) { // Get link to order to get the order id in eesource.fk_source
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
|
||||
}
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if ($search_user > 0)
|
||||
{
|
||||
if ($search_user > 0) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
}
|
||||
@ -274,6 +276,11 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
|
||||
if ($search_tracking) $sql .= natural_search("e.tracking_number", $search_tracking);
|
||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
|
||||
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
|
||||
if ($search_user > 0)
|
||||
{
|
||||
// The contact on a shipment is also the contact of the order.
|
||||
$sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = eesource.fk_source AND ec.fk_socpeople = ".$db->escape($search_user);
|
||||
}
|
||||
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
|
||||
if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
|
||||
@ -976,34 +976,6 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_unpaid' && $id > 0 && $user->rights->expensereport->to_paid)
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
|
||||
$result = $object->set_unpaid($user);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||
if (!empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$model = $object->model_pdf;
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
@ -1492,8 +1464,7 @@ if ($action == 'create')
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
if ($id > 0 || $ref)
|
||||
{
|
||||
if ($id > 0 || $ref) {
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
||||
$res = $object->fetch_optionals();
|
||||
@ -1755,6 +1726,7 @@ if ($action == 'create')
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Period
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("Period").'</td>';
|
||||
print '<td>';
|
||||
@ -1772,9 +1744,9 @@ if ($action == 'create')
|
||||
// Validation date
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DATE_SAVE").'</td>';
|
||||
print '<td>'.dol_print_date($object->date_valid, 'dayhour');
|
||||
if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late"));
|
||||
if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late"));
|
||||
print '<td>'.dol_print_date($object->date_valid, 'dayhour', 'tzuser');
|
||||
if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove"));
|
||||
if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay"));
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
@ -1815,7 +1787,7 @@ if ($action == 'create')
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DATE_CANCEL").'</td>';
|
||||
print '<td>'.dol_print_date($object->date_cancel, 'dayhour').'</td></tr>';
|
||||
print '<td>'.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').'</td></tr>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr>';
|
||||
@ -1831,7 +1803,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DateApprove").'</td>';
|
||||
print '<td>'.dol_print_date($object->date_approve, 'dayhour').'</td></tr>';
|
||||
print '<td>'.dol_print_date($object->date_approve, 'dayhour', 'tzuser').'</td></tr>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -1847,7 +1819,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DATE_REFUS").'</td>';
|
||||
print '<td>'.dol_print_date($object->date_refuse, 'dayhour');
|
||||
print '<td>'.dol_print_date($object->date_refuse, 'dayhour', 'tzuser');
|
||||
if ($object->detail_refuse) print ' - '.$object->detail_refuse;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -66,14 +66,14 @@ class ExpenseReport extends CommonObject
|
||||
public $date_fin;
|
||||
|
||||
/**
|
||||
* 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
|
||||
* 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=paid, 99=denied
|
||||
*
|
||||
* @var int Status
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
|
||||
* 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=paid, 99=denied
|
||||
*
|
||||
* @var int Status
|
||||
* @deprecated
|
||||
@ -256,6 +256,7 @@ class ExpenseReport extends CommonObject
|
||||
$sql .= ",date_debut";
|
||||
$sql .= ",date_fin";
|
||||
$sql .= ",date_create";
|
||||
$sql .= ",fk_user_creat";
|
||||
$sql .= ",fk_user_author";
|
||||
$sql .= ",fk_user_validator";
|
||||
$sql .= ",fk_user_approve";
|
||||
@ -274,6 +275,7 @@ class ExpenseReport extends CommonObject
|
||||
$sql .= ", '".$this->db->idate($this->date_debut)."'";
|
||||
$sql .= ", '".$this->db->idate($this->date_fin)."'";
|
||||
$sql .= ", '".$this->db->idate($now)."'";
|
||||
$sql .= ", ".$user->id;
|
||||
$sql .= ", ".$fuserid;
|
||||
$sql .= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator : "null");
|
||||
$sql .= ", ".($this->fk_user_approve > 0 ? $this->fk_user_approve : "null");
|
||||
@ -419,6 +421,7 @@ class ExpenseReport extends CommonObject
|
||||
$this->fk_statut = 0; // deprecated
|
||||
|
||||
// Clear fields
|
||||
$this->fk_user_creat = $user->id;
|
||||
$this->fk_user_author = $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
|
||||
$this->fk_user_valid = '';
|
||||
$this->date_create = '';
|
||||
@ -548,7 +551,7 @@ class ExpenseReport extends CommonObject
|
||||
$sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS
|
||||
$sql .= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int)
|
||||
$sql .= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve,"; // DATES (datetime)
|
||||
$sql .= " d.fk_user_author, d.fk_user_modif, d.fk_user_validator,";
|
||||
$sql .= " d.fk_user_creat, d.fk_user_author, d.fk_user_modif, d.fk_user_validator,";
|
||||
$sql .= " d.fk_user_valid, d.fk_user_approve,";
|
||||
$sql .= " d.fk_statut as status, d.fk_c_paiement, d.paid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d";
|
||||
@ -585,6 +588,7 @@ class ExpenseReport extends CommonObject
|
||||
$this->date_refuse = $this->db->jdate($obj->date_refuse);
|
||||
$this->date_cancel = $this->db->jdate($obj->date_cancel);
|
||||
|
||||
$this->fk_user_creat = $obj->fk_user_creat;
|
||||
$this->fk_user_author = $obj->fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
|
||||
$this->fk_user_modif = $obj->fk_user_modif;
|
||||
$this->fk_user_validator = $obj->fk_user_validator;
|
||||
@ -733,7 +737,7 @@ class ExpenseReport extends CommonObject
|
||||
$sql .= " f.tms as date_modification,";
|
||||
$sql .= " f.date_valid as datev,";
|
||||
$sql .= " f.date_approve as datea,";
|
||||
//$sql.= " f.fk_user_author as fk_user_creation,"; // This is not user of creation but user the expense is for.
|
||||
$sql .= " f.fk_user_creat as fk_user_creation,";
|
||||
$sql .= " f.fk_user_modif as fk_user_modification,";
|
||||
$sql .= " f.fk_user_valid,";
|
||||
$sql .= " f.fk_user_approve";
|
||||
@ -2319,7 +2323,7 @@ class ExpenseReport extends CommonObject
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$ret[$obj->code] = (($langs->trans($obj->code) != $obj->code) ? $langs->trans($obj->code) : $obj->label);
|
||||
$ret[$obj->code] = (($langs->transnoentitiesnoconv($obj->code) != $obj->code) ? $langs->transnoentitiesnoconv($obj->code) : $obj->label);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
@ -2454,10 +2458,11 @@ class ExpenseReport extends CommonObject
|
||||
if ($option == 'topay' && $this->status != 5) return false;
|
||||
|
||||
$now = dol_now();
|
||||
if ($option == 'toapprove')
|
||||
{
|
||||
if ($option == 'toapprove') {
|
||||
return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay);
|
||||
} else return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay);
|
||||
} else {
|
||||
return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -270,11 +270,12 @@ if ($step == 1 || $action == 'cleanselect')
|
||||
|
||||
if ($action == 'builddoc')
|
||||
{
|
||||
$max_execution_time_for_export = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
|
||||
$max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
|
||||
$max_time = @ini_get("max_execution_time");
|
||||
if ($max_time && $max_time < $max_execution_time_for_export)
|
||||
if ($max_time && $max_time < $max_execution_time_for_importexport)
|
||||
{
|
||||
@ini_set("max_execution_time", $max_execution_time_for_export); // This work only if safe mode is off. also web servers has timeout of 300
|
||||
dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically.");
|
||||
@ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300
|
||||
}
|
||||
|
||||
// Build export file
|
||||
|
||||
@ -217,8 +217,9 @@ if (empty($reshook))
|
||||
if (!empty($origin) && !empty($originid))
|
||||
{
|
||||
// Parse element/subelement (ex: project_task)
|
||||
$element = $subelement = $_POST['origin'];
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i', $_POST['origin'], $regs))
|
||||
$regs = array();
|
||||
$element = $subelement = GETPOST('origin', 'alphanohtml');
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin', 'alphanohtml'), $regs))
|
||||
{
|
||||
$element = $regs[1];
|
||||
$subelement = $regs[2];
|
||||
@ -246,7 +247,13 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Extrafields
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
$action = 'create';
|
||||
}
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element);
|
||||
|
||||
$object->array_options = $array_options;
|
||||
@ -472,8 +479,7 @@ if (empty($reshook))
|
||||
|
||||
$desc = GETPOST('np_desc', 'restricthtml');
|
||||
$date_intervention = dol_mktime(GETPOST('dihour', 'int'), GETPOST('dimin', 'int'), 0, GETPOST('dimonth', 'int'), GETPOST('diday', 'int'), GETPOST('diyear', 'int'));
|
||||
$duration = empty($conf->global->FICHINTER_WITHOUT_DURATION) ?convertTime2Seconds(GETPOST('durationhour', 'int'), GETPOST('durationmin', 'int')) : 0;
|
||||
|
||||
$duration = empty($conf->global->FICHINTER_WITHOUT_DURATION) ? convertTime2Seconds(GETPOST('durationhour', 'int'), GETPOST('durationmin', 'int')) : 0;
|
||||
|
||||
// Extrafields
|
||||
$extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
@ -1329,8 +1335,7 @@ if ($action == 'create')
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="addinter" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
if ($action == 'editline')
|
||||
{
|
||||
if ($action == 'editline') {
|
||||
print '<input type="hidden" name="action" value="updateline">';
|
||||
print '<input type="hidden" name="line_id" value="'.GETPOST('line_id', 'int').'">';
|
||||
} else {
|
||||
@ -1342,8 +1347,9 @@ if ($action == 'create')
|
||||
$sql .= ' ft.date as date_intervention';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
|
||||
$sql .= ' WHERE ft.fk_fichinter = '.$object->id;
|
||||
if (!empty($conf->global->FICHINTER_HIDE_EMPTY_DURATION))
|
||||
if (!empty($conf->global->FICHINTER_HIDE_EMPTY_DURATION)) {
|
||||
$sql .= ' AND ft.duree <> 0';
|
||||
}
|
||||
$sql .= ' ORDER BY ft.rang ASC, ft.date ASC, ft.rowid';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@ -1370,13 +1376,11 @@ if ($action == 'create')
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
// Ligne en mode visu
|
||||
if ($action != 'editline' || GETPOST('line_id', 'int') != $objp->rowid)
|
||||
{
|
||||
if ($action != 'editline' || GETPOST('line_id', 'int') != $objp->rowid) {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// No.
|
||||
@ -1396,8 +1400,7 @@ if ($action == 'create')
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
// Econ to edit and delete
|
||||
// Icon to edit and delete
|
||||
if ($object->statut == 0 && $user->rights->ficheinter->creer)
|
||||
{
|
||||
print '<td class="center">';
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
||||
if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
|
||||
if (!defined('EURO')) define('EURO', chr(128));
|
||||
|
||||
|
||||
@ -3132,13 +3132,12 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
|
||||
$ret = $supplierorderdispatch->fetchAll('', '', 0, 0, $filter);
|
||||
if ($ret < 0)
|
||||
{
|
||||
if ($ret < 0) {
|
||||
$this->error = $supplierorderdispatch->error; $this->errors = $supplierorderdispatch->errors;
|
||||
return $ret;
|
||||
} else {
|
||||
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines) > 0)
|
||||
{
|
||||
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines) > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$date_liv = dol_now();
|
||||
|
||||
// Build array with quantity deliverd by product
|
||||
@ -3146,13 +3145,17 @@ class CommandeFournisseur extends CommonOrder
|
||||
$qtydelivered[$line->fk_product] += $line->qty;
|
||||
}
|
||||
foreach ($this->lines as $line) {
|
||||
// Exclude lines not qualified for shipment, similar code is found into interface_20_modWrokflow for customers
|
||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $line->product_type > 0) continue;
|
||||
$qtywished[$line->fk_product] += $line->qty;
|
||||
}
|
||||
|
||||
//Compare array
|
||||
$diff_array = array_diff_assoc($qtydelivered, $qtywished); // Warning: $diff_array is done only on common keys.
|
||||
$keysinwishednotindelivered = array_diff(array_keys($qtywished), array_keys($qtydelivered)); // To check we also have same number of keys
|
||||
$keysindeliverednotinwished = array_diff(array_keys($qtydelivered), array_keys($qtywished)); // To check we also have same number of keys
|
||||
/*var_dump(array_keys($qtydelivered));
|
||||
|
||||
var_dump(array_keys($qtywished));
|
||||
var_dump($diff_array);
|
||||
var_dump($keysinwishednotindelivered);
|
||||
|
||||
@ -1248,7 +1248,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Tag invoice as a payed invoice
|
||||
* Tag invoice as a paid invoice
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet.
|
||||
|
||||
@ -229,7 +229,7 @@ class PaiementFourn extends Paiement
|
||||
$invoice = new FactureFournisseur($this->db);
|
||||
$invoice->fetch($facid);
|
||||
|
||||
// If we want to closed payed invoices
|
||||
// If we want to closed paid invoices
|
||||
if ($closepaidinvoices)
|
||||
{
|
||||
$paiement = $invoice->getSommePaiement();
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2019 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2021 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
|
||||
* Copyright (C) 2017-2020 Ferran Marcet <fmarcet@2byte.es>
|
||||
@ -228,6 +228,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
||||
foreach ($_POST as $key => $value)
|
||||
{
|
||||
// without batch module enabled
|
||||
$reg = array();
|
||||
if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg))
|
||||
{
|
||||
$pos++;
|
||||
@ -269,16 +270,20 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
||||
|
||||
if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
|
||||
if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int');
|
||||
$dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'), '');
|
||||
if (empty($dto)) {
|
||||
$dto = 0;
|
||||
}
|
||||
|
||||
//update supplier price
|
||||
if (GETPOSTISSET($saveprice)) {
|
||||
// TODO Use class
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
|
||||
$sql .= " SET unitprice='".GETPOST($pu)."'";
|
||||
$sql .= ", price=".GETPOST($pu)."*quantity";
|
||||
$sql .= ", remise_percent='".(!empty($dto) ? $dto : 0)."'";
|
||||
$sql .= " WHERE fk_soc=".$object->socid;
|
||||
$sql .= " AND fk_product=".GETPOST($prod, 'int');
|
||||
$sql .= " SET unitprice='".price2num(GETPOST($pu), 'MU')."'";
|
||||
$sql .= ", price=".price2num(GETPOST($pu), 'MU')."*quantity";
|
||||
$sql .= ", remise_percent = ".((float) $dto);
|
||||
$sql .= " WHERE fk_soc=".((int) $object->socid);
|
||||
$sql .= " AND fk_product=".((int) GETPOST($prod, 'int'));
|
||||
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
|
||||
@ -521,7 +521,7 @@ $help_url = '';
|
||||
// llxHeader('',$title,$help_url);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,';
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
|
||||
@ -489,7 +489,7 @@ if (empty($reshook))
|
||||
$result = $discountcheck->fetch(0, 0, $object->id);
|
||||
|
||||
$canconvert = 0;
|
||||
if ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discountcheck->id)) $canconvert = 1; // we can convert deposit into discount if deposit is payed (completely, partially or not at all) and not already converted (see real condition into condition used to show button converttoreduc)
|
||||
if ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discountcheck->id)) $canconvert = 1; // we can convert deposit into discount if deposit is paid (completely, partially or not at all) and not already converted (see real condition into condition used to show button converttoreduc)
|
||||
if (($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_STANDARD) && $object->paye == 0 && empty($discountcheck->id)) $canconvert = 1; // we can convert credit note into discount if credit note is not refunded completely and not already converted and amount of payment is 0 (see also the real condition used as the condition to show button converttoreduc)
|
||||
if ($canconvert)
|
||||
{
|
||||
@ -2095,7 +2095,7 @@ if ($action == 'create')
|
||||
{
|
||||
$langs->loadLangs(array("intracommreport"));
|
||||
print '<tr><td>'.$langs->trans('IntracommReportTransportMode').'</td><td>';
|
||||
$form->selectModeTransport(isset($_POST['transport_mode_id']) ? $_POST['transport_mode_id'] : $transport_mode_id, 'transport_mode_id');
|
||||
$form->selectTransportMode(isset($_POST['transport_mode_id']) ? $_POST['transport_mode_id'] : $transport_mode_id, 'transport_mode_id');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -497,7 +497,9 @@ if (!$search_all)
|
||||
$sql .= " GROUP BY f.rowid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement, f.fk_mode_reglement, f.fk_cond_reglement,";
|
||||
$sql .= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,";
|
||||
$sql .= " f.localtax1, f.localtax2,";
|
||||
$sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
|
||||
$sql .= " f.note_public, f.note_private,";
|
||||
$sql .= " f.fk_user_author,";
|
||||
$sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
|
||||
$sql .= " typent.code,";
|
||||
$sql .= " state.code_departement, state.nom,";
|
||||
|
||||
@ -511,7 +511,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if (empty($reshook))
|
||||
{
|
||||
/*
|
||||
* All unpayed supplier invoices
|
||||
* All unpaid supplier invoices
|
||||
*/
|
||||
$sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.type, f.total_ht, f.total_ttc,';
|
||||
$sql .= ' f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
|
||||
|
||||
@ -305,7 +305,7 @@ if ($result > 0)
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'), 'company').' '.$objp->name.'</a></td>';
|
||||
// Expected to pay
|
||||
print '<td class="right">'.price($objp->total_ttc).'</td>';
|
||||
// Payed
|
||||
// Paid
|
||||
print '<td class="right">'.price($objp->amount).'</td>';
|
||||
// Status
|
||||
print '<td class="right">'.$facturestatic->LibStatut($objp->paye, $objp->status, 6, 1).'</td>';
|
||||
|
||||
@ -1369,24 +1369,24 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateCreation').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_create, 'dayhour').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_create, 'dayhour', 'tzuser').'</td>';
|
||||
print '</tr>';
|
||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateValidCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_valid, 'dayhour').'</td>'; // warning: date_valid is approval date on holiday module
|
||||
print '<td>'.dol_print_date($object->date_valid, 'dayhour', 'tzuser').'</td>'; // warning: date_valid is approval date on holiday module
|
||||
print '</tr>';
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_CANCELED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateCancelCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_cancel, 'dayhour').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_REFUSED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateRefusCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_refuse, 'dayhour').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_refuse, 'dayhour', 'tzuser').'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</tbody>';
|
||||
|
||||
@ -2073,6 +2073,81 @@ class Holiday extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load information on object
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @return void
|
||||
*/
|
||||
public function info($id)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT f.rowid,";
|
||||
$sql .= " f.date_create as datec,";
|
||||
$sql .= " f.tms as date_modification,";
|
||||
$sql .= " f.date_valid as datev,";
|
||||
//$sql .= " f.date_approve as datea,";
|
||||
$sql .= " f.date_refuse as dater,";
|
||||
$sql .= " f.fk_user_create as fk_user_creation,";
|
||||
$sql .= " f.fk_user_modif as fk_user_modification,";
|
||||
$sql .= " f.fk_user_valid,";
|
||||
$sql .= " f.fk_validator as fk_user_approve,";
|
||||
$sql .= " f.fk_user_refuse as fk_user_refuse";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as f";
|
||||
$sql .= " WHERE f.rowid = ".$id;
|
||||
$sql .= " AND f.entity = ".$conf->entity;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
|
||||
$this->date_creation = $this->db->jdate($obj->datec);
|
||||
$this->date_modification = $this->db->jdate($obj->date_modification);
|
||||
$this->date_validation = $this->db->jdate($obj->datev);
|
||||
$this->date_approbation = $this->db->jdate($obj->datea);
|
||||
|
||||
$cuser = new User($this->db);
|
||||
$cuser->fetch($obj->fk_user_author);
|
||||
$this->user_creation = $cuser;
|
||||
|
||||
if ($obj->fk_user_creation)
|
||||
{
|
||||
$cuser = new User($this->db);
|
||||
$cuser->fetch($obj->fk_user_creation);
|
||||
$this->user_creation = $cuser;
|
||||
}
|
||||
if ($obj->fk_user_valid)
|
||||
{
|
||||
$vuser = new User($this->db);
|
||||
$vuser->fetch($obj->fk_user_valid);
|
||||
$this->user_validation = $vuser;
|
||||
}
|
||||
if ($obj->fk_user_modification)
|
||||
{
|
||||
$muser = new User($this->db);
|
||||
$muser->fetch($obj->fk_user_modification);
|
||||
$this->user_modification = $muser;
|
||||
}
|
||||
if ($obj->fk_user_approve)
|
||||
{
|
||||
$auser = new User($this->db);
|
||||
$auser->fetch($obj->fk_user_approve);
|
||||
$this->user_approve = $auser;
|
||||
}
|
||||
}
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialise an instance with random values.
|
||||
* Used to build previews or test instances.
|
||||
|
||||
106
htdocs/holiday/info.php
Normal file
106
htdocs/holiday/info.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* or see https://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/holiday/info.php
|
||||
* \ingroup holiday
|
||||
* \brief Page to show a leave information
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("holiday");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
$childids = $user->getAllChildIds(1);
|
||||
|
||||
// Security check
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
$result = restrictedArea($user, 'holiday', $id, 'holiday');
|
||||
|
||||
$object = new Holiday($db);
|
||||
if (!$object->fetch($id, $ref) > 0)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if ($object->id > 0)
|
||||
{
|
||||
// Check current user can read this expense report
|
||||
$canread = 0;
|
||||
if (!empty($user->rights->holiday->readall)) $canread = 1;
|
||||
if (!empty($user->rights->holiday->lire) && in_array($object->fk_user_author, $childids)) $canread = 1;
|
||||
if (!$canread)
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans("Holiday")." - ".$langs->trans("Info");
|
||||
$helpurl = "";
|
||||
llxHeader("", $title, $helpurl);
|
||||
|
||||
if ($id > 0 || !empty($ref))
|
||||
{
|
||||
$object = new Holiday($db);
|
||||
$object->fetch($id, $ref);
|
||||
$object->info($object->id);
|
||||
|
||||
$head = holiday_prepare_head($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'info', $langs->trans("Holiday"), -1, 'holiday');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/holiday/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
dol_print_object_info($object);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -1255,6 +1255,14 @@ if ($step == 4 && $datatoimport)
|
||||
// STEP 5: Summary of choices and launch simulation
|
||||
if ($step == 5 && $datatoimport)
|
||||
{
|
||||
$max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined
|
||||
$max_time = @ini_get("max_execution_time");
|
||||
if ($max_time && $max_time < $max_execution_time_for_importexport)
|
||||
{
|
||||
dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically.");
|
||||
@ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300
|
||||
}
|
||||
|
||||
$model = $format;
|
||||
$liste = $objmodelimport->liste_modeles($db);
|
||||
|
||||
@ -1595,8 +1603,10 @@ if ($step == 5 && $datatoimport)
|
||||
// Show OK
|
||||
if (!count($arrayoferrors) && !count($arrayofwarnings)) {
|
||||
print '<div class="center">'.img_picto($langs->trans("OK"), 'tick').' <b>'.$langs->trans("NoError").'</b></div><br><br>';
|
||||
print $langs->trans("NbInsert", $obj->nbinsert).'<br>';
|
||||
print $langs->trans("NbUpdate", $obj->nbupdate).'<br><br>';
|
||||
print '<div class="ok">';
|
||||
print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'<br>';
|
||||
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br><br>';
|
||||
print '</div>';
|
||||
} else print $langs->trans("NbOfLinesOK", $nbok).'<br><br>';
|
||||
|
||||
// Show Errors
|
||||
@ -1684,9 +1694,17 @@ if ($step == 5 && $datatoimport)
|
||||
// STEP 6: Real import
|
||||
if ($step == 6 && $datatoimport)
|
||||
{
|
||||
$max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined
|
||||
$max_time = @ini_get("max_execution_time");
|
||||
if ($max_time && $max_time < $max_execution_time_for_importexport)
|
||||
{
|
||||
dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically.");
|
||||
@ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300
|
||||
}
|
||||
|
||||
$model = $format;
|
||||
$liste = $objmodelimport->liste_modeles($db);
|
||||
$importid = $_REQUEST["importid"];
|
||||
$importid = GETPOST("importid", 'alphanohtml');
|
||||
|
||||
|
||||
// Create classe to use for import
|
||||
@ -1962,12 +1980,14 @@ if ($step == 6 && $datatoimport)
|
||||
|
||||
// Show result
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<div class="ok">';
|
||||
print $langs->trans("NbOfLinesImported", $nbok).'</b><br>';
|
||||
print $langs->trans("NbInsert", $obj->nbinsert).'<br>';
|
||||
print $langs->trans("NbUpdate", $obj->nbupdate).'<br><br>';
|
||||
print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'<br>';
|
||||
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br><br>';
|
||||
print '</div>';
|
||||
print '<div class="center">';
|
||||
print $langs->trans("FileWasImported", $importid).'<br>';
|
||||
print $langs->trans("YouCanUseImportIdToFindRecord", $importid).'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("YouCanUseImportIdToFindRecord", $importid).'</span><br>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -136,9 +136,8 @@ class Odf
|
||||
// instead of {aaa} so we should enhance this function.
|
||||
//print $key.'-'.$value.'-'.strpos($this->contentXml, $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT']).'<br>';
|
||||
if (strpos($this->contentXml, $tag) === false && strpos($this->stylesXml, $tag) === false) {
|
||||
//if (strpos($this->contentXml, '">'. $key . '</text;span>') === false) {
|
||||
throw new OdfException("var $key not found in the document");
|
||||
//}
|
||||
// Add the throw only for development. In most cases, it is normal to not having the key into the document (only few keys are presents).
|
||||
//throw new OdfException("var $key not found in the document");
|
||||
}
|
||||
|
||||
$this->vars[$tag] = $this->convertVarToOdf($value, $encode, $charset);
|
||||
|
||||
@ -101,8 +101,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAYED','Expense report billed','Executed when an expense report is set as billed','expensereport',204);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',211);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',212);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141);
|
||||
|
||||
@ -123,6 +123,7 @@ CREATE TABLE llx_c_transport_mode (
|
||||
label varchar(255) NOT NULL,
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
) ENGINE=innodb;
|
||||
ALTER TABLE llx_c_transport_mode ADD UNIQUE INDEX uk_c_transport_mode (code, entity);
|
||||
|
||||
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('MAR', 'Transport maritime (y compris camions ou wagons sur bateau)', 1);
|
||||
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('TRA', 'Transport par chemin de fer (y compris camions sur wagon)', 1);
|
||||
@ -415,8 +416,10 @@ ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);
|
||||
|
||||
DELETE FROM llx_const WHERE name in ('MAIN_INCLUDE_ZERO_VAT_IN_REPORTS');
|
||||
|
||||
UPDATE llx_projet_task_time SET tms = null WHERE tms = 0;
|
||||
ALTER TABLE llx_projet_task_time MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
-- VMYSQL4.1 UPDATE llx_projet_task_time SET tms = null WHERE tms = 0;
|
||||
|
||||
ALTER TABLE llx_projet_task_time CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
ALTER TABLE llx_projet_task_time MODIFY COLUMN datec datetime;
|
||||
|
||||
@ -432,12 +435,19 @@ CREATE TABLE llx_c_product_nature (
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_c_product_nature ADD UNIQUE INDEX uk_c_product_nature(code, active);
|
||||
|
||||
ALTER TABLE llx_product DROP FOREIGN KEY fk_product_finished;
|
||||
|
||||
-- VMYSQL4.1 DROP INDEX uk_c_product_nature on llx_c_product_nature;
|
||||
-- VPGSQL8.2 DROP INDEX uk_c_product_nature;
|
||||
|
||||
ALTER TABLE llx_c_product_nature ADD UNIQUE INDEX uk_c_product_nature(code);
|
||||
|
||||
INSERT INTO llx_c_product_nature (code, label, active) VALUES (0, 'RowMaterial', 1);
|
||||
INSERT INTO llx_c_product_nature (code, label, active) VALUES (1, 'Finished', 1);
|
||||
|
||||
ALTER TABLE llx_product MODIFY COLUMN finished tinyint DEFAULT NULL;
|
||||
|
||||
ALTER TABLE llx_product ADD CONSTRAINT fk_product_finished FOREIGN KEY (finished) REFERENCES llx_c_product_nature (code);
|
||||
|
||||
-- MIGRATION TO DO AFTER RENAMING AN OBJECT
|
||||
@ -555,3 +565,12 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
||||
|
||||
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
||||
|
||||
UPDATE llx_c_action_trigger SET elementtype = 'expensereport' where elementtype = 'expense_report' AND code like 'EXPENSE_%';
|
||||
UPDATE llx_c_action_trigger SET code = 'EXPENSE_REPORT_PAID' where code = 'EXPENSE_REPORT_PAYED';
|
||||
UPDATE llx_c_action_trigger SET code = 'EXPENSE_REPORT_DELETE' where code = 'EXPENSE_DELETE';
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user