Merge branch 'develop' of github.com:OPEN-DSI/dolibarr into new-propal-signature-date-and-user
This commit is contained in:
commit
d0ce60ff49
@ -582,6 +582,10 @@ if ($resql) {
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($num == 0) {
|
||||||
|
print '<tr><td colspan="'.$totalarray['nbfield'].'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -496,11 +496,14 @@ while ($i < min($num, $limit)) {
|
|||||||
$adherent->morphy = $obj->morphy;
|
$adherent->morphy = $obj->morphy;
|
||||||
$adherent->email = $obj->email;
|
$adherent->email = $obj->email;
|
||||||
$adherent->typeid = $obj->type;
|
$adherent->typeid = $obj->type;
|
||||||
|
$adherent->datefin = $db->jdate($obj->datef);
|
||||||
|
|
||||||
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
|
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
|
||||||
$adht = new AdherentType($db);
|
$adht = new AdherentType($db);
|
||||||
$adht->fetch($typeid);
|
$adht->fetch($typeid);
|
||||||
|
|
||||||
|
$adherent->need_subscription = $adht->subscription;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
|
|||||||
@ -93,7 +93,7 @@ print '<br>';
|
|||||||
|
|
||||||
// Show info setup module
|
// Show info setup module
|
||||||
print img_picto('', 'cog', 'class="paddingright"').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules"));
|
print img_picto('', 'cog', 'class="paddingright"').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules"));
|
||||||
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only user module enabled
|
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$warnpicto = img_warning($langs->trans("WarningEnableYourModulesApplications"), 'style="padding-right: 6px;"');
|
$warnpicto = img_warning($langs->trans("WarningEnableYourModulesApplications"), 'style="padding-right: 6px;"');
|
||||||
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans("WarningEnableYourModulesApplications").'</a></div>';
|
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.$langs->trans("WarningEnableYourModulesApplications").'</a></div>';
|
||||||
|
|||||||
@ -463,11 +463,13 @@ asort($orders);
|
|||||||
//var_dump($modules);
|
//var_dump($modules);
|
||||||
|
|
||||||
$nbofactivatedmodules = count($conf->modules);
|
$nbofactivatedmodules = count($conf->modules);
|
||||||
$moreinfo = $langs->trans("TitleNumberOfActivatedModules");
|
|
||||||
|
//$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING = 1000;
|
||||||
|
/*$moreinfo = $langs->trans("TitleNumberOfActivatedModules");
|
||||||
$moreinfo2 = '<b class="largenumber">'.($nbofactivatedmodules - 1).'</b> / <b class="largenumber">'.count($modules).'</b>';
|
$moreinfo2 = '<b class="largenumber">'.($nbofactivatedmodules - 1).'</b> / <b class="largenumber">'.count($modules).'</b>';
|
||||||
if ($nbofactivatedmodules <= 1) {
|
if ($nbofactivatedmodules <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) {
|
||||||
$moreinfo2 .= ' '.img_warning($langs->trans("YouMustEnableOneModule"));
|
$moreinfo2 .= ' '.img_warning($langs->trans("YouMustEnableOneModule"));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
|
||||||
|
|
||||||
@ -476,7 +478,9 @@ $deschelp = '';
|
|||||||
if ($mode == 'common' || $mode == 'commonkanban') {
|
if ($mode == 'common' || $mode == 'commonkanban') {
|
||||||
$desc = $langs->trans("ModulesDesc", '{picto}');
|
$desc = $langs->trans("ModulesDesc", '{picto}');
|
||||||
$desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc);
|
$desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc);
|
||||||
$deschelp = '<div class="info hideonsmartphone">'.$desc."<br></div><br>\n";
|
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled
|
||||||
|
$deschelp = '<div class="info hideonsmartphone">'.$desc."<br></div><br>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($mode == 'marketplace') {
|
if ($mode == 'marketplace') {
|
||||||
//$deschelp = '<div class="info hideonsmartphone">'.$langs->trans("ModulesMarketPlaceDesc")."<br></div><br>\n";
|
//$deschelp = '<div class="info hideonsmartphone">'.$langs->trans("ModulesMarketPlaceDesc")."<br></div><br>\n";
|
||||||
@ -488,7 +492,7 @@ if ($mode == 'develop') {
|
|||||||
$deschelp = '<div class="info hideonsmartphone">'.$langs->trans("ModulesDevelopDesc")."<br></div><br>\n";
|
$deschelp = '<div class="info hideonsmartphone">'.$langs->trans("ModulesDevelopDesc")."<br></div><br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$head = modules_prepare_head();
|
$head = modules_prepare_head($nbofactivatedmodules, count($modules));
|
||||||
|
|
||||||
|
|
||||||
if ($mode == 'common' || $mode == 'commonkanban') {
|
if ($mode == 'common' || $mode == 'commonkanban') {
|
||||||
@ -521,7 +525,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'commonkanban' ? '' : ' btnTitleSelected')));
|
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'commonkanban' ? '' : ' btnTitleSelected')));
|
||||||
$moreforfilter .= '</li></ul></div>';
|
$moreforfilter .= '</li></ul></div>';
|
||||||
|
|
||||||
$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="paddingright">'.$moreinfo.'</span> '.$moreinfo2.'</div>';
|
//$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="paddingright">'.$moreinfo.'</span> '.$moreinfo2.'</div>';
|
||||||
|
|
||||||
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
|
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
|
||||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||||
|
|||||||
@ -1,216 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
|
||||||
* Copyright (C) 2016 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/>.
|
|
||||||
*
|
|
||||||
* @deprecated Old explorer. Not using Swagger. See instead explorer in htdocs/api/index.php.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \defgroup api Module DolibarrApi
|
|
||||||
* \brief API loader
|
|
||||||
* Search files htdocs/<module>/class/api_<module>.class.php
|
|
||||||
* \file htdocs/api/admin/explorer.php
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Luracast\Restler\Routes;
|
|
||||||
|
|
||||||
require_once '../../main.inc.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/api/class/api_access.class.php';
|
|
||||||
|
|
||||||
// Load translation files required by the page
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* View
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Enable and test if module Api is enabled
|
|
||||||
if (empty($conf->global->MAIN_MODULE_API)) {
|
|
||||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
|
||||||
print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';
|
|
||||||
print $langs->trans("ToActivateModule");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$api = new DolibarrApi($db);
|
|
||||||
|
|
||||||
$api->r->addAPIClass('Luracast\\Restler\\Resources'); //this creates resources.json at API Root
|
|
||||||
$api->r->setSupportedFormats('JsonFormat', 'XmlFormat');
|
|
||||||
$api->r->addAuthenticationClass('DolibarrApiAccess', '');
|
|
||||||
|
|
||||||
$listofapis = array();
|
|
||||||
|
|
||||||
$modulesdir = dolGetModulesDirs();
|
|
||||||
foreach ($modulesdir as $dir) {
|
|
||||||
/*
|
|
||||||
* Search available module
|
|
||||||
*/
|
|
||||||
//dol_syslog("Scan directory ".$dir." for API modules");
|
|
||||||
|
|
||||||
$handle = @opendir(dol_osencode($dir));
|
|
||||||
if (is_resource($handle)) {
|
|
||||||
while (($file = readdir($handle)) !== false) {
|
|
||||||
if (is_readable($dir.$file) && preg_match("/^(mod.*)\.class\.php$/i", $file, $reg)) {
|
|
||||||
$modulename = $reg[1];
|
|
||||||
|
|
||||||
// Defined if module is enabled
|
|
||||||
$enabled = true;
|
|
||||||
$module = $part = $obj = strtolower(preg_replace('/^mod/i', '', $modulename));
|
|
||||||
//if ($part == 'propale') $part='propal';
|
|
||||||
if ($module == 'societe') {
|
|
||||||
$obj = 'thirdparty';
|
|
||||||
}
|
|
||||||
if ($module == 'categorie') {
|
|
||||||
$part = 'categories';
|
|
||||||
$obj = 'category';
|
|
||||||
}
|
|
||||||
if ($module == 'facture') {
|
|
||||||
$part = 'compta/facture';
|
|
||||||
$obj = 'facture';
|
|
||||||
}
|
|
||||||
if ($module == 'ficheinter') {
|
|
||||||
$obj = 'fichinter';
|
|
||||||
$part = 'fichinter';
|
|
||||||
$module = 'fichinter';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($conf->$module->enabled)) {
|
|
||||||
$enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($enabled) {
|
|
||||||
/*
|
|
||||||
* If exists, load the API class for enable module
|
|
||||||
*
|
|
||||||
* Search files named api_<object>.class.php into /htdocs/<module>/class directory
|
|
||||||
*
|
|
||||||
* @todo : take care of externals module!
|
|
||||||
* @todo : use getElementProperties() function ?
|
|
||||||
*/
|
|
||||||
$dir_part = DOL_DOCUMENT_ROOT.'/'.$part.'/class/';
|
|
||||||
|
|
||||||
$handle_part = @opendir(dol_osencode($dir_part));
|
|
||||||
if (is_resource($handle_part)) {
|
|
||||||
while (($file_searched = readdir($handle_part)) !== false) {
|
|
||||||
if (is_readable($dir_part.$file_searched) && preg_match("/^api_(.*)\.class\.php$/i", $file_searched, $reg)) {
|
|
||||||
$classname = ucwords($reg[1]);
|
|
||||||
require_once $dir_part.$file_searched;
|
|
||||||
if (class_exists($classname)) {
|
|
||||||
dol_syslog("Found API classname=".$classname." into ".$dir);
|
|
||||||
$listofapis[] = $classname;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (is_readable($dir_part.$file_searched) && preg_match("/^(api_.*)\.class\.php$/i",$file_searched,$reg))
|
|
||||||
{
|
|
||||||
$classname=$reg[1];
|
|
||||||
$classname = str_replace('Api_','',ucwords($reg[1])).'Api';
|
|
||||||
//$classname = str_replace('Api_','',ucwords($reg[1]));
|
|
||||||
$classname = ucfirst($classname);
|
|
||||||
require_once $dir_part.$file_searched;
|
|
||||||
|
|
||||||
// if (class_exists($classname))
|
|
||||||
// {
|
|
||||||
// dol_syslog("Found API classname=".$classname);
|
|
||||||
// $api->r->addAPIClass($classname,'');
|
|
||||||
|
|
||||||
// require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Routes.php';
|
|
||||||
// $tmpclass = new ReflectionClass($classname);
|
|
||||||
// try {
|
|
||||||
// $classMetadata = CommentParser::parse($tmpclass->getDocComment());
|
|
||||||
// } catch (Exception $e) {
|
|
||||||
// throw new RestException(500, "Error while parsing comments of `$classname` class. " . $e->getMessage());
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched);
|
|
||||||
// }
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//var_dump($listofapis);
|
|
||||||
$listofapis = Routes::toArray(); // @todo api for "status" is lost here
|
|
||||||
//var_dump($listofapis);
|
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
|
||||||
print load_fiche_titre($langs->trans("ApiSetup"), $linkback, 'title_setup');
|
|
||||||
|
|
||||||
// Define $urlwithroot
|
|
||||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
|
||||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
|
||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
|
||||||
|
|
||||||
// Show message
|
|
||||||
print '<br>';
|
|
||||||
$message = '';
|
|
||||||
$url = '<a href="'.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword" target="_blank">'.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword[&reset=1]</a>';
|
|
||||||
$message .= $langs->trans("UrlToGetKeyToUseAPIs").':<br>';
|
|
||||||
$message .= img_picto('', 'globe').' '.$url;
|
|
||||||
print $message;
|
|
||||||
print '<br>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
$oldclass = '';
|
|
||||||
|
|
||||||
print $langs->trans("ListOfAvailableAPIs").':<br>';
|
|
||||||
foreach ($listofapis['v1'] as $key => $val) {
|
|
||||||
if ($key == 'login') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($key == 'index') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($key) {
|
|
||||||
foreach ($val as $method => $val2) {
|
|
||||||
$newclass = $val2['className'];
|
|
||||||
|
|
||||||
if (preg_match('/restler/i', $newclass)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($oldclass != $newclass) {
|
|
||||||
print "\n<br>\n".$langs->trans("Class").': '.$newclass.'<br>'."\n";
|
|
||||||
$oldclass = $newclass;
|
|
||||||
}
|
|
||||||
//print $key.' - '.$val['classname'].' - '.$val['fullpath']." - ".DOL_MAIN_URL_ROOT.'/api/index.php/'.strtolower(preg_replace('/Api$/','',$val['classname']))."/xxx<br>\n";
|
|
||||||
$url = $urlwithroot.'/api/index.php/'.$key;
|
|
||||||
$url .= '?api_key=token';
|
|
||||||
print img_picto('', 'globe').' '.$method.' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
print '<br>';
|
|
||||||
print $langs->trans("OnlyActiveElementsAreExposed", DOL_URL_ROOT.'/admin/modules.php');
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
|
||||||
$db->close();
|
|
||||||
87
htdocs/api/admin/explorer_withredoc.php
Normal file
87
htdocs/api/admin/explorer_withredoc.php
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
* Copyright (C) 2016 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/>.
|
||||||
|
*
|
||||||
|
* @deprecated Old explorer. Not using Swagger. See instead explorer in htdocs/api/index.php.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \defgroup api Module DolibarrApi
|
||||||
|
* \brief API explorer using the swagger.json file
|
||||||
|
* \file htdocs/api/admin/explorer_withredoc.php
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once '../../main.inc.php';
|
||||||
|
|
||||||
|
// Enable and test if module Api is enabled
|
||||||
|
if (empty($conf->global->MAIN_MODULE_API)) {
|
||||||
|
$langs->load("admin");
|
||||||
|
dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled");
|
||||||
|
print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';
|
||||||
|
print $langs->trans("ToActivateModule");
|
||||||
|
//session_destroy();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test if explorer is not disabled
|
||||||
|
if (!empty($conf->global->API_EXPLORER_DISABLED)) {
|
||||||
|
$langs->load("admin");
|
||||||
|
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||||
|
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
||||||
|
//session_destroy();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restrict API to some IPs
|
||||||
|
if (!empty($conf->global->API_RESTRICT_ON_IP)) {
|
||||||
|
$allowedip = explode(' ', $conf->global->API_RESTRICT_ON_IP);
|
||||||
|
$ipremote = getUserRemoteIP();
|
||||||
|
if (!in_array($ipremote, $allowedip)) {
|
||||||
|
dol_syslog('Remote ip is '.$ipremote.', not into list '.$conf->global->API_RESTRICT_ON_IP);
|
||||||
|
print 'APIs are not allowed from the IP '.$ipremote;
|
||||||
|
header('HTTP/1.1 503 API not allowed from your IP '.$ipremote);
|
||||||
|
//session_destroy();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ReDoc</title>
|
||||||
|
<!-- needed for adaptive design -->
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
ReDoc doesn't change outer page styles
|
||||||
|
-->
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<redoc spec-url='<?php echo DOL_MAIN_URL_ROOT.'/api/index.php/explorer/swagger.json?DOLAPIKEY='.GETPOST('DOLAPIKEY', 'aZ09'); ?>'></redoc>
|
||||||
|
<!--<redoc spec-url='https://demo.dolibarr.org/api/index.php/explorer/swagger.json'></redoc>-->
|
||||||
|
<!--<redoc spec-url='http://petstore.swagger.io/v2/swagger.json'></redoc>-->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -139,18 +139,25 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
|
|||||||
|
|
||||||
// Show message
|
// Show message
|
||||||
$message = '';
|
$message = '';
|
||||||
$url = $urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
|
//$url = $urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
|
||||||
|
$url = $urlwithroot.'/api/index.php/login?login=auserlogin&password=thepassword[&reset=1]';
|
||||||
$message .= '<span class="opacitymedium">'.$langs->trans("UrlToGetKeyToUseAPIs").':</span><br>';
|
$message .= '<span class="opacitymedium">'.$langs->trans("UrlToGetKeyToUseAPIs").':</span><br>';
|
||||||
$message .= img_picto('', 'globe').' '.$url;
|
$message .= '<div class="urllink soixantepercent">'.img_picto('', 'globe').' <input type="text" class="quatrevingtpercent" id="urltogettoken" value="'.$url.'"></div>';
|
||||||
print $message;
|
print $message;
|
||||||
|
print ajax_autoselect("urltogettoken");
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Explorer
|
// Explorer
|
||||||
print '<u>'.$langs->trans("ApiExporerIs").':</u><br>';
|
print '<span class="opacitymedium">'.$langs->trans("ApiExporerIs").':</span><br>';
|
||||||
if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/explorer')) {
|
if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/explorer')) {
|
||||||
$url = DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
|
$url = DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
|
||||||
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print '<div class="urllink soixantepercent">'.img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a></div><br>\n";
|
||||||
|
print '<div class="opacitymediumxxx"><br><span class="opacitymedium">'.$langs->trans("SwaggerDescriptionFile").':</span><br>';
|
||||||
|
$urlswagger = DOL_MAIN_URL_ROOT.'/api/index.php/explorer/swagger.json?DOLAPIKEY=youruserapikey';
|
||||||
|
//$urlswaggerreal = DOL_MAIN_URL_ROOT.'/api/index.php/explorer/swagger.json?DOLAPIKEY='.$user->api_key;
|
||||||
|
print '<div class="urllink soixantepercent">'.img_picto('', 'globe').' <a href="'.$urlswagger.'" target="_blank">'.$urlswagger."</a></div><br>\n";
|
||||||
|
print '</div>';
|
||||||
} else {
|
} else {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print info_admin($langs->trans("ErrorNotAvailableWithThisDistribution"), 0, 0, 'error');
|
print info_admin($langs->trans("ErrorNotAvailableWithThisDistribution"), 0, 0, 'error');
|
||||||
|
|||||||
@ -55,6 +55,12 @@ if (!empty($_SERVER['HTTP_DOLAPIENTITY'])) {
|
|||||||
define("DOLENTITY", (int) $_SERVER['HTTP_DOLAPIENTITY']);
|
define("DOLENTITY", (int) $_SERVER['HTTP_DOLAPIENTITY']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When we request url to get the json file, we accept Cross site so we can include the descriptor into an external tool.
|
||||||
|
if (preg_match('/\/explorer\/swagger\.json/', $_SERVER["PHP_SELF"])) {
|
||||||
|
header('Access-Control-Allow-Origin: *');
|
||||||
|
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
|
||||||
|
header('Access-Control-Allow-Headers: Content-Type, Authorization, api_key, DOLAPIKEY');
|
||||||
|
}
|
||||||
|
|
||||||
$res = 0;
|
$res = 0;
|
||||||
if (!$res && file_exists("../main.inc.php")) {
|
if (!$res && file_exists("../main.inc.php")) {
|
||||||
@ -89,7 +95,7 @@ if (!empty($conf->global->MAIN_NGINX_FIX)) {
|
|||||||
// Enable and test if module Api is enabled
|
// Enable and test if module Api is enabled
|
||||||
if (empty($conf->global->MAIN_MODULE_API)) {
|
if (empty($conf->global->MAIN_MODULE_API)) {
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled");
|
||||||
print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';
|
print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';
|
||||||
print $langs->trans("ToActivateModule");
|
print $langs->trans("ToActivateModule");
|
||||||
//session_destroy();
|
//session_destroy();
|
||||||
|
|||||||
@ -1532,7 +1532,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['p.total_ht']['checked'])) {
|
if (!empty($arrayfields['p.total_ht']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($obj->total_ht)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1543,7 +1543,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['p.total_tva']['checked'])) {
|
if (!empty($arrayfields['p.total_tva']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($obj->total_tva)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($obj->total_tva)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1554,7 +1554,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['p.total_ttc']['checked'])) {
|
if (!empty($arrayfields['p.total_ttc']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($obj->total_ttc)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1563,9 +1563,9 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
$totalarray['val']['p.total_ttc'] += $obj->total_ttc;
|
$totalarray['val']['p.total_ttc'] += $obj->total_ttc;
|
||||||
}
|
}
|
||||||
// Amount invoiced
|
// Amount invoiced HT
|
||||||
if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) {
|
if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($totalInvoicedHT)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($totalInvoicedHT)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1574,9 +1574,9 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
$totalarray['val']['p.total_ht_invoiced'] += $totalInvoicedHT;
|
$totalarray['val']['p.total_ht_invoiced'] += $totalInvoicedHT;
|
||||||
}
|
}
|
||||||
// Amount invoiced
|
// Amount invoiced TTC
|
||||||
if (!empty($arrayfields['p.total_invoiced']['checked'])) {
|
if (!empty($arrayfields['p.total_invoiced']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($totalInvoicedTTC)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($totalInvoicedTTC)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1604,35 +1604,35 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) {
|
if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_ht)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) {
|
if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_tva)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) {
|
if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_ttc)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount invoiced
|
// Amount invoiced
|
||||||
if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) {
|
if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($multicurrency_totalInvoicedHT)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedHT)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount invoiced
|
// Amount invoiced
|
||||||
if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) {
|
if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($multicurrency_totalInvoicedTTC)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($multicurrency_totalInvoicedTTC)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1437,7 +1437,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['c.total_ht']['checked'])) {
|
if (!empty($arrayfields['c.total_ht']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($obj->total_ht)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1448,7 +1448,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['c.total_vat']['checked'])) {
|
if (!empty($arrayfields['c.total_vat']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($obj->total_tva)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($obj->total_tva)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1459,7 +1459,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['c.total_ttc']['checked'])) {
|
if (!empty($arrayfields['c.total_ttc']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($obj->total_ttc)."</td>\n";
|
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1488,21 +1488,21 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) {
|
if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_ht)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) {
|
if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_vat)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) {
|
if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_ttc)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -283,44 +283,42 @@ class Facture extends CommonInvoice
|
|||||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||||
*/
|
*/
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>1),
|
||||||
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>15),
|
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>5),
|
||||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
|
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
|
||||||
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>25),
|
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'Ref client', 'enabled'=>1, 'visible'=>-1, 'position'=>10),
|
||||||
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'Ref int', 'enabled'=>1, 'visible'=>0, 'position'=>30), // deprecated
|
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>12),
|
||||||
'type' =>array('type'=>'smallint(6)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35),
|
//'ref_int' =>array('type'=>'varchar(255)', 'label'=>'Ref int', 'enabled'=>1, 'visible'=>0, 'position'=>30), // deprecated
|
||||||
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'Ref client', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
|
'type' =>array('type'=>'smallint(6)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
|
||||||
//'increment' =>array('type'=>'varchar(10)', 'label'=>'Increment', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
|
//'increment' =>array('type'=>'varchar(10)', 'label'=>'Increment', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
|
||||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50),
|
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50),
|
||||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
|
'datef' =>array('type'=>'date', 'label'=>'DateInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
|
||||||
'datef' =>array('type'=>'date', 'label'=>'DateInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
|
'date_valid' =>array('type'=>'date', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>22),
|
||||||
'date_valid' =>array('type'=>'date', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
|
'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateDue', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
|
||||||
'date_closing' =>array('type'=>'datetime', 'label'=>'Date closing', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
|
'date_closing' =>array('type'=>'datetime', 'label'=>'Date closing', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
|
||||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>75),
|
|
||||||
'paye' =>array('type'=>'smallint(6)', 'label'=>'InvoicePaidCompletely', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>80),
|
'paye' =>array('type'=>'smallint(6)', 'label'=>'InvoicePaidCompletely', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>80),
|
||||||
//'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85),
|
//'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85),
|
||||||
'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
||||||
'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
|
'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>91),
|
||||||
//'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
|
//'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
|
||||||
'close_code' =>array('type'=>'varchar(16)', 'label'=>'EarlyClosingReason', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
|
'close_code' =>array('type'=>'varchar(16)', 'label'=>'EarlyClosingReason', 'enabled'=>1, 'visible'=>-1, 'position'=>92),
|
||||||
'close_note' =>array('type'=>'varchar(128)', 'label'=>'EarlyClosingComment', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
'close_note' =>array('type'=>'varchar(128)', 'label'=>'EarlyClosingComment', 'enabled'=>1, 'visible'=>-1, 'position'=>93),
|
||||||
'tva' =>array('type'=>'double(24,8)', 'label'=>'TotalVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>115, 'isameasure'=>1),
|
'total' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>-1, 'position'=>95, 'isameasure'=>1),
|
||||||
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LT1', 'enabled'=>1, 'visible'=>-1, 'position'=>120, 'isameasure'=>1),
|
'tva' =>array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>100, 'isameasure'=>1),
|
||||||
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>-1, 'position'=>125, 'isameasure'=>1),
|
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LT1', 'enabled'=>1, 'visible'=>-1, 'position'=>110, 'isameasure'=>1),
|
||||||
'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1),
|
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>-1, 'position'=>120, 'isameasure'=>1),
|
||||||
'total' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1),
|
'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>115, 'isameasure'=>1),
|
||||||
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1),
|
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'AmountTTC', 'enabled'=>1, 'visible'=>1, 'position'=>130, 'isameasure'=>1),
|
||||||
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>150),
|
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
|
||||||
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>155),
|
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>166),
|
||||||
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>160),
|
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>167),
|
||||||
'fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
|
'fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>168),
|
||||||
'fk_facture_source' =>array('type'=>'integer', 'label'=>'SourceInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
'fk_facture_source' =>array('type'=>'integer', 'label'=>'SourceInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||||
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
||||||
'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
||||||
'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'CurrencyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'CurrencyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
||||||
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>190),
|
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>190),
|
||||||
'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>195),
|
'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>195),
|
||||||
'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateDue', 'enabled'=>1, 'visible'=>-1, 'position'=>200),
|
|
||||||
'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>205),
|
'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>205),
|
||||||
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>210),
|
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>210),
|
||||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>215),
|
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>215),
|
||||||
@ -335,8 +333,8 @@ class Facture extends CommonInvoice
|
|||||||
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>265),
|
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>265),
|
||||||
'date_pointoftax' =>array('type'=>'date', 'label'=>'DatePointOfTax', 'enabled'=>'$conf->global->INVOICE_POINTOFTAX_DATE', 'visible'=>-1, 'position'=>270),
|
'date_pointoftax' =>array('type'=>'date', 'label'=>'DatePointOfTax', 'enabled'=>'$conf->global->INVOICE_POINTOFTAX_DATE', 'visible'=>-1, 'position'=>270),
|
||||||
'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>275),
|
'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>275),
|
||||||
'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>280),
|
'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>280),
|
||||||
'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>285, 'isameasure'=>1),
|
'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>285, 'isameasure'=>1),
|
||||||
'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>290, 'isameasure'=>1),
|
'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>290, 'isameasure'=>1),
|
||||||
'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>295, 'isameasure'=>1),
|
'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>295, 'isameasure'=>1),
|
||||||
'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>300, 'isameasure'=>1),
|
'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>300, 'isameasure'=>1),
|
||||||
@ -344,8 +342,10 @@ class Facture extends CommonInvoice
|
|||||||
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>310),
|
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>310),
|
||||||
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315),
|
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315),
|
||||||
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>320),
|
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>320),
|
||||||
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')),
|
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||||
|
'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||||
|
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')),
|
||||||
);
|
);
|
||||||
// END MODULEBUILDER PROPERTIES
|
// END MODULEBUILDER PROPERTIES
|
||||||
|
|
||||||
|
|||||||
@ -125,22 +125,22 @@ $permissiondellink = $user->rights->facture->creer; // Used by the include of ac
|
|||||||
$permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php
|
$permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php
|
||||||
|
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
'f.titre'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
'f.titre'=>array('label'=>"Ref", 'checked'=>1),
|
||||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||||
'f.total'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
|
'f.total'=>array('label'=>"AmountHT", 'checked'=>1),
|
||||||
'f.tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>1),
|
'f.tva'=>array('label'=>"AmountVAT", 'checked'=>1),
|
||||||
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1),
|
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>1),
|
||||||
'f.fk_mode_reglement'=>array('label'=>$langs->trans("PaymentMode"), 'checked'=>0),
|
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),
|
||||||
'f.fk_cond_reglement'=>array('label'=>$langs->trans("PaymentTerm"), 'checked'=>0),
|
'f.fk_cond_reglement'=>array('label'=>"PaymentTerm", 'checked'=>0),
|
||||||
'recurring'=>array('label'=>$langs->trans("RecurringInvoiceTemplate"), 'checked'=>1),
|
'recurring'=>array('label'=>"RecurringInvoiceTemplate", 'checked'=>1),
|
||||||
'f.frequency'=>array('label'=>$langs->trans("Frequency"), 'checked'=>1),
|
'f.frequency'=>array('label'=>"Frequency", 'checked'=>1),
|
||||||
'f.unit_frequency'=>array('label'=>$langs->trans("FrequencyUnit"), 'checked'=>1),
|
'f.unit_frequency'=>array('label'=>"FrequencyUnit", 'checked'=>1),
|
||||||
'f.nb_gen_done'=>array('label'=>$langs->trans("NbOfGenerationDoneShort"), 'checked'=>1),
|
'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1),
|
||||||
'f.date_last_gen'=>array('label'=>$langs->trans("DateLastGenerationShort"), 'checked'=>1),
|
'f.date_last_gen'=>array('label'=>"DateLastGenerationShort", 'checked'=>1),
|
||||||
'f.date_when'=>array('label'=>$langs->trans("NextDateToExecutionShort"), 'checked'=>1),
|
'f.date_when'=>array('label'=>"NextDateToExecutionShort", 'checked'=>1),
|
||||||
'status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>100),
|
'status'=>array('label'=>"Status", 'checked'=>1, 'position'=>100),
|
||||||
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||||
@ -655,7 +655,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['f.total']['checked'])) {
|
if (!empty($arrayfields['f.total']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($objp->total).'</td>'."\n";
|
print '<td class="nowrap right amount">'.price($objp->total).'</td>'."\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -665,7 +665,7 @@ if ($resql) {
|
|||||||
$totalarray['val']['f.total'] += $objp->total;
|
$totalarray['val']['f.total'] += $objp->total;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['f.tva']['checked'])) {
|
if (!empty($arrayfields['f.tva']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($objp->total_vat).'</td>'."\n";
|
print '<td class="nowrap right amount">'.price($objp->total_vat).'</td>'."\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -675,7 +675,7 @@ if ($resql) {
|
|||||||
$totalarray['val']['f.tva'] += $objp->total_vat;
|
$totalarray['val']['f.tva'] += $objp->total_vat;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['f.total_ttc']['checked'])) {
|
if (!empty($arrayfields['f.total_ttc']['checked'])) {
|
||||||
print '<td class="nowrap right">'.price($objp->total_ttc).'</td>'."\n";
|
print '<td class="nowrap right amount">'.price($objp->total_ttc).'</td>'."\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -189,33 +189,33 @@ $arrayfields = array(
|
|||||||
'f.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
|
'f.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
|
||||||
'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>-1, 'position'=>10),
|
'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>-1, 'position'=>10),
|
||||||
'f.type'=>array('label'=>"Type", 'checked'=>0, 'position'=>15),
|
'f.type'=>array('label'=>"Type", 'checked'=>0, 'position'=>15),
|
||||||
'f.date'=>array('label'=>"DateInvoice", 'checked'=>1, 'position'=>20),
|
'f.datef'=>array('label'=>"DateInvoice", 'checked'=>1, 'position'=>20),
|
||||||
'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22),
|
'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22),
|
||||||
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25),
|
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25),
|
||||||
'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30),
|
'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30),
|
||||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>40),
|
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>40),
|
||||||
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>40),
|
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>41),
|
||||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50),
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50),
|
||||||
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51),
|
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51),
|
||||||
's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>55),
|
's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55),
|
||||||
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>60),
|
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>60),
|
||||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>65),
|
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>65),
|
||||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>70),
|
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>70),
|
||||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75),
|
||||||
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80),
|
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80),
|
||||||
'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85),
|
'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85),
|
||||||
'f.module_source'=>array('label'=>"Module", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>90),
|
'f.module_source'=>array('label'=>"POSModule", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>90),
|
||||||
'f.pos_source'=>array('label'=>"Terminal", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>91),
|
'f.pos_source'=>array('label'=>"POSTerminal", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>91),
|
||||||
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95),
|
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95),
|
||||||
'f.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100),
|
'f.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100),
|
||||||
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>110),
|
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>110),
|
||||||
'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax2_assuj == "1"), 'position'=>120),
|
'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax2_assuj == "1"), 'position'=>120),
|
||||||
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130),
|
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130),
|
||||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>135),
|
|
||||||
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
|
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
|
||||||
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
|
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
|
||||||
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>160),
|
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165),
|
||||||
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>170),
|
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>170),
|
||||||
|
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>171),
|
||||||
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>180),
|
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>180),
|
||||||
'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>190),
|
'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>190),
|
||||||
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>200),
|
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>200),
|
||||||
@ -235,7 +235,24 @@ $arrayfields = array(
|
|||||||
if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY) {
|
if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY) {
|
||||||
$arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86);
|
$arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86);
|
||||||
}
|
}
|
||||||
|
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
|
||||||
|
foreach ($object->fields as $key => $val) {
|
||||||
|
// If $val['visible']==0, then we never show the field
|
||||||
|
if (!empty($val['visible'])) {
|
||||||
|
$visible = (int) dol_eval($val['visible'], 1);
|
||||||
|
$newkey = '';
|
||||||
|
if (array_key_exists($key, $arrayfields)) { $newkey = $key; } elseif (array_key_exists('t.'.$key, $arrayfields)) { $newkey = 't.'.$key; } elseif (array_key_exists('f.'.$key, $arrayfields)) { $newkey = 'f.'.$key; } elseif (array_key_exists('s.'.$key, $arrayfields)) { $newkey = 's.'.$key; }
|
||||||
|
if ($newkey) {
|
||||||
|
$arrayfields[$newkey] = array(
|
||||||
|
'label'=>$val['label'],
|
||||||
|
'checked'=>(($visible < 0) ? 0 : 1),
|
||||||
|
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
|
||||||
|
'position'=>$val['position'],
|
||||||
|
'help'=>$val['help']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||||
|
|
||||||
@ -434,7 +451,7 @@ $sql .= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_pub
|
|||||||
$sql .= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
|
$sql .= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
|
||||||
$sql .= ' f.fk_user_author,';
|
$sql .= ' f.fk_user_author,';
|
||||||
$sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva as multicurrency_total_vat, f.multicurrency_total_ttc,';
|
$sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva as multicurrency_total_vat, f.multicurrency_total_ttc,';
|
||||||
$sql .= ' f.datef as df, f.date_valid, f.date_lim_reglement as datelimite, f.module_source, f.pos_source,';
|
$sql .= ' f.datef, f.date_valid, f.date_lim_reglement as datelimite, f.module_source, f.pos_source,';
|
||||||
$sql .= ' f.paye as paye, f.fk_statut, f.close_code,';
|
$sql .= ' f.paye as paye, f.fk_statut, f.close_code,';
|
||||||
$sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,';
|
$sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,';
|
||||||
$sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,';
|
$sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,';
|
||||||
@ -942,31 +959,31 @@ if ($resql) {
|
|||||||
if ($user->rights->societe->client->voir || $socid) {
|
if ($user->rights->societe->client->voir || $socid) {
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('ThirdPartiesOfSaleRepresentative').': ';
|
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
|
||||||
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
|
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250');
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
if ($user->rights->societe->client->voir || $socid) {
|
if ($user->rights->societe->client->voir || $socid) {
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('LinkedToSpecificUsers').': ';
|
$tmptitle = $langs->trans('LinkedToSpecificUsers');
|
||||||
$moreforfilter .= $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
|
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250');
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
|
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('IncludingProductWithTag').': ';
|
$tmptitle = $langs->trans('IncludingProductWithTag');
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||||
$moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('CustomersProspectsCategoriesShort').': ';
|
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
|
||||||
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1);
|
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
@ -985,6 +1002,7 @@ if ($resql) {
|
|||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
// Show the massaction checkboxes only when this page is not opend from the Extended POS
|
// Show the massaction checkboxes only when this page is not opend from the Extended POS
|
||||||
if ($massactionbutton && $contextpage != 'poslist') {
|
if ($massactionbutton && $contextpage != 'poslist') {
|
||||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||||
@ -1028,7 +1046,7 @@ if ($resql) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date invoice
|
// Date invoice
|
||||||
if (!empty($arrayfields['f.date']['checked'])) {
|
if (!empty($arrayfields['f.datef']['checked'])) {
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||||
@ -1291,7 +1309,7 @@ if ($resql) {
|
|||||||
if (!empty($arrayfields['f.type']['checked'])) {
|
if (!empty($arrayfields['f.type']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['f.date']['checked'])) {
|
if (!empty($arrayfields['f.datef']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['f.date']['label'], $_SERVER['PHP_SELF'], 'f.datef', '', $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['f.date']['label'], $_SERVER['PHP_SELF'], 'f.datef', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['f.date_valid']['checked'])) {
|
if (!empty($arrayfields['f.date_valid']['checked'])) {
|
||||||
@ -1456,7 +1474,7 @@ if ($resql) {
|
|||||||
$facturestatic->paye = $obj->paye;
|
$facturestatic->paye = $obj->paye;
|
||||||
$facturestatic->fk_soc = $obj->fk_soc;
|
$facturestatic->fk_soc = $obj->fk_soc;
|
||||||
|
|
||||||
$facturestatic->date = $db->jdate($obj->df);
|
$facturestatic->date = $db->jdate($obj->datef);
|
||||||
$facturestatic->date_valid = $db->jdate($obj->date_valid);
|
$facturestatic->date_valid = $db->jdate($obj->date_valid);
|
||||||
$facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
|
$facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
|
||||||
|
|
||||||
@ -1576,9 +1594,9 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
if (!empty($arrayfields['f.date']['checked'])) {
|
if (!empty($arrayfields['f.datef']['checked'])) {
|
||||||
print '<td align="center" class="nowraponall">';
|
print '<td align="center" class="nowraponall">';
|
||||||
print dol_print_date($db->jdate($obj->df), 'day');
|
print dol_print_date($db->jdate($obj->datef), 'day');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
@ -1755,7 +1773,7 @@ if ($resql) {
|
|||||||
|
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['f.total_ht']['checked'])) {
|
if (!empty($arrayfields['f.total_ht']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.price($obj->total_ht)."</td>\n";
|
print '<td class="right nowraponall amount">'.price($obj->total_ht)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1766,7 +1784,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['f.total_vat']['checked'])) {
|
if (!empty($arrayfields['f.total_vat']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.price($obj->total_vat)."</td>\n";
|
print '<td class="right nowraponall amount">'.price($obj->total_vat)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1777,7 +1795,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount LocalTax1
|
// Amount LocalTax1
|
||||||
if (!empty($arrayfields['f.total_localtax1']['checked'])) {
|
if (!empty($arrayfields['f.total_localtax1']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.price($obj->total_localtax1)."</td>\n";
|
print '<td class="right nowraponall amount">'.price($obj->total_localtax1)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1788,7 +1806,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount LocalTax2
|
// Amount LocalTax2
|
||||||
if (!empty($arrayfields['f.total_localtax2']['checked'])) {
|
if (!empty($arrayfields['f.total_localtax2']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.price($obj->total_localtax2)."</td>\n";
|
print '<td class="right nowraponall amount">'.price($obj->total_localtax2)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1799,7 +1817,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['f.total_ttc']['checked'])) {
|
if (!empty($arrayfields['f.total_ttc']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.price($obj->total_ttc)."</td>\n";
|
print '<td class="right nowraponall amount">'.price($obj->total_ttc)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1826,11 +1844,11 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['f.retained_warranty']['checked'])) {
|
if (!empty($arrayfields['f.retained_warranty']['checked'])) {
|
||||||
print '<td align="right">'.(!empty($obj->retained_warranty) ?price($obj->retained_warranty).'%' : ' ').'</td>';
|
print '<td align="right amount">'.(!empty($obj->retained_warranty) ?price($obj->retained_warranty).'%' : ' ').'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['dynamount_payed']['checked'])) {
|
if (!empty($arrayfields['dynamount_payed']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.(!empty($totalpay) ?price($totalpay, 0, $langs) : ' ').'</td>'; // TODO Use a denormalized field
|
print '<td class="right nowraponall amount">'.(!empty($totalpay) ?price($totalpay, 0, $langs) : ' ').'</td>'; // TODO Use a denormalized field
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1842,7 +1860,7 @@ if ($resql) {
|
|||||||
|
|
||||||
// Pending amount
|
// Pending amount
|
||||||
if (!empty($arrayfields['rtp']['checked'])) {
|
if (!empty($arrayfields['rtp']['checked'])) {
|
||||||
print '<td class="right nowraponall">';
|
print '<td class="right nowraponall amount">';
|
||||||
print (!empty($remaintopay) ? price($remaintopay, 0, $langs) : ' ');
|
print (!empty($remaintopay) ? price($remaintopay, 0, $langs) : ' ');
|
||||||
print '</td>'; // TODO Use a denormalized field
|
print '</td>'; // TODO Use a denormalized field
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
@ -1874,27 +1892,27 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) {
|
if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.price($obj->multicurrency_total_ht)."</td>\n";
|
print '<td class="right nowraponall amount">'.price($obj->multicurrency_total_ht)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) {
|
if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.price($obj->multicurrency_total_vat)."</td>\n";
|
print '<td class="right nowraponall amount">'.price($obj->multicurrency_total_vat)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) {
|
if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.price($obj->multicurrency_total_ttc)."</td>\n";
|
print '<td class="right nowraponall amount">'.price($obj->multicurrency_total_ttc)."</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) {
|
if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) {
|
||||||
print '<td class="right nowraponall">'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : ' ').'</td>'; // TODO Use a denormalized field
|
print '<td class="right nowraponall amount">'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : ' ').'</td>'; // TODO Use a denormalized field
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -704,25 +704,29 @@ $moreforfilter = '';
|
|||||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('Categories').': ';
|
$tmptitle = $langs->trans('ContactCategoriesShort');
|
||||||
$moreforfilter .= $formother->select_categories(Categorie::TYPE_CONTACT, $search_categ, 'search_categ', 1);
|
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
|
||||||
|
$moreforfilter .= $formother->select_categories(Categorie::TYPE_CONTACT, $search_categ, 'search_categ', 1, $tmptitle);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
if (empty($type) || $type == 'c' || $type == 'p') {
|
if (empty($type) || $type == 'c' || $type == 'p') {
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
|
$tmptitle = '';
|
||||||
if ($type == 'c') {
|
if ($type == 'c') {
|
||||||
$moreforfilter .= $langs->trans('CustomersCategoriesShort').': ';
|
$tmptitle .= $langs->trans('CustomersCategoriesShort');
|
||||||
} elseif ($type == 'p') {
|
} elseif ($type == 'p') {
|
||||||
$moreforfilter .= $langs->trans('ProspectsCategoriesShort').': ';
|
$tmptitle .= $langs->trans('ProspectsCategoriesShort');
|
||||||
} else {
|
} else {
|
||||||
$moreforfilter .= $langs->trans('CustomersProspectsCategoriesShort').': ';
|
$tmptitle .= $langs->trans('CustomersProspectsCategoriesShort');
|
||||||
}
|
}
|
||||||
$moreforfilter .= $formother->select_categories(Categorie::TYPE_CUSTOMER, $search_categ_thirdparty, 'search_categ_thirdparty', 1);
|
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
|
||||||
|
$moreforfilter .= $formother->select_categories(Categorie::TYPE_CUSTOMER, $search_categ_thirdparty, 'search_categ_thirdparty', 1, $tmptitle);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
if (empty($type) || $type == 'f') {
|
if (empty($type) || $type == 'f') {
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('SuppliersCategoriesShort').': ';
|
$tmptitle = $langs->trans('SuppliersCategoriesShort');
|
||||||
$moreforfilter .= $formother->select_categories(Categorie::TYPE_SUPPLIER, $search_categ_supplier, 'search_categ_supplier', 1);
|
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
|
||||||
|
$moreforfilter .= $formother->select_categories(Categorie::TYPE_SUPPLIER, $search_categ_supplier, 'search_categ_supplier', 1, $tmptitle);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1092,35 +1096,35 @@ while ($i < min($num, $limit)) {
|
|||||||
}
|
}
|
||||||
// Phone
|
// Phone
|
||||||
if (!empty($arrayfields['p.phone']['checked'])) {
|
if (!empty($arrayfields['p.phone']['checked'])) {
|
||||||
print '<td>'.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
|
print '<td class="nowraponall">'.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Phone perso
|
// Phone perso
|
||||||
if (!empty($arrayfields['p.phone_perso']['checked'])) {
|
if (!empty($arrayfields['p.phone_perso']['checked'])) {
|
||||||
print '<td>'.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
|
print '<td class="nowraponall">'.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Phone mobile
|
// Phone mobile
|
||||||
if (!empty($arrayfields['p.phone_mobile']['checked'])) {
|
if (!empty($arrayfields['p.phone_mobile']['checked'])) {
|
||||||
print '<td>'.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').'</td>';
|
print '<td class="nowraponall">'.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fax
|
// Fax
|
||||||
if (!empty($arrayfields['p.fax']['checked'])) {
|
if (!empty($arrayfields['p.fax']['checked'])) {
|
||||||
print '<td>'.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').'</td>';
|
print '<td class="nowraponall">'.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// EMail
|
// EMail
|
||||||
if (!empty($arrayfields['p.email']['checked'])) {
|
if (!empty($arrayfields['p.email']['checked'])) {
|
||||||
print '<td>'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1).'</td>';
|
print '<td class="nowraponall tdmaxoverflow300">'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1).'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1144,7 +1148,7 @@ while ($i < min($num, $limit)) {
|
|||||||
}
|
}
|
||||||
// Company
|
// Company
|
||||||
if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) {
|
if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) {
|
||||||
print '<td>';
|
print '<td class="tdoverflowmax200">';
|
||||||
if ($obj->socid) {
|
if ($obj->socid) {
|
||||||
$objsoc = new Societe($db);
|
$objsoc = new Societe($db);
|
||||||
$objsoc->fetch($obj->socid);
|
$objsoc->fetch($obj->socid);
|
||||||
|
|||||||
@ -81,7 +81,7 @@ if (((!empty($conf->product->enabled) && $user->rights->produit->lire) || (!empt
|
|||||||
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
// search on lot/serial numbers
|
// search on lot/serial numbers
|
||||||
if ( ! empty($conf->productbatch->enabled) ) {
|
if ( ! empty($conf->productbatch->enabled) ) {
|
||||||
$arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_plot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
$arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_lot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -153,7 +153,7 @@ class box_members_last_subscriptions extends ModeleBoxes
|
|||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right" width="18"',
|
'td' => 'class="right" width="18"',
|
||||||
'text' => price($obj->subscription),
|
'text' => '<span class="amount">'.price($obj->subscription).'</span>',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
|
|||||||
@ -180,11 +180,11 @@ class box_members_subscriptions_by_year extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right"',
|
'td' => 'class="right"',
|
||||||
'text' => price($value),
|
'text' => '<span class="amount">'.price($value).'</span>',
|
||||||
);
|
);
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right"',
|
'td' => 'class="right"',
|
||||||
'text' => price(price2num($value / $Number[$key], 'MT')),
|
'text' => '<span class="amount">'.price(price2num($value / $Number[$key], 'MT')).'</span>',
|
||||||
);
|
);
|
||||||
$line++;
|
$line++;
|
||||||
}
|
}
|
||||||
@ -205,11 +205,11 @@ class box_members_subscriptions_by_year extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="liste_total right"',
|
'td' => 'class="liste_total right"',
|
||||||
'text' => price($tot),
|
'text' => '<span class="amount">'.price($tot).'</span>',
|
||||||
);
|
);
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="liste_total right"',
|
'td' => 'class="liste_total right"',
|
||||||
'text' => price(price2num($numb > 0 ? ($tot / $numb) : 0, 'MT')),
|
'text' => '<span class="amount">'.price(price2num($numb > 0 ? ($tot / $numb) : 0, 'MT')).'</span>',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1831,7 +1831,7 @@ class Form
|
|||||||
*
|
*
|
||||||
* @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed)
|
* @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed)
|
||||||
* @param string $htmlname Field name in form
|
* @param string $htmlname Field name in form
|
||||||
* @param int $show_empty 0=list with no empty value, 1=add also an empty value into list
|
* @param int|string $show_empty 0=list with no empty value, 1=add also an empty value into list
|
||||||
* @param array $exclude Array list of users id to exclude
|
* @param array $exclude Array list of users id to exclude
|
||||||
* @param int $disabled If select list must be disabled
|
* @param int $disabled If select list must be disabled
|
||||||
* @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
|
* @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
|
||||||
@ -1949,7 +1949,14 @@ class Form
|
|||||||
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
|
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
|
||||||
$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
|
$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
|
||||||
if ($show_empty && !$multiple) {
|
if ($show_empty && !$multiple) {
|
||||||
$out .= '<option value="-1"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'> </option>'."\n";
|
$textforempty = ' ';
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
$textforempty = ' '; // If we use ajaxcombo, we need here to avoid to have an empty element that is too small.
|
||||||
|
}
|
||||||
|
if (!is_numeric($show_empty)) {
|
||||||
|
$textforempty = $show_empty;
|
||||||
|
}
|
||||||
|
$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
|
||||||
}
|
}
|
||||||
if ($show_every) {
|
if ($show_every) {
|
||||||
$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
|
$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
|
||||||
@ -7334,7 +7341,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a multiselect dropbox from an array.
|
* Show a multiselect dropbox from an array. If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default.
|
||||||
*
|
*
|
||||||
* @param string $htmlname Name of HTML field
|
* @param string $htmlname Name of HTML field
|
||||||
* @param array $array Array with array of fields we could show. This array may be modified according to setup of user.
|
* @param array $array Array with array of fields we could show. This array may be modified according to setup of user.
|
||||||
@ -7350,8 +7357,9 @@ class Form
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved seleteced properties
|
$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
|
||||||
if (!empty($user->conf->$tmpvar)) {
|
|
||||||
|
if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user
|
||||||
$tmparray = explode(',', $user->conf->$tmpvar);
|
$tmparray = explode(',', $user->conf->$tmpvar);
|
||||||
foreach ($array as $key => $val) {
|
foreach ($array as $key => $val) {
|
||||||
//var_dump($key);
|
//var_dump($key);
|
||||||
@ -7362,6 +7370,12 @@ class Form
|
|||||||
$array[$key]['checked'] = 0;
|
$array[$key]['checked'] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else { // There is no list of fields already customized for user
|
||||||
|
foreach ($array as $key => $val) {
|
||||||
|
if ($array[$key]['checked'] < 0) {
|
||||||
|
$array[$key]['checked'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$lis = '';
|
$lis = '';
|
||||||
@ -7380,7 +7394,8 @@ class Form
|
|||||||
$langs->load($val['langfile']);
|
$langs->load($val['langfile']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$lis .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.(empty($val['checked']) ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
|
// Note: $val['checked'] <> 0 means we must show the field into the combo list
|
||||||
|
$lis .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) && $val['checked'] != '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
|
||||||
$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
|
$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7721,16 +7736,17 @@ class Form
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
print '<input type="radio" name="idtolinkto" value='.$objp->rowid.'>';
|
print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">'.$objp->ref.'</td>';
|
print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
|
||||||
print '<td>'.$objp->ref_client.'</td>';
|
print '<td>'.$objp->ref_client.'</td>';
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($possiblelink['label'] == 'LinkToContract') {
|
if ($possiblelink['label'] == 'LinkToContract') {
|
||||||
$form = new Form($this->db);
|
$form = new Form($this->db);
|
||||||
print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
|
print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
|
||||||
}
|
}
|
||||||
print price($objp->total_ht).'</td>';
|
print '<span class="amount">'.price($objp->total_ht).'</span>';
|
||||||
|
print '</td>';
|
||||||
print '<td>'.$objp->name.'</td>';
|
print '<td>'.$objp->name.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
@ -7760,7 +7776,7 @@ class Form
|
|||||||
<dl class="dropdown" id="linktoobjectname">
|
<dl class="dropdown" id="linktoobjectname">
|
||||||
';
|
';
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
$linktoelem .= '<dt><a href="#linktoobjectname">'.$langs->trans("LinkTo").'...</a></dt>';
|
$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
|
||||||
}
|
}
|
||||||
$linktoelem .= '<dd>
|
$linktoelem .= '<dd>
|
||||||
<div class="multiselectlinkto">
|
<div class="multiselectlinkto">
|
||||||
|
|||||||
@ -364,7 +364,7 @@ class FormAccounting extends Form
|
|||||||
$sql = "SELECT DISTINCT aa.account_number, aa.label, aa.labelshort, aa.rowid, aa.fk_pcg_version";
|
$sql = "SELECT DISTINCT aa.account_number, aa.label, aa.labelshort, aa.rowid, aa.fk_pcg_version";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||||
$sql .= " AND asy.rowid = ".$conf->global->CHARTOFACCOUNTS;
|
$sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
|
||||||
$sql .= " AND aa.active = 1";
|
$sql .= " AND aa.active = 1";
|
||||||
$sql .= " AND aa.entity=".$conf->entity;
|
$sql .= " AND aa.entity=".$conf->entity;
|
||||||
$sql .= " ORDER BY aa.account_number";
|
$sql .= " ORDER BY aa.account_number";
|
||||||
@ -380,7 +380,7 @@ class FormAccounting extends Form
|
|||||||
|
|
||||||
$num_rows = $this->db->num_rows($resql);
|
$num_rows = $this->db->num_rows($resql);
|
||||||
|
|
||||||
if ($num_rows == 0) {
|
if ($num_rows == 0 && (empty($conf->global->CHARTOFACCOUNTS) || $conf->global->CHARTOFACCOUNTS < 0)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$showempty = $langs->trans("ErrorYouMustFirstSetupYourChartOfAccount");
|
$showempty = $langs->trans("ErrorYouMustFirstSetupYourChartOfAccount");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -303,14 +303,17 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle
|
|||||||
|
|
||||||
if ($offsetforchartofaccount > 0) {
|
if ($offsetforchartofaccount > 0) {
|
||||||
// Replace lines
|
// Replace lines
|
||||||
// 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401, 'PCG99-ABREGE', 'CAPIT', '1234', 1400, '...', 1);'
|
// 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401, 'PCG99-ABREGE', 'CAPIT', '1234', 1400,...'
|
||||||
// with
|
// with
|
||||||
// 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401 + 200100000, 'PCG99-ABREGE','CAPIT', '1234', 1400 + 200100000, '...', 1);'
|
// 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401 + 200100000, 'PCG99-ABREGE','CAPIT', '1234', 1400 + 200100000,...'
|
||||||
// Note: string with 1234 instead of '1234' is also supported
|
// Note: string with 'PCG99-ABREGE','CAPIT', 1234 instead of 'PCG99-ABREGE','CAPIT', '1234' is also supported
|
||||||
$newsql = preg_replace('/VALUES\s*\(__ENTITY__, \s*(\d+)\s*,(\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*,\s*\'?[^\',]*\'?\s*),\s*\'?([^\',]*)\'?/ims', 'VALUES (__ENTITY__, \1 + '.$offsetforchartofaccount.', \2, \3 + '.$offsetforchartofaccount, $newsql);
|
$newsql = preg_replace('/VALUES\s*\(__ENTITY__, \s*(\d+)\s*,(\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*,\s*\'?[^\',]*\'?\s*),\s*\'?([^\',]*)\'?/ims', 'VALUES (__ENTITY__, \1 + '.$offsetforchartofaccount.', \2, \3 + '.$offsetforchartofaccount, $newsql);
|
||||||
$newsql = preg_replace('/([,\s])0 \+ '.$offsetforchartofaccount.'/ims', '\1 0', $newsql);
|
$newsql = preg_replace('/([,\s])0 \+ '.$offsetforchartofaccount.'/ims', '\1 0', $newsql);
|
||||||
//var_dump($newsql);
|
//var_dump($newsql);
|
||||||
$arraysql[$i] = $newsql;
|
$arraysql[$i] = $newsql;
|
||||||
|
|
||||||
|
// FIXME Because we force the rowid during insert, we must also update the sequence with postgresql by running
|
||||||
|
// SELECT dol_util_rebuild_sequences();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -632,16 +635,28 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0,
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @return array Array of tabs to show
|
* @param int $nbofactivatedmodules Number f oactivated modules
|
||||||
|
* @param int $nboftotalmodules Nb of total modules
|
||||||
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
function modules_prepare_head()
|
function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user, $form;
|
||||||
|
|
||||||
|
$desc = $langs->trans("ModulesDesc", '{picto}');
|
||||||
|
$desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc);
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
$mode = empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common';
|
$mode = empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common';
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode;
|
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode;
|
||||||
$head[$h][1] = $langs->trans("AvailableModules");
|
if ($nbofactivatedmodules <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled)
|
||||||
|
$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc);
|
||||||
|
$head[$h][1] .= img_warning($langs->trans("YouMustEnableOneModule"));
|
||||||
|
} else {
|
||||||
|
//$head[$h][1] = $langs->trans("AvailableModules").$form->textwithpicto('<span class="badge marginleftonly">'.$nbofactivatedmodules.' / '.$nboftotalmodules.'</span>', $desc, 1, 'help', '', 1, 3);
|
||||||
|
$head[$h][1] = $langs->trans("AvailableModules").'<span class="badge marginleftonly">'.$nbofactivatedmodules.' / '.$nboftotalmodules.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'modules';
|
$head[$h][2] = 'modules';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -634,8 +634,8 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
|
|||||||
$out = checkVal($out, $check, $filter, $options);
|
$out = checkVal($out, $check, $filter, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sanitizing for special parameters. There is no reason to allow the backtopage parameter to contains an external URL.
|
// Sanitizing for special parameters. There is no reason to allow the backtopage, backtolist or backtourl parameter to contains an external URL.
|
||||||
if ($paramname == 'backtopage' || $paramname == 'backtolist') {
|
if ($paramname == 'backtopage' || $paramname == 'backtolist' || $paramname == 'backtourl') {
|
||||||
$out = str_replace('\\', '/', $out);
|
$out = str_replace('\\', '/', $out);
|
||||||
$out = str_replace(array(':', ';', '@'), '', $out);
|
$out = str_replace(array(':', ';', '@'), '', $out);
|
||||||
|
|
||||||
@ -3528,17 +3528,17 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset',
|
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset',
|
||||||
'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
|
'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
|
||||||
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes',
|
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes',
|
||||||
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt',
|
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'external-link-alt', 'external-link-square-alt',
|
||||||
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
|
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
|
||||||
'help', 'holiday',
|
'help', 'holiday',
|
||||||
'info', 'intervention', 'inventory', 'intracommreport',
|
'info', 'intervention', 'inventory', 'intracommreport',
|
||||||
'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', 'long-arrow-alt-right',
|
'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', 'long-arrow-alt-right',
|
||||||
'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
|
'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
|
||||||
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_asset', 'object_barcode', 'object_bill', 'object_billr', 'object_billa', 'object_billd', 'object_bom',
|
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_asset', 'object_barcode', 'object_bill', 'object_billr', 'object_billa', 'object_billd', 'object_bom',
|
||||||
'object_category', 'conferenceorbooth', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert',
|
'object_category', 'conferenceorbooth', 'object_conversation', 'object_bookmark', 'object_bug', 'object_building', 'object_clock', 'object_collab', 'object_dolly', 'object_dollyrevert',
|
||||||
'object_folder', 'object_folder-open','object_generic',
|
'object_folder', 'object_folder-open','object_generic',
|
||||||
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||||
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_cron', 'object_donation', 'object_dynamicprice',
|
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_cron', 'object_donation', 'object_dynamicprice', 'object_establishment',
|
||||||
'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_inventory', 'object_intracommreport', 'object_label',
|
'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_inventory', 'object_intracommreport', 'object_label',
|
||||||
'object_margin', 'object_members', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
|
'object_margin', 'object_members', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
|
||||||
'object_lot', 'object_mrp', 'object_other',
|
'object_lot', 'object_mrp', 'object_other',
|
||||||
@ -3568,7 +3568,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
$facolor = '';
|
$facolor = '';
|
||||||
$fasize = '';
|
$fasize = '';
|
||||||
$fa = 'fas';
|
$fa = 'fas';
|
||||||
if (in_array($pictowithouttext, array('clock', 'generic', 'minus-square', 'object_generic', 'pdf', 'plus-square', 'timespent', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) {
|
if (in_array($pictowithouttext, array('clock', 'establishment', 'generic', 'minus-square', 'object_generic', 'pdf', 'plus-square', 'timespent', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) {
|
||||||
$fa = 'far';
|
$fa = 'far';
|
||||||
}
|
}
|
||||||
if (in_array($pictowithouttext, array('black-tie', 'github', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'stripe', 'stripe-s', 'youtube', 'google-plus-g', 'whatsapp'))) {
|
if (in_array($pictowithouttext, array('black-tie', 'github', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'stripe', 'stripe-s', 'youtube', 'google-plus-g', 'whatsapp'))) {
|
||||||
@ -3584,7 +3584,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
|
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
|
||||||
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
|
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
|
||||||
'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'user-friends', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
|
'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'user-friends', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
|
||||||
'email'=>'at',
|
'email'=>'at', 'establishment'=>'building',
|
||||||
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle',
|
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle',
|
||||||
'generic'=>'file', 'holiday'=>'umbrella-beach',
|
'generic'=>'file', 'holiday'=>'umbrella-beach',
|
||||||
'info'=>'info-circle', 'inventory'=>'boxes', 'intracommreport'=>'globe-europe', 'label'=>'layer-group', 'loan'=>'money-bill-alt',
|
'info'=>'info-circle', 'inventory'=>'boxes', 'intracommreport'=>'globe-europe', 'label'=>'layer-group', 'loan'=>'money-bill-alt',
|
||||||
@ -8821,8 +8821,8 @@ function showDirectDownloadLink($object)
|
|||||||
$url = $object->getLastMainDocLink($object->element);
|
$url = $object->getLastMainDocLink($object->element);
|
||||||
|
|
||||||
if ($url) {
|
if ($url) {
|
||||||
$out .= img_picto($langs->trans("PublicDownloadLinkdesc"), 'globe').' '.$langs->trans("DirectDownloadLink").'<br>';
|
$out .= img_picto($langs->trans("PublicDownloadLinkdesc"), 'globe').' <span class="opacitymedium">'.$langs->trans("DirectDownloadLink").'</span><br>';
|
||||||
$out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'">';
|
$out .= '<div class="urllink"><input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'"></div>';
|
||||||
$out .= ajax_autoselect("directdownloadlink", 0);
|
$out .= ajax_autoselect("directdownloadlink", 0);
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
|
|||||||
@ -171,9 +171,9 @@ function showOnlinePaymentUrl($type, $ref)
|
|||||||
|
|
||||||
$servicename = $langs->transnoentitiesnoconv('Online');
|
$servicename = $langs->transnoentitiesnoconv('Online');
|
||||||
|
|
||||||
$out = img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'<br>';
|
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'</span><br>';
|
||||||
$url = getOnlinePaymentUrl(0, $type, $ref);
|
$url = getOnlinePaymentUrl(0, $type, $ref);
|
||||||
$out .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">';
|
$out .= '<div class="urllink"><input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'"></div>';
|
||||||
$out .= ajax_autoselect("onlinepaymenturl", 0);
|
$out .= ajax_autoselect("onlinepaymenturl", 0);
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2554,7 +2554,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
|||||||
$ponderated_opp_amount += price2num($opp_weighted_amount);
|
$ponderated_opp_amount += price2num($opp_weighted_amount);
|
||||||
}
|
}
|
||||||
if ($objp->opp_amount) {
|
if ($objp->opp_amount) {
|
||||||
print '<span title="'.$alttext.'">'.price($objp->opp_amount, 0, '', 1, -1, 0, $conf->currency).'</span>';
|
print '<span class="amount" title="'.$alttext.'">'.price($objp->opp_amount, 0, '', 1, -1, 0, $conf->currency).'</span>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,9 +33,15 @@ function showOnlineSignatureUrl($type, $ref)
|
|||||||
|
|
||||||
$servicename = 'Online';
|
$servicename = 'Online';
|
||||||
|
|
||||||
$out = img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlineSignature", $servicename).'<br>';
|
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlineSignature", $servicename).'</span><br>';
|
||||||
$url = getOnlineSignatureUrl(0, $type, $ref);
|
$url = getOnlineSignatureUrl(0, $type, $ref);
|
||||||
$out .= '<input type="text" id="onlinesignatureurl" class="quatrevingtpercent" value="'.$url.'">';
|
$out .= '<div class="urllink">';
|
||||||
|
if ($url == $langs->trans("FeatureOnlineSignDisabled")) {
|
||||||
|
$out .= $url;
|
||||||
|
} else {
|
||||||
|
$out .= '<input type="text" id="onlinesignatureurl" class="quatrevingtpercent" value="'.$url.'">';
|
||||||
|
}
|
||||||
|
$out .= '</div>';
|
||||||
$out .= ajax_autoselect("onlinesignatureurl", 0);
|
$out .= ajax_autoselect("onlinesignatureurl", 0);
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -511,31 +511,37 @@ $moreforfilter = '';
|
|||||||
if ($user->rights->societe->client->voir || $socid) {
|
if ($user->rights->societe->client->voir || $socid) {
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('ThirdPartiesOfSaleRepresentative').': ';
|
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
|
||||||
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
|
$moreforfilter .= img_picto($tmptitle, 'user');
|
||||||
|
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth200');
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
// If the user can view other users
|
// If the user can view other users
|
||||||
if ($user->rights->user->user->lire) {
|
if ($user->rights->user->user->lire) {
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('LinkedToSpecificUsers').': ';
|
$tmptitle = $langs->trans('LinkedToSpecificUsers');
|
||||||
$moreforfilter .= $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
|
$moreforfilter .= img_picto($tmptitle, 'user');
|
||||||
|
$moreforfilter .= $form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
|
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('IncludingProductWithTag').': ';
|
$tmptitle = $langs->trans('IncludingProductWithTag');
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
$moreforfilter .= img_picto($tmptitle, 'category');
|
||||||
$moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
//$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||||
|
//$moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||||
|
$moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category, 'parent', 1, $tmptitle);
|
||||||
|
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('CustomersProspectsCategoriesShort').': ';
|
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
|
||||||
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1);
|
$moreforfilter .= img_picto($tmptitle, 'category');
|
||||||
|
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
|||||||
@ -58,7 +58,7 @@ if ($action == 'update') {
|
|||||||
|
|
||||||
$exturl = GETPOST('EXTERNALSITE_URL', 'none');
|
$exturl = GETPOST('EXTERNALSITE_URL', 'none');
|
||||||
$exturl = dol_string_onlythesehtmltags($exturl, 1, 1, 0, 1);
|
$exturl = dol_string_onlythesehtmltags($exturl, 1, 1, 0, 1);
|
||||||
$exturl = dol_string_onlythesehtmlattributes($exturl);
|
$exturl = trim(dol_string_onlythesehtmlattributes($exturl));
|
||||||
|
|
||||||
$i += dolibarr_set_const($db, 'EXTERNALSITE_LABEL', trim($label), 'chaine', 0, '', $conf->entity);
|
$i += dolibarr_set_const($db, 'EXTERNALSITE_LABEL', trim($label), 'chaine', 0, '', $conf->entity);
|
||||||
$i += dolibarr_set_const($db, 'EXTERNALSITE_URL', trim($exturl), 'chaine', 0, '', $conf->entity);
|
$i += dolibarr_set_const($db, 'EXTERNALSITE_URL', trim($exturl), 'chaine', 0, '', $conf->entity);
|
||||||
@ -108,7 +108,12 @@ print "</tr>";
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="fieldrequired">'.$langs->trans("ExternalSiteURL")."</td>";
|
print '<td class="fieldrequired">'.$langs->trans("ExternalSiteURL")."</td>";
|
||||||
print '<td><textarea class="flat minwidth500" name="EXTERNALSITE_URL">';
|
print '<td><textarea class="flat minwidth500" name="EXTERNALSITE_URL">';
|
||||||
print (GETPOST('EXTERNALSITE_URL', 'restricthtml') ?GETPOST('EXTERNALSITE_URL', 'restricthtml') : (empty($conf->global->EXTERNALSITE_URL) ? '' : $conf->global->EXTERNALSITE_URL));
|
|
||||||
|
$exturl = GETPOST('EXTERNALSITE_URL', 'none');
|
||||||
|
$exturl = dol_string_onlythesehtmltags($exturl, 1, 1, 0, 1);
|
||||||
|
$exturl = trim(dol_string_onlythesehtmlattributes($exturl));
|
||||||
|
|
||||||
|
print (GETPOSTISSET('EXTERNALSITE_URL') ? $exturl : (empty($conf->global->EXTERNALSITE_URL) ? '' : $conf->global->EXTERNALSITE_URL));
|
||||||
print '</textarea></td>';
|
print '</textarea></td>';
|
||||||
print "<td>http://localhost/myurl/";
|
print "<td>http://localhost/myurl/";
|
||||||
print "<br>https://wikipedia.org/";
|
print "<br>https://wikipedia.org/";
|
||||||
|
|||||||
@ -1439,7 +1439,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['cf.total_ht']['checked'])) {
|
if (!empty($arrayfields['cf.total_ht']['checked'])) {
|
||||||
print '<td class="right">'.price($obj->total_ht)."</td>\n";
|
print '<td class="right"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1450,7 +1450,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['cf.total_tva']['checked'])) {
|
if (!empty($arrayfields['cf.total_tva']['checked'])) {
|
||||||
print '<td class="right">'.price($obj->total_tva)."</td>\n";
|
print '<td class="right"><span class="amount">'.price($obj->total_tva)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1461,7 +1461,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['cf.total_ttc']['checked'])) {
|
if (!empty($arrayfields['cf.total_ttc']['checked'])) {
|
||||||
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
|
print '<td class="right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1490,21 +1490,21 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['cf.multicurrency_total_ht']['checked'])) {
|
if (!empty($arrayfields['cf.multicurrency_total_ht']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_ht)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['cf.multicurrency_total_tva']['checked'])) {
|
if (!empty($arrayfields['cf.multicurrency_total_tva']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_tva)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['cf.multicurrency_total_ttc']['checked'])) {
|
if (!empty($arrayfields['cf.multicurrency_total_ttc']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_ttc)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,12 +27,19 @@ require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('admin', 'hrm'));
|
$langs->loadLangs(array('admin', 'hrm'));
|
||||||
|
|
||||||
if (!$user->admin) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
$permissiontoread = $user->admin;
|
||||||
|
$permissiontoadd = $user->admin;
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
|
||||||
|
if (empty($conf->hrm->enabled)) accessforbidden();
|
||||||
|
if (empty($permissiontoread)) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -73,11 +80,13 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
|
print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
|
||||||
|
|
||||||
|
$newcardbutton = dolGetButtonTitle($langs->trans('NewEstablishment'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/hrm/establishment/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
||||||
|
|
||||||
// Configuration header
|
// Configuration header
|
||||||
$head = hrm_admin_prepare_head();
|
$head = hrm_admin_prepare_head();
|
||||||
print dol_get_fiche_head($head, 'establishments', $langs->trans("HRM"), -1, "user");
|
print dol_get_fiche_head($head, 'establishments', $langs->trans("HRM"), -1, "user", 0, $newcardbutton);
|
||||||
|
|
||||||
$sql = "SELECT e.rowid, e.label, e.address, e.zip, e.town, e.status";
|
$sql = "SELECT e.rowid, e.rowid as ref, e.label, e.address, e.zip, e.town, e.status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."establishment as e";
|
$sql .= " FROM ".MAIN_DB_PREFIX."establishment as e";
|
||||||
$sql .= " WHERE e.entity IN (".getEntity('establishment').')';
|
$sql .= " WHERE e.entity IN (".getEntity('establishment').')';
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
@ -135,11 +144,6 @@ if ($result) {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
// Buttons
|
|
||||||
print '<div class="tabsAction">';
|
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/hrm/establishment/card.php?action=create">'.$langs->trans("NewEstablishment").'</a>';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -27,10 +27,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('admin', 'hrm'));
|
$langs->loadLangs(array('admin', 'hrm'));
|
||||||
|
|
||||||
if (!$user->admin) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Other parameters HRM_*
|
// Other parameters HRM_*
|
||||||
@ -38,9 +34,22 @@ $list = array(
|
|||||||
// 'HRM_EMAIL_EXTERNAL_SERVICE' // To prevent your public accountant for example
|
// 'HRM_EMAIL_EXTERNAL_SERVICE' // To prevent your public accountant for example
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$permissiontoread = $user->admin;
|
||||||
|
$permissiontoadd = $user->admin;
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
|
||||||
|
if (empty($conf->hrm->enabled)) accessforbidden();
|
||||||
|
if (empty($permissiontoread)) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'update') {
|
if ($action == 'update') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class Establishment extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
*/
|
*/
|
||||||
public $picto = 'building';
|
public $picto = 'establishment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int ID
|
* @var int ID
|
||||||
@ -428,34 +428,92 @@ class Establishment extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return clicable name (with picto eventually)
|
* Return a link to the object card (with optionaly the picto)
|
||||||
*
|
*
|
||||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
|
||||||
* @return string String with URL
|
* @param string $option On what the link point to ('nolink', ...)
|
||||||
|
* @param int $notooltip 1=Disable tooltip
|
||||||
|
* @param string $morecss Add more css on link
|
||||||
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0)
|
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs, $hookmanager;
|
||||||
|
|
||||||
|
if (!empty($conf->dol_no_mouse_hover)) {
|
||||||
|
$notooltip = 1; // Force disable tooltips
|
||||||
|
}
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$this->id.'">';
|
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Establishment").'</u>';
|
||||||
$linkend = '</a>';
|
if (isset($this->status)) {
|
||||||
|
$label .= ' '.$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
$label .= '<br>';
|
||||||
|
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
|
||||||
$picto = 'building';
|
$url = DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$this->id;
|
||||||
|
|
||||||
$label = '<u>'.$langs->trans("Establishment").'</u>';
|
if ($option != 'nolink') {
|
||||||
$label .= '<br>'.$langs->trans("Label").': '.$this->label;
|
// Add param to save lastsearch_values or not
|
||||||
|
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||||
|
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
|
||||||
|
$add_save_lastsearch_values = 1;
|
||||||
|
}
|
||||||
|
if ($add_save_lastsearch_values) {
|
||||||
|
$url .= '&save_lastsearch_values=1';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$linkclose = '';
|
||||||
|
if (empty($notooltip)) {
|
||||||
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
|
$label = $langs->trans("Establishment");
|
||||||
|
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
}
|
||||||
|
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
|
||||||
|
} else {
|
||||||
|
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($option == 'nolink') {
|
||||||
|
$linkstart = '<span';
|
||||||
|
} else {
|
||||||
|
$linkstart = '<a href="'.$url.'"';
|
||||||
|
}
|
||||||
|
$linkstart .= $linkclose.'>';
|
||||||
|
if ($option == 'nolink') {
|
||||||
|
$linkend = '</span>';
|
||||||
|
} else {
|
||||||
|
$linkend = '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$result .= $linkstart;
|
||||||
|
|
||||||
if ($withpicto) {
|
if ($withpicto) {
|
||||||
$result .= ($link.img_object($label, $picto).$linkend);
|
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||||
}
|
|
||||||
if ($withpicto && $withpicto != 2) {
|
|
||||||
$result .= ' ';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($withpicto != 2) {
|
if ($withpicto != 2) {
|
||||||
$result .= $link.$this->label.$linkend;
|
$result .= $this->ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result .= $linkend;
|
||||||
|
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||||
|
|
||||||
|
global $action, $hookmanager;
|
||||||
|
$hookmanager->initHooks(array('establishmentdao'));
|
||||||
|
$parameters = array('id'=>$this->id, 'getnomurl'=>$result);
|
||||||
|
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook > 0) {
|
||||||
|
$result = $hookmanager->resPrint;
|
||||||
|
} else {
|
||||||
|
$result .= $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
* \file htdocs/hrm/establishment/card.php
|
* \file htdocs/hrm/establishment/card.php
|
||||||
* \brief Page to show an establishment
|
* \brief Page to show an establishment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
|
||||||
@ -28,11 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('admin', 'hrm'));
|
$langs->loadLangs(array('admin', 'hrm'));
|
||||||
|
|
||||||
// Security check
|
|
||||||
if (!$user->admin) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -55,6 +51,18 @@ $object = new Establishment($db);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
|
$permissiontoread = $user->admin;
|
||||||
|
$permissiontoadd = $user->admin; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0);
|
||||||
|
if (empty($conf->hrm->enabled)) accessforbidden();
|
||||||
|
if (empty($permissiontoread)) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -165,7 +173,7 @@ if ($action == 'create') {
|
|||||||
// Name
|
// Name
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$form->editfieldkey('Label', 'label', '', $object, 0, 'string', '', 1).'</td>';
|
print '<td>'.$form->editfieldkey('Label', 'label', '', $object, 0, 'string', '', 1).'</td>';
|
||||||
print '<td><input name="label" id="label" value="'.GETPOST("label", "alphanohtml").'"></td>';
|
print '<td><input name="label" id="label" value="'.GETPOST("label", "alphanohtml").'" autofocus></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Entity
|
// Entity
|
||||||
@ -252,7 +260,7 @@ if (($id || $ref) && $action == 'edit') {
|
|||||||
$head = establishment_prepare_head($object);
|
$head = establishment_prepare_head($object);
|
||||||
|
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
print dol_get_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building');
|
print dol_get_fiche_head($head, 'card', $langs->trans("Establishment"), 0, $object->picto);
|
||||||
|
|
||||||
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
@ -335,7 +343,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$res = $object->fetch_optionals();
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = establishment_prepare_head($object);
|
$head = establishment_prepare_head($object);
|
||||||
print dol_get_fiche_head($head, 'card', $langs->trans("Establishment"), -1, 'building');
|
print dol_get_fiche_head($head, 'card', $langs->trans("Establishment"), -1, $object->picto);
|
||||||
|
|
||||||
// Confirmation to delete
|
// Confirmation to delete
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
|
|||||||
@ -76,12 +76,17 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
|
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$permissiontoread = $user->admin;
|
||||||
|
$permissiontoadd = $user->rights->hrm->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'mymodule', $object->id);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
$permissiontoadd = $user->rights->hrm->write; // Used by the include of actions_addupdatedelete.inc.php
|
if (empty($conf->hrm->enabled)) accessforbidden();
|
||||||
|
if (empty($permissiontoread)) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -128,7 +133,7 @@ if ($object->id > 0) {
|
|||||||
$head = establishment_prepare_head($object);
|
$head = establishment_prepare_head($object);
|
||||||
|
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'info', $langs->trans("Establishment"), -1, 'building');
|
print dol_get_fiche_head($head, 'info', $langs->trans("Establishment"), -1, $object->picto);
|
||||||
|
|
||||||
// Object card
|
// Object card
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|||||||
@ -52,6 +52,7 @@ CREATE OR REPLACE FUNCTION DAY(TIMESTAMP WITH TIME ZONE) RETURNS INTEGER AS $$ S
|
|||||||
CREATE OR REPLACE FUNCTION DAY(DATE) RETURNS INTEGER AS $$ SELECT EXTRACT(DAY FROM $1)::INTEGER; $$ LANGUAGE SQL IMMUTABLE;
|
CREATE OR REPLACE FUNCTION DAY(DATE) RETURNS INTEGER AS $$ SELECT EXTRACT(DAY FROM $1)::INTEGER; $$ LANGUAGE SQL IMMUTABLE;
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION dol_util_rebuild_sequences() RETURNS integer as $body$ DECLARE sequencedefs RECORD; c integer ; BEGIN FOR sequencedefs IN SELECT DISTINCT constraint_column_usage.table_name as tablename, constraint_column_usage.table_name as tablename, constraint_column_usage.column_name as columnname, replace(replace(columns.column_default,'''::regclass)',''),'nextval(''','') as sequencename from information_schema.constraint_column_usage, information_schema.columns, information_schema.sequences where constraint_column_usage.table_schema ='public' AND columns.table_schema = 'public' AND columns.table_name=constraint_column_usage.table_name AND constraint_column_usage.column_name IN ('rowid','id') AND constraint_column_usage.column_name = columns.column_name AND columns.column_default is not null AND replace(replace(columns.column_default,'''::regclass)',''),'nextval(''','')=sequence_name LOOP EXECUTE 'select max('||sequencedefs.columnname||') from ' || sequencedefs.tablename INTO c; IF c is null THEN c = 0; END IF; IF c is not null THEN c = c+ 1; END IF; EXECUTE 'alter sequence ' || sequencedefs.sequencename ||' restart with ' || c; END LOOP; RETURN 1; END; $body$ LANGUAGE plpgsql;
|
CREATE OR REPLACE FUNCTION dol_util_rebuild_sequences() RETURNS integer as $body$ DECLARE sequencedefs RECORD; c integer ; BEGIN FOR sequencedefs IN SELECT DISTINCT constraint_column_usage.table_name as tablename, constraint_column_usage.table_name as tablename, constraint_column_usage.column_name as columnname, replace(replace(columns.column_default,'''::regclass)',''),'nextval(''','') as sequencename from information_schema.constraint_column_usage, information_schema.columns, information_schema.sequences where constraint_column_usage.table_schema ='public' AND columns.table_schema = 'public' AND columns.table_name=constraint_column_usage.table_name AND constraint_column_usage.column_name IN ('rowid','id') AND constraint_column_usage.column_name = columns.column_name AND columns.column_default is not null AND replace(replace(columns.column_default,'''::regclass)',''),'nextval(''','')=sequence_name LOOP EXECUTE 'select max('||sequencedefs.columnname||') from ' || sequencedefs.tablename INTO c; IF c is null THEN c = 0; END IF; IF c is not null THEN c = c+ 1; END IF; EXECUTE 'alter sequence ' || sequencedefs.sequencename ||' restart with ' || c; END LOOP; RETURN 1; END; $body$ LANGUAGE plpgsql;
|
||||||
|
-- You can call the function with SELECT dol_util_rebuild_sequences();
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer AS $BODY$ DECLARE mytables RECORD; BEGIN FOR mytables IN SELECT relname FROM pg_class WHERE relhastriggers IS TRUE AND relkind = 'r' AND NOT relname LIKE 'pg_%' LOOP IF DoEnable THEN EXECUTE 'ALTER TABLE ' || mytables.relname || ' ENABLE TRIGGER ALL'; ELSE EXECUTE 'ALTER TABLE ' || mytables.relname || ' DISABLE TRIGGER ALL'; END IF; END LOOP; RETURN 1; END; $BODY$ LANGUAGE plpgsql;
|
CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer AS $BODY$ DECLARE mytables RECORD; BEGIN FOR mytables IN SELECT relname FROM pg_class WHERE relhastriggers IS TRUE AND relkind = 'r' AND NOT relname LIKE 'pg_%' LOOP IF DoEnable THEN EXECUTE 'ALTER TABLE ' || mytables.relname || ' ENABLE TRIGGER ALL'; ELSE EXECUTE 'ALTER TABLE ' || mytables.relname || ' DISABLE TRIGGER ALL'; END IF; END LOOP; RETURN 1; END; $BODY$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|||||||
@ -94,6 +94,8 @@ print 'Option repair_link_dispatch_lines_supplier_order_lines, (\'test\' or \'co
|
|||||||
print 'Option set_empty_time_spent_amount (\'test\' or \'confirmed\') is '.(GETPOST('set_empty_time_spent_amount', 'alpha') ?GETPOST('set_empty_time_spent_amount', 'alpha') : 'undefined').'<br>'."\n";
|
print 'Option set_empty_time_spent_amount (\'test\' or \'confirmed\') is '.(GETPOST('set_empty_time_spent_amount', 'alpha') ?GETPOST('set_empty_time_spent_amount', 'alpha') : 'undefined').'<br>'."\n";
|
||||||
// Structure
|
// Structure
|
||||||
print 'Option force_utf8_on_tables, for mysql/mariadb only (\'test\' or \'confirmed\') is '.(GETPOST('force_utf8_on_tables', 'alpha') ?GETPOST('force_utf8_on_tables', 'alpha') : 'undefined').'<br>'."\n";
|
print 'Option force_utf8_on_tables, for mysql/mariadb only (\'test\' or \'confirmed\') is '.(GETPOST('force_utf8_on_tables', 'alpha') ?GETPOST('force_utf8_on_tables', 'alpha') : 'undefined').'<br>'."\n";
|
||||||
|
// Rebuild sequence
|
||||||
|
print 'Option rebuild_sequences, for postgresql only (\'test\' or \'confirmed\') is '.(GETPOST('rebuild_sequences', 'alpha') ?GETPOST('rebuild_sequences', 'alpha') : 'undefined').'<br>'."\n";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';
|
print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';
|
||||||
@ -172,7 +174,8 @@ $oneoptionset = 0;
|
|||||||
$oneoptionset = (GETPOST('standard', 'alpha') || GETPOST('restore_thirdparties_logos', 'alpha') || GETPOST('clean_linked_elements', 'alpha') || GETPOST('clean_menus', 'alpha')
|
$oneoptionset = (GETPOST('standard', 'alpha') || GETPOST('restore_thirdparties_logos', 'alpha') || GETPOST('clean_linked_elements', 'alpha') || GETPOST('clean_menus', 'alpha')
|
||||||
|| GETPOST('clean_orphelin_dir', 'alpha') || GETPOST('clean_product_stock_batch', 'alpha') || GETPOST('set_empty_time_spent_amount', 'alpha') || GETPOST('rebuild_product_thumbs', 'alpha')
|
|| GETPOST('clean_orphelin_dir', 'alpha') || GETPOST('clean_product_stock_batch', 'alpha') || GETPOST('set_empty_time_spent_amount', 'alpha') || GETPOST('rebuild_product_thumbs', 'alpha')
|
||||||
|| GETPOST('clean_perm_table', 'alpha')
|
|| GETPOST('clean_perm_table', 'alpha')
|
||||||
|| GETPOST('force_disable_of_modules_not_found', 'alpha') || GETPOST('force_utf8_on_tables', 'alpha'));
|
|| GETPOST('force_disable_of_modules_not_found', 'alpha') || GETPOST('force_utf8_on_tables', 'alpha')
|
||||||
|
|| GETPOST('rebuild_sequences', 'alpha'));
|
||||||
|
|
||||||
if ($ok && $oneoptionset) {
|
if ($ok && $oneoptionset) {
|
||||||
// Show wait message
|
// Show wait message
|
||||||
@ -1253,6 +1256,25 @@ if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// rebuild sequences for pgsql
|
||||||
|
if ($ok && GETPOST('rebuild_sequences', 'alpha')) {
|
||||||
|
print '<tr><td colspan="2"><br>*** Force to rebuild sequences (for postgresql only)</td></tr>';
|
||||||
|
|
||||||
|
if ($db->type == "pgsql") {
|
||||||
|
$rebuild_sequence = GETPOST('rebuild_sequences', 'alpha');
|
||||||
|
|
||||||
|
if ($rebuild_sequence == 'confirmed') {
|
||||||
|
$sql = "SELECT dol_util_rebuild_sequences();";
|
||||||
|
print '<!-- '.$sql.' -->';
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print '<tr><td colspan="2">Not available with database type '.$db->type.'</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) {
|
if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) {
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -19,6 +19,7 @@ BoxLastContracts=Latest contracts
|
|||||||
BoxLastContacts=Latest contacts/addresses
|
BoxLastContacts=Latest contacts/addresses
|
||||||
BoxLastMembers=Latest members
|
BoxLastMembers=Latest members
|
||||||
BoxLastModifiedMembers=Latest modified members
|
BoxLastModifiedMembers=Latest modified members
|
||||||
|
BoxLastMembersSubscriptions=Latest member subscriptions
|
||||||
BoxFicheInter=Latest interventions
|
BoxFicheInter=Latest interventions
|
||||||
BoxCurrentAccounts=Open accounts balance
|
BoxCurrentAccounts=Open accounts balance
|
||||||
BoxTitleMemberNextBirthdays=Birthdays of this month (members)
|
BoxTitleMemberNextBirthdays=Birthdays of this month (members)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
# Dolibarr language file - Source file is en_US - externalsite
|
# Dolibarr language file - Source file is en_US - externalsite
|
||||||
ExternalSiteSetup=Setup link to external website
|
ExternalSiteSetup=Setup link to external website
|
||||||
ExternalSiteURL=External Site URL
|
ExternalSiteURL=External Site URL of HTML iframe content
|
||||||
ExternalSiteModuleNotComplete=Module ExternalSite was not configured properly.
|
ExternalSiteModuleNotComplete=Module ExternalSite was not configured properly.
|
||||||
ExampleMyMenuEntry=My menu entry
|
ExampleMyMenuEntry=My menu entry
|
||||||
|
|||||||
@ -1786,6 +1786,7 @@ ApiSetup=Configuration du module API REST
|
|||||||
ApiDesc=En activant ce module, Dolibarr devient aussi serveur de services API de type REST
|
ApiDesc=En activant ce module, Dolibarr devient aussi serveur de services API de type REST
|
||||||
ApiProductionMode=Activer le mode « production » (ceci activera l'utilisation du cache pour la gestion des services)
|
ApiProductionMode=Activer le mode « production » (ceci activera l'utilisation du cache pour la gestion des services)
|
||||||
ApiExporerIs=Vous pouvez explorer et tester les API par l'URL
|
ApiExporerIs=Vous pouvez explorer et tester les API par l'URL
|
||||||
|
SwaggerDescriptionFile=Swagger JSON description file of APIs
|
||||||
OnlyActiveElementsAreExposed=Seuls les éléments en rapport avec un module actif sont présentés.
|
OnlyActiveElementsAreExposed=Seuls les éléments en rapport avec un module actif sont présentés.
|
||||||
ApiKey=Clé pour l'API
|
ApiKey=Clé pour l'API
|
||||||
WarningAPIExplorerDisabled=L'explorateur d'API est désactivé. L'explorateur d'API n'est pas nécessaire pour le fonctionnement des API. il s'agit d'un outil pour les développeurs pour en tester les services. Si cet outil vous est nécessaire, activez le module API REST dans la liste des modules.
|
WarningAPIExplorerDisabled=L'explorateur d'API est désactivé. L'explorateur d'API n'est pas nécessaire pour le fonctionnement des API. il s'agit d'un outil pour les développeurs pour en tester les services. Si cet outil vous est nécessaire, activez le module API REST dans la liste des modules.
|
||||||
|
|||||||
@ -132,7 +132,7 @@ $upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object-
|
|||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||||
//if (empty($permissiontoread)) accessforbidden();
|
//if (empty($permissiontoread)) accessforbidden();
|
||||||
|
|||||||
@ -1491,9 +1491,9 @@ if ($resql) {
|
|||||||
print '<td class="right nowraponall">';
|
print '<td class="right nowraponall">';
|
||||||
if ($obj->tosell) {
|
if ($obj->tosell) {
|
||||||
if ($obj->price_base_type == 'TTC') {
|
if ($obj->price_base_type == 'TTC') {
|
||||||
print price($obj->price_ttc).' '.$langs->trans("TTC");
|
print '<span class="amount">'.price($obj->price_ttc).' '.$langs->trans("TTC").'</span>';
|
||||||
} else {
|
} else {
|
||||||
print price($obj->price).' '.$langs->trans("HT");
|
print '<span class="amount">'.price($obj->price).' '.$langs->trans("HT").'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1546,9 +1546,9 @@ if ($resql) {
|
|||||||
print '<td class="right nowraponall">';
|
print '<td class="right nowraponall">';
|
||||||
if (!empty($productpricescache[$obj->rowid])) {
|
if (!empty($productpricescache[$obj->rowid])) {
|
||||||
if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') {
|
if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') {
|
||||||
print price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC");
|
print '<span class="amount">'.price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC").'</span>';
|
||||||
} else {
|
} else {
|
||||||
print price($productpricescache[$obj->rowid][$key]['price']).' '.$langs->trans("HT");
|
print '<span class="amount">'.price($productpricescache[$obj->rowid][$key]['price']).' '.$langs->trans("HT").'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1568,9 +1568,9 @@ if ($resql) {
|
|||||||
if ($product_fourn->product_fourn_price_id > 0) {
|
if ($product_fourn->product_fourn_price_id > 0) {
|
||||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) {
|
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) {
|
||||||
$htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
|
$htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
|
||||||
print $form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext);
|
print '<span class="amount">'.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).'</span>';
|
||||||
} else {
|
} else {
|
||||||
print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT");
|
print '<span class="amount">'.price($product_fourn->fourn_unitprice).' '.$langs->trans("HT").'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1606,14 +1606,14 @@ if ($resql) {
|
|||||||
// WAP
|
// WAP
|
||||||
if (!empty($arrayfields['p.pmp']['checked'])) {
|
if (!empty($arrayfields['p.pmp']['checked'])) {
|
||||||
print '<td class="nowrap right">';
|
print '<td class="nowrap right">';
|
||||||
print price($product_static->pmp, 1, $langs);
|
print '<span class="amount">'.price($product_static->pmp, 1, $langs)."</span>";
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Cost price
|
// Cost price
|
||||||
if (!empty($arrayfields['p.cost_price']['checked'])) {
|
if (!empty($arrayfields['p.cost_price']['checked'])) {
|
||||||
print '<td class="nowrap right">';
|
print '<td class="nowrap right">';
|
||||||
//print $obj->cost_price;
|
//print $obj->cost_price;
|
||||||
print price($obj->cost_price).' '.$langs->trans("HT");
|
print '<span class="amount">'.price($obj->cost_price).' '.$langs->trans("HT").'</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -280,14 +280,14 @@ if ($result) {
|
|||||||
$line = $total = $totalsell = $totalStock = 0;
|
$line = $total = $totalsell = $totalStock = 0;
|
||||||
while ($line < $totalnboflines) {
|
while ($line < $totalnboflines) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$total += price2num($objp->estimatedvalue, 'MU');
|
$total += $objp->estimatedvalue;
|
||||||
$totalsell += price2num($objp->sellvalue, 'MU');
|
$totalsell += $objp->sellvalue;
|
||||||
$totalStock += $objp->stockqty;
|
$totalStock += $objp->stockqty;
|
||||||
$line++;
|
$line++;
|
||||||
}
|
}
|
||||||
$totalarray['val']['stockqty'] = $totalStock;
|
$totalarray['val']['stockqty'] = price2num($totalStock, 'MS');
|
||||||
$totalarray['val']['estimatedvalue'] = $total;
|
$totalarray['val']['estimatedvalue'] = price2num($total, 'MT');
|
||||||
$totalarray['val']['estimatedstockvaluesell'] = $totalsell;
|
$totalarray['val']['estimatedstockvaluesell'] = price2num($totalsell, 'MT');
|
||||||
}
|
}
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
@ -633,7 +633,7 @@ if ($num) {
|
|||||||
if (!empty($arrayfields["estimatedvalue"]['checked'])) {
|
if (!empty($arrayfields["estimatedvalue"]['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if (price2num($obj->estimatedvalue, 'MT')) {
|
if (price2num($obj->estimatedvalue, 'MT')) {
|
||||||
print price(price2num($obj->estimatedvalue, 'MT'), 1);
|
print '<span class="amount">'.price(price2num($obj->estimatedvalue, 'MT'), 1).'</span>';
|
||||||
} else {
|
} else {
|
||||||
print '';
|
print '';
|
||||||
}
|
}
|
||||||
@ -650,7 +650,9 @@ if ($num) {
|
|||||||
if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) {
|
if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||||
print price(price2num($obj->sellvalue, 'MT'), 1);
|
if ($obj->sellvalue) {
|
||||||
|
print '<span class="amount">'.price(price2num($obj->sellvalue, 'MT'), 1).'</span>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$htmltext = $langs->trans("OptionMULTIPRICESIsOn");
|
$htmltext = $langs->trans("OptionMULTIPRICESIsOn");
|
||||||
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
|
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
|
||||||
|
|||||||
@ -1107,7 +1107,7 @@ while ($i < min($num, $limit)) {
|
|||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
//if ($obj->opp_status_code)
|
//if ($obj->opp_status_code)
|
||||||
if (strcmp($obj->opp_amount, '')) {
|
if (strcmp($obj->opp_amount, '')) {
|
||||||
print price($obj->opp_amount, 1, $langs, 1, -1, -1, '');
|
print '<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1, '').'</span>';
|
||||||
$totalarray['val']['p.opp_amount'] += $obj->opp_amount;
|
$totalarray['val']['p.opp_amount'] += $obj->opp_amount;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1136,7 +1136,7 @@ while ($i < min($num, $limit)) {
|
|||||||
}
|
}
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($obj->opp_weighted_amount) {
|
if ($obj->opp_weighted_amount) {
|
||||||
print price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1, '');
|
print '<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1, '').'</span>';
|
||||||
$totalarray['val']['opp_weighted_amount'] += $obj->opp_weighted_amount;
|
$totalarray['val']['opp_weighted_amount'] += $obj->opp_weighted_amount;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1151,7 +1151,7 @@ while ($i < min($num, $limit)) {
|
|||||||
if (!empty($arrayfields['p.budget_amount']['checked'])) {
|
if (!empty($arrayfields['p.budget_amount']['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($obj->budget_amount != '') {
|
if ($obj->budget_amount != '') {
|
||||||
print price($obj->budget_amount, 1, $langs, 1, -1, -1);
|
print '<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).'</span>';
|
||||||
$totalarray['val']['p.budget_amount'] += $obj->budget_amount;
|
$totalarray['val']['p.budget_amount'] += $obj->budget_amount;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1232,7 +1232,7 @@ while ($i < min($num, $limit)) {
|
|||||||
if (!empty($arrayfields['p.price_registration']['checked'])) {
|
if (!empty($arrayfields['p.price_registration']['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($obj->price_registration != '') {
|
if ($obj->price_registration != '') {
|
||||||
print price($obj->price_registration, 1, $langs, 1, -1, -1);
|
print '<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).'</span>';
|
||||||
$totalarray['val']['p.price_registration'] += $obj->price_registration;
|
$totalarray['val']['p.price_registration'] += $obj->price_registration;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1247,7 +1247,7 @@ while ($i < min($num, $limit)) {
|
|||||||
if (!empty($arrayfields['p.price_booth']['checked'])) {
|
if (!empty($arrayfields['p.price_booth']['checked'])) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($obj->price_booth != '') {
|
if ($obj->price_booth != '') {
|
||||||
print price($obj->price_booth, 1, $langs, 1, -1, -1);
|
print '<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).'</span>';
|
||||||
$totalarray['val']['p.price_booth'] += $obj->price_booth;
|
$totalarray['val']['p.price_booth'] += $obj->price_booth;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -128,26 +128,26 @@ if (empty($user->socid)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
't.fk_task_parent'=>array('label'=>$langs->trans("RefTaskParent"), 'checked'=>0, 'position'=>70),
|
't.fk_task_parent'=>array('label'=>"RefTaskParent", 'checked'=>0, 'position'=>70),
|
||||||
't.ref'=>array('label'=>$langs->trans("RefTask"), 'checked'=>1, 'position'=>80),
|
't.ref'=>array('label'=>"RefTask", 'checked'=>1, 'position'=>80),
|
||||||
't.label'=>array('label'=>$langs->trans("LabelTask"), 'checked'=>1, 'position'=>80),
|
't.label'=>array('label'=>"LabelTask", 'checked'=>1, 'position'=>80),
|
||||||
't.description'=>array('label'=>$langs->trans("Description"), 'checked'=>0, 'position'=>80),
|
't.description'=>array('label'=>"Description", 'checked'=>0, 'position'=>80),
|
||||||
't.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100),
|
't.dateo'=>array('label'=>"DateStart", 'checked'=>1, 'position'=>100),
|
||||||
't.datee'=>array('label'=>$langs->trans("Deadline"), 'checked'=>1, 'position'=>101),
|
't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>101),
|
||||||
'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>1),
|
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1),
|
||||||
'p.title'=>array('label'=>$langs->trans("ProjectLabel"), 'checked'=>0),
|
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0),
|
||||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>0),
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>0),
|
||||||
'p.fk_statut'=>array('label'=>$langs->trans("ProjectStatus"), 'checked'=>1),
|
'p.fk_statut'=>array('label'=>"ProjectStatus", 'checked'=>1),
|
||||||
't.planned_workload'=>array('label'=>$langs->trans("PlannedWorkload"), 'checked'=>1, 'position'=>102),
|
't.planned_workload'=>array('label'=>"PlannedWorkload", 'checked'=>1, 'position'=>102),
|
||||||
't.duration_effective'=>array('label'=>$langs->trans("TimeSpent"), 'checked'=>1, 'position'=>103),
|
't.duration_effective'=>array('label'=>"TimeSpent", 'checked'=>1, 'position'=>103),
|
||||||
't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>104),
|
't.progress_calculated'=>array('label'=>"ProgressCalculated", 'checked'=>1, 'position'=>104),
|
||||||
't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>105),
|
't.progress'=>array('label'=>"ProgressDeclared", 'checked'=>1, 'position'=>105),
|
||||||
't.progress_summary'=>array('label'=>$langs->trans("TaskProgressSummary"), 'checked'=>1, 'position'=>106),
|
't.progress_summary'=>array('label'=>"TaskProgressSummary", 'checked'=>1, 'position'=>106),
|
||||||
't.tobill'=>array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>110),
|
't.tobill'=>array('label'=>"TimeToBill", 'checked'=>0, 'position'=>110),
|
||||||
't.billed'=>array('label'=>$langs->trans("TimeBilled"), 'checked'=>0, 'position'=>111),
|
't.billed'=>array('label'=>"TimeBilled", 'checked'=>0, 'position'=>111),
|
||||||
't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
't.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
't.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||||
//'t.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
//'t.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||||
|
|||||||
@ -86,25 +86,6 @@ if (empty($origin_id)) {
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : '';
|
$line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : '';
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid = '';
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($origin == 'reception') {
|
|
||||||
$result = restrictedArea($user, $origin, $id);
|
|
||||||
} else {
|
|
||||||
$result = restrictedArea($user, 'reception');
|
|
||||||
if ($origin == 'supplierorder') {
|
|
||||||
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
//Select mail models is same action as presend
|
//Select mail models is same action as presend
|
||||||
if (GETPOST('modelselected')) {
|
if (GETPOST('modelselected')) {
|
||||||
@ -136,6 +117,25 @@ $permissiondellink = $user->rights->reception->creer; // Used by the include of
|
|||||||
|
|
||||||
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
|
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid = '';
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($origin == 'reception') {
|
||||||
|
$result = restrictedArea($user, $origin, $id);
|
||||||
|
} else {
|
||||||
|
$result = restrictedArea($user, 'reception');
|
||||||
|
if ($origin == 'supplierorder') {
|
||||||
|
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -784,7 +784,7 @@ if ($action == 'create') {
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
|
print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
|
||||||
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -1122,12 +1122,12 @@ if ($action == 'create') {
|
|||||||
if (!empty($product->status_batch)) {
|
if (!empty($product->status_batch)) {
|
||||||
print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>';
|
print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>';
|
||||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||||
print '<td>';
|
print '<td class="nowraponall">';
|
||||||
print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, "");
|
print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, "");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||||
print '<td>';
|
print '<td class="nowraponall">';
|
||||||
print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, "");
|
print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, "");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -1798,7 +1798,7 @@ if ($action == 'create') {
|
|||||||
print '<td>'.$formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).'</td>';
|
print '<td>'.$formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).'</td>';
|
||||||
// Batch number managment
|
// Batch number managment
|
||||||
if ($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)) {
|
if ($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)) {
|
||||||
print '<td> <input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"> </br>';
|
print '<td class="nowraponall"><input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"></br>';
|
||||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||||
print $langs->trans('EatByDate').' : ';
|
print $langs->trans('EatByDate').' : ';
|
||||||
print $form->selectDate($lines[$i]->eatby, 'dlc'.$line_id, '', '', 1, "").'</br>';
|
print $form->selectDate($lines[$i]->eatby, 'dlc'.$line_id, '', '', 1, "").'</br>';
|
||||||
|
|||||||
@ -43,12 +43,6 @@ $id = GETPOST('id', 'int');
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'reception', $id, '');
|
|
||||||
|
|
||||||
$object = new Reception($db);
|
$object = new Reception($db);
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
$object->fetch($id, $ref);
|
$object->fetch($id, $ref);
|
||||||
@ -69,6 +63,24 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
if ($origin == 'reception') {
|
||||||
|
$result = restrictedArea($user, $origin, $object->id);
|
||||||
|
} else {
|
||||||
|
$result = restrictedArea($user, 'reception');
|
||||||
|
if ($origin == 'supplierorder') {
|
||||||
|
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -36,13 +36,21 @@ $hookmanager->initHooks(array('receptionindex'));
|
|||||||
|
|
||||||
$langs->loadLangs(array("orders", "receptions"));
|
$langs->loadLangs(array("orders", "receptions"));
|
||||||
|
|
||||||
|
$reception = new Reception($db);
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'reception', 0, '');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$orderstatic = new CommandeFournisseur($db);
|
$orderstatic = new CommandeFournisseur($db);
|
||||||
$companystatic = new Societe($db);
|
$companystatic = new Societe($db);
|
||||||
$reception = new Reception($db);
|
|
||||||
|
|
||||||
$helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones';
|
$helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones';
|
||||||
llxHeader('', $langs->trans("Reception"), $helpurl);
|
llxHeader('', $langs->trans("Reception"), $helpurl);
|
||||||
|
|||||||
@ -40,13 +40,6 @@ $socid = GETPOST('socid', 'int');
|
|||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
|
||||||
// Security check
|
|
||||||
$receptionid = GETPOST('id', 'int');
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'reception', $receptionid, '');
|
|
||||||
|
|
||||||
$diroutputmassaction = $conf->reception->dir_output.'/temp/massgeneration/'.$user->id;
|
$diroutputmassaction = $conf->reception->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
|
|
||||||
$search_ref_rcp = GETPOST("search_ref_rcp");
|
$search_ref_rcp = GETPOST("search_ref_rcp");
|
||||||
@ -129,6 +122,13 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$receptionid = GETPOST('id', 'int');
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'reception', $receptionid, '');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -33,26 +33,12 @@ if (!empty($conf->projet->enabled)) {
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("receptions");
|
$langs->loadLangs(array("receptions", "companies", "bills", 'deliveries', 'orders', 'stocks', 'other', 'propal'));
|
||||||
$langs->load("companies");
|
|
||||||
$langs->load("bills");
|
|
||||||
$langs->load('deliveries');
|
|
||||||
$langs->load('orders');
|
|
||||||
$langs->load('stocks');
|
|
||||||
$langs->load('other');
|
|
||||||
$langs->load('propal');
|
|
||||||
|
|
||||||
$id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
$id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid = '';
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, $origin, $origin_id);
|
|
||||||
|
|
||||||
$object = new Reception($db);
|
$object = new Reception($db);
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
$object->fetch($id, $ref);
|
$object->fetch($id, $ref);
|
||||||
@ -77,6 +63,24 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
$permissionnote = $user->rights->reception->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->reception->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
if ($origin == 'reception') {
|
||||||
|
$result = restrictedArea($user, $origin, $object->id);
|
||||||
|
} else {
|
||||||
|
$result = restrictedArea($user, 'reception');
|
||||||
|
if ($origin == 'supplierorder') {
|
||||||
|
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -34,11 +34,6 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
|||||||
|
|
||||||
$userid = GETPOST('userid', 'int');
|
$userid = GETPOST('userid', 'int');
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
// Security check
|
|
||||||
if ($user->socid > 0) {
|
|
||||||
$action = '';
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
|
|
||||||
$nowyear = strftime("%Y", dol_now());
|
$nowyear = strftime("%Y", dol_now());
|
||||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||||
@ -46,10 +41,13 @@ $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
|||||||
$startyear = $year - 1;
|
$startyear = $year - 1;
|
||||||
$endyear = $year;
|
$endyear = $year;
|
||||||
|
|
||||||
$langs->load("reception");
|
$langs->loadLangs(array("reception", "other", "companies"));
|
||||||
$langs->load("other");
|
|
||||||
$langs->load("companies");
|
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'reception', 0, '');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -29,6 +29,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
|||||||
|
|
||||||
$year = GETPOST("year", 'int');
|
$year = GETPOST("year", 'int');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'reception', 0, '');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -941,7 +941,8 @@ if (empty($type) || $type == 'c' || $type == 'p') {
|
|||||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= img_picto('', 'category', 'class="pictofixedwidth"');
|
$tmptitle = $langs->trans('Categories');
|
||||||
|
$moreforfilter .= img_picto($tmptile, 'category', 'class="pictofixedwidth"');
|
||||||
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $langs->trans('CustomersProspectsCategoriesShort'));
|
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $langs->trans('CustomersProspectsCategoriesShort'));
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
@ -950,7 +951,8 @@ if (empty($type) || $type == 'f') {
|
|||||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= img_picto('', 'category', 'class="pictofixedwidth"');
|
$tmptitle = $langs->trans('Categories');
|
||||||
|
$moreforfilter .= img_picto($tmptilte, 'category', 'class="pictofixedwidth"');
|
||||||
$moreforfilter .= $formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $langs->trans('SuppliersCategoriesShort'));
|
$moreforfilter .= $formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $langs->trans('SuppliersCategoriesShort'));
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
@ -959,7 +961,8 @@ if (empty($type) || $type == 'f') {
|
|||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
if ($user->rights->societe->client->voir || $socid) {
|
if ($user->rights->societe->client->voir || $socid) {
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= img_picto('', 'user', 'class="pictofixedwidth"');
|
$tmptile = $langs->trans('SalesRepresentatives');
|
||||||
|
$moreforfilter .= img_picto($tmptile, 'user', 'class="pictofixedwidth"');
|
||||||
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $langs->trans('SalesRepresentatives'), ($conf->dol_optimize_smallscreen ? 'maxwidth200' : 'maxwidth300'), 1);
|
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $langs->trans('SalesRepresentatives'), ($conf->dol_optimize_smallscreen ? 'maxwidth200' : 'maxwidth300'), 1);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -954,7 +954,7 @@ if ($resql) {
|
|||||||
|
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['sp.total_ht']['checked'])) {
|
if (!empty($arrayfields['sp.total_ht']['checked'])) {
|
||||||
print '<td class="right">'.price($obj->total_ht)."</td>\n";
|
print '<td class="right"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -965,7 +965,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['sp.total_tva']['checked'])) {
|
if (!empty($arrayfields['sp.total_tva']['checked'])) {
|
||||||
print '<td class="right">'.price($obj->total_tva)."</td>\n";
|
print '<td class="right"><span class="amount">'.price($obj->total_tva)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -976,7 +976,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['sp.total_ttc']['checked'])) {
|
if (!empty($arrayfields['sp.total_ttc']['checked'])) {
|
||||||
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
|
print '<td class="right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1005,21 +1005,21 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['sp.multicurrency_total_ht']['checked'])) {
|
if (!empty($arrayfields['sp.multicurrency_total_ht']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_ht)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount VAT
|
// Amount VAT
|
||||||
if (!empty($arrayfields['sp.multicurrency_total_vat']['checked'])) {
|
if (!empty($arrayfields['sp.multicurrency_total_vat']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_vat)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount TTC
|
// Amount TTC
|
||||||
if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked'])) {
|
if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked'])) {
|
||||||
print '<td class="right nowrap">'.price($obj->multicurrency_total_ttc)."</td>\n";
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -210,7 +210,10 @@ input, select {
|
|||||||
#mainbody input.buttongen, #mainbody button.buttongen {
|
#mainbody input.buttongen, #mainbody button.buttongen {
|
||||||
padding: 3px 4px;
|
padding: 3px 4px;
|
||||||
}
|
}
|
||||||
|
input.button:hover {
|
||||||
|
-webkit-box-shadow: 0px 0px 6px 1px rgb(50 50 50 / 40%), 0px 0px 0px rgb(60 60 60 / 10%);
|
||||||
|
box-shadow: 0px 0px 6px 1px rgb(50 50 50 / 40%), 0px 0px 0px rgb(60 60 60 / 10%);
|
||||||
|
}
|
||||||
input.button:focus {
|
input.button:focus {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
@ -364,7 +367,7 @@ td.rightborder {
|
|||||||
border-right: 1px solid #ccc;
|
border-right: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.amount {
|
td.amount, span.amount, div.amount {
|
||||||
color: #006666;
|
color: #006666;
|
||||||
}
|
}
|
||||||
td.actionbuttons a {
|
td.actionbuttons a {
|
||||||
@ -767,6 +770,19 @@ textarea.centpercent {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
div.urllink {
|
||||||
|
padding: 5px;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
/* border: 1px solid #ccc; */
|
||||||
|
border-radius: 5px;
|
||||||
|
/* width: fit-content; */
|
||||||
|
background-color: #f0f0f8;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
div.urllink, div.urllink a {
|
||||||
|
color: #339 !important;
|
||||||
|
}
|
||||||
|
|
||||||
i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before {
|
i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before {
|
||||||
color: #888 !important;
|
color: #888 !important;
|
||||||
|
|||||||
@ -169,7 +169,7 @@ div.mainmenu.generic4::before {
|
|||||||
.fa-play {
|
.fa-play {
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
.fa-unlink {
|
.fa-link, .fa-unlink {
|
||||||
color: #555;
|
color: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -150,7 +150,7 @@ div.mainmenu.generic4::before {
|
|||||||
.fa-play {
|
.fa-play {
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
.fa-unlink {
|
.fa-link, .fa-unlink {
|
||||||
color: #555;
|
color: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -555,7 +555,7 @@ td.rightborder {
|
|||||||
border-right: 1px solid #ccc;
|
border-right: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.amount {
|
td.amount, span.amount, div.amount {
|
||||||
color: #006666;
|
color: #006666;
|
||||||
}
|
}
|
||||||
td.actionbuttons a {
|
td.actionbuttons a {
|
||||||
@ -896,6 +896,19 @@ textarea.centpercent {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
div.urllink {
|
||||||
|
padding: 5px;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
/* border: 1px solid #ccc; */
|
||||||
|
border-radius: 5px;
|
||||||
|
/* width: fit-content; */
|
||||||
|
background-color: #e0e0e8;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
div.urllink, div.urllink a {
|
||||||
|
color: #339 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.fa-info-circle {
|
.fa-info-circle {
|
||||||
padding-<?php echo $left; ?>: 3px;
|
padding-<?php echo $left; ?>: 3px;
|
||||||
@ -1628,6 +1641,7 @@ td.showDragHandle {
|
|||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 213px;
|
width: 213px;
|
||||||
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
#id-right { /* This must stay id-right and not be replaced with echo $right */
|
#id-right { /* This must stay id-right and not be replaced with echo $right */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -1740,6 +1754,7 @@ body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block
|
|||||||
}
|
}
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
/* For smartphone (testmenuhider is on) */
|
/* For smartphone (testmenuhider is on) */
|
||||||
<?php if (in_array($conf->browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
|
<?php if (in_array($conf->browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
|
||||||
#id-container {
|
#id-container {
|
||||||
@ -1803,6 +1818,7 @@ div.login_block {
|
|||||||
z-index: 91;
|
z-index: 91;
|
||||||
background: rgb(<?php echo $colorbackvmenu1; ?>);
|
background: rgb(<?php echo $colorbackvmenu1; ?>);
|
||||||
border-right: 1px solid rgba(0,0,0,0.3);
|
border-right: 1px solid rgba(0,0,0,0.3);
|
||||||
|
padding-top: 20px;
|
||||||
<?php
|
<?php
|
||||||
if (in_array($conf->browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
|
if (in_array($conf->browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
|
||||||
top: 50px ! important;
|
top: 50px ! important;
|
||||||
@ -2619,7 +2635,7 @@ div.login_block {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
background: rgb(<?php echo $colorbackvmenu1; ?>);
|
background: rgb(<?php echo $colorbackvmenu1; ?>);
|
||||||
width: 228px;
|
width: 228px;
|
||||||
height: 45px;
|
height: 70px;
|
||||||
<?php if (GETPOST('optioncss', 'aZ09') == 'print') { ?>
|
<?php if (GETPOST('optioncss', 'aZ09') == 'print') { ?>
|
||||||
display: none;
|
display: none;
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -2640,13 +2656,13 @@ div.login a:hover {
|
|||||||
text-decoration:underline;
|
text-decoration:underline;
|
||||||
}
|
}
|
||||||
div.login_block_user, div.login_block_other { clear: both; }
|
div.login_block_user, div.login_block_other { clear: both; }
|
||||||
div.login_block_other { padding-top: 3px; }
|
div.login_block_other { padding-top: 15px; }
|
||||||
|
|
||||||
.topnav div.login_block_user {
|
.topnav div.login_block_user {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
line-height: <?php echo $disableimages ? '25' : '50'; ?>px;
|
line-height: <?php echo $disableimages ? '25' : '70'; ?>px;
|
||||||
height: <?php echo $disableimages ? '25' : '50'; ?>px;
|
height: <?php echo $disableimages ? '25' : '70'; ?>px;
|
||||||
}
|
}
|
||||||
.topnav div.login_block_other {
|
.topnav div.login_block_other {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@ -2768,6 +2784,7 @@ div.vmenu, td.vmenu {
|
|||||||
#menu_contenu_logo { padding-right: 4px; }
|
#menu_contenu_logo { padding-right: 4px; }
|
||||||
.companylogo { padding-top: 4px; }
|
.companylogo { padding-top: 4px; }
|
||||||
.searchform { padding-top: 10px; }
|
.searchform { padding-top: 10px; }
|
||||||
|
.searchform .bordertransp { border: 0; }
|
||||||
|
|
||||||
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu, span.vsmenu { white-space: nowrap; font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; }
|
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu, span.vsmenu { white-space: nowrap; font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; }
|
||||||
font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; white-space: nowrap; }
|
font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; white-space: nowrap; }
|
||||||
|
|||||||
@ -40,12 +40,6 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$actionid = GETPOST('actionid');
|
$actionid = GETPOST('actionid');
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid) {
|
|
||||||
$id = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'societe', '', '');
|
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
@ -74,6 +68,12 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
$permissiontoadd = (($object->id == $user->id) || (!empty($user->rights->user->user->lire)));
|
$permissiontoadd = (($object->id == $user->id) || (!empty($user->rights->user->user->lire)));
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid) {
|
||||||
|
$id = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'user', '', '');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user