Merge branch 'Dolibarr:develop' into SELECT_PRODUITS_LIST

This commit is contained in:
marcusdeangabriel 2023-03-15 08:43:04 +01:00 committed by GitHub
commit f38a87e971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 2069 additions and 1556 deletions

View File

@ -113,15 +113,15 @@ class DolibarrApiAccess implements iAuthenticate
$sql = "SELECT u.login, u.datec, u.api_key, ";
$sql .= " u.tms as date_modification, u.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.api_key = '".$this->db->escape($api_key)."'";
// TODO Check if 2 users has same API key.
$sql .= " WHERE u.api_key = '".$this->db->escape($api_key)."' OR u.api_key = '".$this->db->escape(dolEncrypt($api_key, '', '', 'dolibarr'))."'";
$result = $this->db->query($sql);
if ($result) {
if ($this->db->num_rows($result)) {
$nbrows = $this->db->num_rows($result);
if ($nbrows == 1) {
$obj = $this->db->fetch_object($result);
$login = $obj->login;
$stored_key = $obj->api_key;
$stored_key = dolDecrypt($obj->api_key);
$userentity = $obj->entity;
if (!defined("DOLENTITY") && $conf->entity != ($obj->entity ? $obj->entity : 1)) { // If API was not forced with HTTP_DOLENTITY, and user is on another entity, so we reset entity to entity of user
@ -130,6 +130,8 @@ class DolibarrApiAccess implements iAuthenticate
dol_syslog("Entity was not set on http header with HTTP_DOLAPIENTITY (recommanded for performance purpose), so we switch now on entity of user (".$conf->entity.") and we have to reload configuration.", LOG_WARNING);
$conf->setValues($this->db);
}
} elseif ($nbrows > 1) {
throw new RestException(503, 'Error when fetching user api_key : More than 1 user with this apikey');
}
} else {
throw new RestException(503, 'Error when fetching user api_key :'.$this->db->error_msg);

View File

@ -18,6 +18,7 @@
use Luracast\Restler\RestException;
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
/**
@ -152,7 +153,7 @@ class Login
// We store API token into database
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
$sql .= " SET api_key = '".$this->db->escape($token)."'";
$sql .= " SET api_key = '".$this->db->escape(dolEncrypt($token, '', '', 'dolibarr'))."'";
$sql .= " WHERE login = '".$this->db->escape($login)."'";
dol_syslog(get_class($this)."::login", LOG_DEBUG); // No log

View File

@ -155,9 +155,6 @@ if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) {
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
$result = restrictedArea($user, 'agenda', $object->id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);

View File

@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
/* Copyright (C) 2023 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
@ -71,7 +70,7 @@ if (!$sortorder) {
$object = new Propal($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->propal->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('myobjectagenda', 'globalcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('propalagenda', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View File

@ -955,6 +955,8 @@ if (empty($reshook)) {
$price_ttc = '';
$price_ttc_devise = '';
// TODO Implement if (getDolGlobalInt('MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES'))
if (GETPOST('price_ht') !== '') {
$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
}

View File

@ -871,6 +871,8 @@ class Propal extends CommonObject
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
// TODO Implement if (getDolGlobalInt('MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES')) ?
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];

255
htdocs/commande/agenda.php Normal file
View File

@ -0,0 +1,255 @@
<?php
/* Copyright (C) 2023 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/>.
*/
/**
* \file htdocs/commande/agenda.php
* \ingroup commande
* \brief Tab of events on Sale Orders
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("order", "other"));
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
if (GETPOST('actioncode', 'array')) {
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_rowid = GETPOST('search_rowid');
$search_agenda_label = GETPOST('search_agenda_label');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) {
$page = 0;
} // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) {
$sortfield = 'a.datep,a.id';
}
if (!$sortorder) {
$sortorder = 'DESC,DESC';
}
// Initialize technical objects
$object = new Commande($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('orderagenda', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->commande->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
}
$permissiontoread = $user->hasRight("commande", "lire");
$permissiontoadd = $user->hasRight("commande", "creer");
// Security check
if (!empty($user->socid)) {
$socid = $user->socid;
}
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'commande', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
/*
* Actions
*/
$parameters = array('id'=>$id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
// Cancel
if (GETPOST('cancel', 'alpha') && !empty($backtopage)) {
header("Location: ".$backtopage);
exit;
}
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$actioncode = '';
$search_agenda_label = '';
}
}
/*
* View
*/
$form = new Form($db);
if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
llxHeader('', $title, $help_url);
if (isModEnabled('notification')) {
$langs->load("mails");
}
$head = commande_prepare_head($object);
print dol_get_fiche_head($head, 'agenda', $langs->trans("Order"), -1, $object->picto);
// Object card
// ------------------------------------------------------------
$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
// Ref customer
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
// Project
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>';
if (0) {
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref .= $proj->getNomUrl(1);
if ($proj->title) {
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
}
}
}
}
$morehtmlref .= '</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$object->info($object->id);
dol_print_object_info($object, 1);
print '</div>';
print dol_get_fiche_end();
// Actions buttons
$objthirdparty = $object;
$objcon = new stdClass();
$out = '&origin='.urlencode($object->element.(property_exists($object, 'module') ? '@'.$object->module : '')).'&originid='.urlencode($object->id);
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
$out .= '&backtopage='.urlencode($urlbacktopage);
$permok = $user->rights->agenda->myactions->create;
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') {
$out .= '&socid='.urlencode($objthirdparty->id);
}
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '');
//$out.=$langs->trans("AddAnAction").' ';
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
//$out.="</a>";
}
$morehtmlright = '';
//$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id;
//$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
//$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
//$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
if (isModEnabled('agenda')) {
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
} else {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
}
}
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
print '<br>';
$param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : '');
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
// Try to know count of actioncomm from cache
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
$cachekey = 'count_events_commande_'.$object->id;
$nbEvent = dol_getcache($cachekey);
print_barre_liste($langs->trans("ActionsOnOrder").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
//print_barre_liste($langs->trans("ActionsOnOrder"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
// List of all actions
$filters = array();
$filters['search_agenda_label'] = $search_agenda_label;
$filters['search_rowid'] = $search_rowid;
// TODO Replace this with same code than into list.php
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, property_exists($object, 'module') ? $object->module : '');
}
}
// End of page
llxFooter();
$db->close();

View File

@ -2976,10 +2976,14 @@ if ($action == 'create' && $usercancreate) {
print '</div><div class="fichehalfright">';
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'order', $socid, 1);
$somethingshown = $formactions->showactions($object, 'order', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
print '</div></div>';
}

View File

@ -1,129 +0,0 @@
<?php
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* 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/>.
*/
/**
* \file htdocs/commande/info.php
* \ingroup commande
* \brief Sale Order info page
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
if (!$user->rights->commande->lire) {
accessforbidden();
}
// Load translation files required by the page
$langs->loadLangs(array('orders', 'sendings', 'bills'));
$socid = 0;
$comid = GETPOST("id", 'int');
$id = GETPOST("id", 'int');
$ref = GETPOST('ref', 'alpha');
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'commande', $comid, '');
$usercancreate = $user->hasRight("commande", "creer");
$object = new Commande($db);
if (!$object->fetch($id, $ref) > 0) {
dol_print_error($db);
exit;
}
/*
* View
*/
$form = new Form($db);
$title = $langs->trans('Order')." - ".$langs->trans('Info');
$help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge';
llxHeader('', $title, $help_url);
$object->fetch_thirdparty();
$object->info($object->id);
$head = commande_prepare_head($object);
print dol_get_fiche_head($head, 'info', $langs->trans("CustomerOrder"), -1, 'order');
// Order card
$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
// Ref customer
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
// Project
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>';
if (0) {
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref .= $proj->getNomUrl(1);
if ($proj->title) {
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
}
}
}
}
$morehtmlref .= '</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table width="100%"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
print dol_get_fiche_end();
// End of page
llxFooter();
$db->close();

View File

@ -223,6 +223,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
$error = 0;
/*
@ -1284,24 +1285,24 @@ if ($resql) {
if ($permissiontovalidate) {
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
}
if ($permissiontosendbymail) {
$arrayofmassactions['presend'] = img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail");
}
if ($permissiontoclose) {
$arrayofmassactions['preshipped'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').$langs->trans("ClassifyShipped");
}
if ($permissiontocancel) {
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
}
if (isModEnabled('facture') && $user->hasRight("facture", "creer")) {
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
}
if ($permissiontoclose) {
$arrayofmassactions['setbilled'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("ClassifyBilled");
}
if ($permissiontocancel) {
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
}
if ($permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (isModEnabled('facture') && $user->hasRight("facture", "creer")) {
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
}
if ($permissiontosendbymail) {
$arrayofmassactions['presend'] = img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail");
}
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) {
$arrayofmassactions = array();
}

View File

@ -0,0 +1,255 @@
<?php
/* Copyright (C) 2023 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/>.
*/
/**
* \file htdocs/compta/facture/agenda.php
* \ingroup facture
* \brief Tab of events on Invoices
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("facture", "other"));
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
if (GETPOST('actioncode', 'array')) {
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_rowid = GETPOST('search_rowid');
$search_agenda_label = GETPOST('search_agenda_label');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) {
$page = 0;
} // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) {
$sortfield = 'a.datep,a.id';
}
if (!$sortorder) {
$sortorder = 'DESC,DESC';
}
// Initialize technical objects
$object = new Facture($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->facture->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('invoiceagenda', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->facture->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
}
$permissiontoread = $user->hasRight("facture", "lire");
$permissiontoadd = $user->hasRight("facture", "creer");
// Security check
if (!empty($user->socid)) {
$socid = $user->socid;
}
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
/*
* Actions
*/
$parameters = array('id'=>$id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
// Cancel
if (GETPOST('cancel', 'alpha') && !empty($backtopage)) {
header("Location: ".$backtopage);
exit;
}
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$actioncode = '';
$search_agenda_label = '';
}
}
/*
* View
*/
$form = new Form($db);
if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
llxHeader('', $title, $help_url);
if (isModEnabled('notification')) {
$langs->load("mails");
}
$head = facture_prepare_head($object);
print dol_get_fiche_head($head, 'agenda', $langs->trans("Invoice"), -1, $object->picto);
// Object card
// ------------------------------------------------------------
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
// Ref customer
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
// Project
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>';
if (0) {
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref .= $proj->getNomUrl(1);
if ($proj->title) {
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
}
}
}
}
$morehtmlref .= '</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$object->info($object->id);
dol_print_object_info($object, 1);
print '</div>';
print dol_get_fiche_end();
// Actions buttons
$objthirdparty = $object;
$objcon = new stdClass();
$out = '&origin='.urlencode($object->element.(property_exists($object, 'module') ? '@'.$object->module : '')).'&originid='.urlencode($object->id);
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
$out .= '&backtopage='.urlencode($urlbacktopage);
$permok = $user->rights->agenda->myactions->create;
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') {
$out .= '&socid='.urlencode($objthirdparty->id);
}
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '');
//$out.=$langs->trans("AddAnAction").' ';
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
//$out.="</a>";
}
$morehtmlright = '';
//$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id;
//$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
//$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
//$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
if (isModEnabled('agenda')) {
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
} else {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
}
}
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
print '<br>';
$param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : '');
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
// Try to know count of actioncomm from cache
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
$cachekey = 'count_events_facture_'.$object->id;
$nbEvent = dol_getcache($cachekey);
print_barre_liste($langs->trans("ActionsOnBill").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
//print_barre_liste($langs->trans("ActionsOnBill"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
// List of all actions
$filters = array();
$filters['search_agenda_label'] = $search_agenda_label;
$filters['search_rowid'] = $search_rowid;
// TODO Replace this with same code than into list.php
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, property_exists($object, 'module') ? $object->module : '');
}
}
// End of page
llxFooter();
$db->close();

View File

@ -5809,10 +5809,14 @@ if ($action == 'create') {
print '</div><div class="fichehalfright">';
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/compta/facture/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'invoice', $socid, 1);
$somethingshown = $formactions->showactions($object, 'invoice', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
print '</div></div>';
}

View File

@ -1,144 +0,0 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* 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/>.
*/
/**
* \file htdocs/compta/facture/info.php
* \ingroup facture
* \brief Page des informations d'une facture
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
// Load translation files required by the page
$langs->loadLangs(array('companies', 'bills'));
$id = GETPOST("facid", "int");
$ref = GETPOST("ref", 'alpha');
$object = new Facture($db);
$extrafields = new ExtraFields($db);
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
// Load object
if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref, '', '', (!empty($conf->global->INVOICE_USE_SITUATION) ? $conf->global->INVOICE_USE_SITUATION : 0));
}
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
$usercancreate = $user->hasRight("facture", "creer");
/*
* View
*/
$form = new Form($db);
$title = $object->ref." - ".$langs->trans('Info');
$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $help_url);
if (empty($object->id)) {
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$object->fetch_thirdparty();
$object->info($object->id);
$head = facture_prepare_head($object);
print dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill');
$totalpaid = $object->getSommePaiement();
// Invoice content
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
// Ref customer
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>';
if (0) {
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref .= $proj->getNomUrl(1);
if ($proj->title) {
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
}
}
}
}
$morehtmlref .= '</div>';
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table class="centpercent"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
print dol_get_fiche_end();
// End of page
llxFooter();
$db->close();

View File

@ -1035,7 +1035,7 @@ while ($i < $imaxinloop) {
// Status
if (!empty($arrayfields['status']['checked'])) {
print '<td class="center">';
print $invoicerectmp->getLibStatut(3, 0);
print $invoicerectmp->getLibStatut(5, 0);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;

View File

@ -112,6 +112,7 @@ $search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'alpha');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_company_code_client = GETPOST("search_type_thirdparty", 'alpha');
$search_user = GETPOST('search_user', 'int');
$search_sale = GETPOST('search_sale', 'int');
$search_date_startday = GETPOST('search_date_startday', 'int');

View File

@ -36,7 +36,7 @@ if (!defined('NOREQUIREAJAX')) {
if (!defined('NOREQUIRESOC')) {
define('NOREQUIRESOC', '1');
}
// We need langs because the getRandomPassword may use user language to define some rules of pass generation
// We need langs because the getRandomPassword may use the user language to define some rules of pass generation
/*if (!defined('NOREQUIRETRAN')) {
define('NOREQUIRETRAN', '1');
}*/

View File

@ -32,6 +32,7 @@
use OAuth\Common\Storage\DoliStorage;
use OAuth\Common\Consumer\Credentials;
/**
* Class to send emails (with attachments or not)
* Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext,$replyto);
@ -171,6 +172,10 @@ class CMailFile
{
global $conf, $dolibarr_main_data_root, $user;
dol_syslog("CMailFile::CMailfile: charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, replyto=$replyto trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG);
dol_syslog("CMailFile::CMailfile: subject=".$subject.", deliveryreceipt=".$deliveryreceipt.", msgishtml=".$msgishtml, LOG_DEBUG);
// Clean values of $mimefilename_list
if (is_array($mimefilename_list)) {
foreach ($mimefilename_list as $key => $val) {
@ -214,9 +219,6 @@ class CMailFile
// On defini alternative_boundary
$this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars)
dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, replyto=$replyto trackid=$trackid sendcontext=$sendcontext upload_dir_tmp=$upload_dir_tmp", LOG_DEBUG);
dol_syslog("CMailFile::CMailfile: subject=".$subject.", deliveryreceipt=".$deliveryreceipt.", msgishtml=".$msgishtml, LOG_DEBUG);
if (empty($subject)) {
dol_syslog("CMailFile::CMailfile: Try to send an email with empty subject");
$this->error = 'ErrorSubjectIsRequired';
@ -367,6 +369,8 @@ class CMailFile
}
}
dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." addr_bcc=$addr_bcc, replyto=$replyto", LOG_DEBUG);
// We set all data according to choosed sending method.
// We also set a value for ->msgid
if ($this->sendmode == 'mail') {

View File

@ -6184,13 +6184,15 @@ abstract class CommonObject
// If field is a computed field, value must become result of compute (regardless of whether a row exists
// in the element's extrafields table)
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
//var_dump($conf->disable_compute);
if (empty($conf->disable_compute)) {
global $objectoffield; // We set a global variable to $objectoffield so
$objectoffield = $this; // we can use it inside computed formula
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '');
if (is_array($extrafields->attributes[$this->table_element]['label'])) {
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
//var_dump($conf->disable_compute);
if (empty($conf->disable_compute)) {
global $objectoffield; // We set a global variable to $objectoffield so
$objectoffield = $this; // we can use it inside computed formula
$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '');
}
}
}
}

View File

@ -1346,6 +1346,8 @@ class Form
$out .= img_picto($langs->trans("Search"), 'search');
}
$out .= ajax_event($htmlname, $events);
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
} else {
// Immediate load of all database

View File

@ -190,14 +190,10 @@ class FormActions
$num = count($listofactions);
if ($num || $forceshowtitle) {
if ($typeelement == 'invoice') {
$title = $langs->trans('ActionsOnBill');
} elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') {
if ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') {
$title = $langs->trans('ActionsOnBill');
} elseif ($typeelement == 'supplier_proposal') {
$title = $langs->trans('ActionsOnSupplierProposal');
} elseif ($typeelement == 'order') {
$title = $langs->trans('ActionsOnOrder');
} elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') {
$title = $langs->trans('ActionsOnOrder');
} elseif ($typeelement == 'shipping') {

View File

@ -436,7 +436,7 @@ class FormTicket
$toolbarname = 'dolibarr_notes';
if ($this->ispublic) {
$toolbarname = 'dolibarr_details';
print '<div class="warning">'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'))).'</div>';
print '<div class="warning hideonsmartphone">'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'))).'</div>';
}
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$uselocalbrowser = true;
@ -464,7 +464,7 @@ class FormTicket
if (count($cate_arbo)) {
// Categories
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
print '<tr><td class="wordbreak">'.$langs->trans("Categories").'</td><td>';
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}

View File

@ -526,24 +526,46 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
}
$msg .= ';'."\n";
if (is_array($events) && count($events)) { // If an array of js events to do were provided.
$msg .= '
$msg .= '});'."\n";
$msg .= "</script>\n";
$msg .= ajax_event($htmlname, $events);
return $msg;
}
/**
* Add event management script.
*
* @param string $htmlname Name of html select field ('myid' or '.myclass')
* @param array $events Add some Ajax events option on change of $htmlname component to call ajax to autofill a HTML element (select#htmlname and #inputautocompletehtmlname)
* Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @return string Return JS string to manage event
*/
function ajax_event($htmlname, $events)
{
$out = '';
if (is_array($events) && count($events)) { // If an array of js events to do were provided.
$out = '<!-- JS code to manage event for id = ' . $htmlname . ' -->
<script>
$(document).ready(function () {
jQuery("#'.$htmlname.'").change(function () {
var obj = '.json_encode($events).';
var obj = '.json_encode($events) . ';
$.each(obj, function(key,values) {
if (values.method.length) {
runJsCodeForEvent'.$htmlname.'(values);
}
});
});
function runJsCodeForEvent'.$htmlname.'(obj) {
var id = $("#'.$htmlname.'").val();
var method = obj.method;
var url = obj.url;
var htmlname = obj.htmlname;
var showempty = obj.showempty;
console.log("Run runJsCodeForEvent-'.$htmlname.' from ajax_combobox id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname);
console.log("Run runJsCodeForEvent-'.$htmlname.' from ajax_combobox id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname);
$.getJSON(url,
{
action: method,
@ -567,7 +589,7 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
var selecthtml_str = response.value;
var selecthtml_dom=$.parseHTML(selecthtml_str);
if (typeof(selecthtml_dom[0][0]) !== \'undefined\') {
$("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
$("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
}
} else {
$("#inputautocomplete"+htmlname).val("");
@ -575,15 +597,15 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
$("select#" + htmlname).change(); /* Trigger event change */
}
);
}';
}
});
</script>';
}
$msg .= '});'."\n";
$msg .= "</script>\n";
return $msg;
return $out;
}
/**
* On/off button for constant
*

View File

@ -1644,11 +1644,21 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
if ($filterobj->id) {
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
}
} elseif (is_object($filterobj) && get_class($filterobj) == 'Commande') {
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order'";
if ($filterobj->id) {
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
}
} elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') {
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
if ($filterobj->id) {
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
}
} elseif (is_object($filterobj) && get_class($filterobj) == 'Facture') {
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice'";
if ($filterobj->id) {
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
}
} elseif (is_object($filterobj) && get_class($filterobj) == 'Product') {
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
if ($filterobj->id) {

View File

@ -11685,7 +11685,10 @@ function dolForgeCriteriaCallback($matches)
return '';
}
$operator = strtoupper(preg_replace('/[^a-z<>=]/i', '', trim($tmp[1])));
$operand = preg_replace('/[^a-z0-9\._]/i', '', trim($tmp[0]));
$operator = strtoupper(preg_replace('/[^a-z<>!=]/i', '', trim($tmp[1])));
if ($operator == 'NOTLIKE') {
$operator = 'NOT LIKE';
}
@ -11723,7 +11726,7 @@ function dolForgeCriteriaCallback($matches)
}
}
return $db->escape($tmp[0]).' '.strtoupper($operator).' '.$tmpescaped;
return $db->escape($operand).' '.strtoupper($operator).' '.$tmpescaped;
}

View File

@ -35,19 +35,19 @@
*/
function facture_prepare_head($object)
{
global $db, $langs, $conf;
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/card.php?id='.$object->id;
$head[$h][1] = $langs->trans('CustomerInvoice');
$head[$h][2] = 'compta';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.urlencode($object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?id='.urlencode($object->id);
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
@ -73,7 +73,7 @@ function facture_prepare_head($object)
}
$langs->load("banks");
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.urlencode($object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?id='.urlencode($object->id);
$head[$h][1] = $langs->trans('StandingOrders');
if ($nbStandingOrders > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbStandingOrders.'</span>';
@ -96,7 +96,7 @@ function facture_prepare_head($object)
if (!empty($object->note_public)) {
$nbNote++;
}
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
@ -110,7 +110,7 @@ function facture_prepare_head($object)
$upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
if (($nbFiles + $nbLinks) > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
@ -118,9 +118,39 @@ function facture_prepare_head($object)
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$nbEvent = 0;
// Enable caching of thirdparty count actioncomm
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
$cachekey = 'count_events_facture_'.$object->id;
$dataretrieved = dol_getcache($cachekey);
if (!is_null($dataretrieved)) {
$nbEvent = $dataretrieved;
} else {
$sql = "SELECT COUNT(id) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
$sql .= " WHERE fk_element = ".((int) $object->id);
$sql .= " AND elementtype = 'invoice'";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
$nbEvent = $obj->nb;
} else {
dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
}
dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
}
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
if ($nbEvent > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
}
}
$head[$h][2] = 'agenda';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'external');

View File

@ -128,9 +128,39 @@ function commande_prepare_head(Commande $object)
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$head[$h][0] = DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$nbEvent = 0;
// Enable caching of thirdparty count actioncomm
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
$cachekey = 'count_events_propal_'.$object->id;
$dataretrieved = dol_getcache($cachekey);
if (!is_null($dataretrieved)) {
$nbEvent = $dataretrieved;
} else {
$sql = "SELECT COUNT(id) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
$sql .= " WHERE fk_element = ".((int) $object->id);
$sql .= " AND elementtype = 'order'";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
$nbEvent = $obj->nb;
} else {
dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
}
dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
}
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
if ($nbEvent > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
}
}
$head[$h][2] = 'agenda';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'external');

View File

@ -146,7 +146,7 @@ function payment_supplier_prepare_head(Paiement $object)
*/
function getValidOnlinePaymentMethods($paymentmethod = '')
{
global $conf, $langs, $hookmanager, $action;
global $langs, $hookmanager, $action;
$validpaymentmethod = array();
@ -434,6 +434,8 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
{
global $conf;
$reg = array();
// Juridical status
$line1 = "";
if ($fromcompany->forme_juridique_code) {
@ -485,9 +487,8 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
print '<!-- htmlPrintOnlinePaymentFooter -->'."\n";
print '<footer class="center paddingleft paddingright centpercent">'."\n";
print '<br>';
print '<div class="center paddingleft paddingright">'."\n";
if ($addformmessage) {
print '<!-- object = '.(empty($object) ? 'undefined' : $object->element).' -->';
print '<br>';
@ -519,5 +520,6 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
print ' - ';
}
print $line2;
print '</span></div>'."\n";
print '</span>';
print '</footer>'."\n";
}

View File

@ -725,11 +725,16 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height)
$filepath = $conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF;
if (file_exists($filepath)) {
$pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image
if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF_ALPHA')) { $pdf->SetAlpha($conf->global->MAIN_USE_BACKGROUND_ON_PDF_ALPHA); } // Option for change opacity of background
$pdf->Image($filepath, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_X : 0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y : 0), 0, $page_height);
if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF_ALPHA')) { $pdf->SetAlpha(1); }
$pdf->SetPageMark(); // This option avoid to have the images missing on some pages
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
}
}
if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND') != '-1') {
$pdf->SetPageMark(); // This option avoid to have the images missing on some pages
}
}
@ -1247,49 +1252,52 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
$pdf->SetY(-$posy);
// Hide footer line if footer background color is set
if (!getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) {
$pdf->line($dims['lm'], $dims['hk'] - $posy, $dims['wk'] - $dims['rm'], $dims['hk'] - $posy);
}
// Option for hide all footer (page number will no hidden)
if (!getDolGlobalInt('PDF_FOOTER_HIDDEN')) {
// Hide footer line if footer background color is set
if (!getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) {
$pdf->line($dims['lm'], $dims['hk'] - $posy, $dims['wk'] - $dims['rm'], $dims['hk'] - $posy);
}
// Option for set top margin height of footer after freetext
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) {
$posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN'));
} else {
$posy--;
}
// Option for set top margin height of footer after freetext
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) {
$posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN'));
} else {
$posy--;
}
if (!empty($line1)) {
$pdf->SetFont('', 'B', 7);
$pdf->SetXY($dims['lm'], -$posy);
$pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line1, 0, 'C', 0);
$posy -= 3;
$pdf->SetFont('', '', 7);
}
if (!empty($line1)) {
$pdf->SetFont('', 'B', 7);
$pdf->SetXY($dims['lm'], -$posy);
$pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line1, 0, 'C', 0);
$posy -= 3;
$pdf->SetFont('', '', 7);
}
if (!empty($line2)) {
$pdf->SetFont('', 'B', 7);
$pdf->SetXY($dims['lm'], -$posy);
$pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line2, 0, 'C', 0);
$posy -= 3;
$pdf->SetFont('', '', 7);
}
if (!empty($line2)) {
$pdf->SetFont('', 'B', 7);
$pdf->SetXY($dims['lm'], -$posy);
$pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line2, 0, 'C', 0);
$posy -= 3;
$pdf->SetFont('', '', 7);
}
if (!empty($line3)) {
$pdf->SetXY($dims['lm'], -$posy);
$pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line3, 0, 'C', 0);
}
if (!empty($line3)) {
$pdf->SetXY($dims['lm'], -$posy);
$pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line3, 0, 'C', 0);
}
if (!empty($line4)) {
$posy -= 3;
$pdf->SetXY($dims['lm'], -$posy);
$pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line4, 0, 'C', 0);
if (!empty($line4)) {
$posy -= 3;
$pdf->SetXY($dims['lm'], -$posy);
$pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line4, 0, 'C', 0);
}
}
}
}
// Show page nb only on iso languages (so default Helvetica font)
// if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') {
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18, -$posy);
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
// $pdf->MultiCell(18, 2, $pdf->getPageNumGroupAlias().' / '.$pdf->getPageGroupAlias(), 0, 'R', 0);
// $pdf->MultiCell(18, 2, $pdf->PageNo().' / '.$pdf->getAliasNbPages(), 0, 'R', 0); // doesn't works with all fonts
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell

View File

@ -113,10 +113,11 @@ function dolGetRandomBytes($length)
* @param string $chain string to encode
* @param string $key If '', we use $dolibarr_main_instance_unique_id
* @param string $ciphering Default ciphering algorithm
* @param string $forceseed To force the seed
* @return string encoded string
* @see dolDecrypt(), dol_hash()
*/
function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed = '')
{
global $dolibarr_main_instance_unique_id;
global $dolibarr_disable_dolcrypt_for_debug;
@ -134,6 +135,9 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
if (empty($key)) {
$key = $dolibarr_main_instance_unique_id;
}
if (empty($ciphering)) {
$ciphering = 'AES-256-CTR';
}
$newchain = $chain;
@ -145,7 +149,11 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
if ($ivlen === false || $ivlen < 1 || $ivlen > 32) {
$ivlen = 16;
}
$ivseed = dolGetRandomBytes($ivlen);
if (empty($forceseed)) {
$ivseed = dolGetRandomBytes($ivlen);
} else {
$ivseed = dol_trunc(md5($forceseed), $ivlen, 'right', 'UTF-8', 1);
}
$newchain = openssl_encrypt($chain, $ciphering, $key, 0, $ivseed);
return 'dolcrypt:'.$ciphering.':'.$ivseed.':'.$newchain;
@ -260,7 +268,7 @@ function dol_verifyHash($chain, $hash, $type = '0')
global $conf;
if ($type == '0' && !empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'password_hash' && function_exists('password_verify')) {
if ($hash[0] == '$') {
if (! empty($hash[0]) && $hash[0] == '$') {
return password_verify($chain, $hash);
} elseif (strlen($hash) == 32) {
return dol_verifyHash($chain, $hash, '3'); // md5

View File

@ -581,6 +581,9 @@ function dolJSToSetRandomPassword($htmlname, $htmlnameofbutton = 'generate_token
token: \''.dol_escape_js(newToken()).'\'
},
function(result) {
if ($("input#'.dol_escape_js($htmlname).'").attr("type") == "password") {
$("input#'.dol_escape_js($htmlname).'").attr("type", "text");
}
$("#'.dol_escape_js($htmlname).'").val(result);
});
});

View File

@ -203,7 +203,7 @@ function generate_random_id($car = 16)
}
/**
* Show header for public pages
* Show http header, open body tag and show HTML header banner for public pages for tickets
*
* @param string $title Title
* @param string $head Head array
@ -216,11 +216,14 @@ function generate_random_id($car = 16)
function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '')
{
global $user, $conf, $langs, $mysoc;
$urllogo = "";
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, 1); // Show html headers
print '<body id="mainbody" class="publicnewticketform">';
print '<div class="center">';
print '<div class="publicnewticketform2 flexcontainer centpercent" style="min-height: 100%;">';
print '<header class="center centpercent">';
// Define urllogo
if (getDolGlobalInt('TICKET_SHOW_COMPANY_LOGO') || getDolGlobalString('TICKET_PUBLIC_INTERFACE_TOPIC')) {
@ -239,21 +242,21 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
}
// Output html code for logo
if ($urllogo || getDolGlobalInt('TICKET_PUBLIC_INTERFACE_TOPIC')) {
if ($urllogo || getDolGlobalString('TICKET_PUBLIC_INTERFACE_TOPIC')) {
print '<div class="backgreypublicpayment">';
print '<div class="logopublicpayment">';
if ($urllogo) {
print '<a href="'.(getDolGlobalInt('TICKET_URL_PUBLIC_INTERFACE') ? getDolGlobalInt('TICKET_URL_PUBLIC_INTERFACE') : dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 1)).'">';
print '<a href="'.(getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') : dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 1)).'">';
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
print '>';
print '</a>';
}
if (getDolGlobalInt('TICKET_PUBLIC_INTERFACE_TOPIC')) {
if (getDolGlobalString('TICKET_PUBLIC_INTERFACE_TOPIC')) {
print '<div class="clearboth"></div><strong>'.(getDolGlobalString('TICKET_PUBLIC_INTERFACE_TOPIC') ? getDolGlobalString('TICKET_PUBLIC_INTERFACE_TOPIC') : $langs->trans("TicketSystem")).'</strong>';
}
print '</div>';
if (!getDolGlobalInt('MAIN_HIDE_POWERED_BY')) {
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
print '<div class="poweredbypublicpayment opacitymedium right hideonsmartphone"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
}
print '</div>';
}
@ -264,7 +267,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '</div>';
}
print '</div>';
print '</header>';
print '<div class="ticketlargemargin">';
//print '<div class="ticketlargemargin">';
}

View File

@ -412,7 +412,7 @@ if ($nolinesbefore) {
</td>
<?php
}
if (!empty($inputalsopricewithtax)) {
if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) {
$coldisplay++;
?>
<td class="nobottom linecoluttc right">

View File

@ -228,9 +228,13 @@ $coldisplay++;
print '<td class="right"><input rel="'.$object->multicurrency_tx.'" type="text" class="flat right" size="5" id="multicurrency_subprice" name="multicurrency_subprice" value="'.(GETPOSTISSET('multicurrency_subprice') ? GETPOST('multicurrency_subprice', 'alpha') : price($line->multicurrency_subprice)).'" /></td>';
}
if ($inputalsopricewithtax) {
if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) {
$coldisplay++;
print '<td class="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(GETPOSTISSET('price_ttc') ? GETPOST('price_ttc') : (isset($line->pu_ttc) ? price($line->pu_ttc, 0, '', 0) : '')).'"';
$upinctax = isset($line->pu_ttc) ? $line->pu_ttc : null;
if (getDolGlobalInt('MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES')) {
$upinctax = price2num($line->total_ttc / $line->qty, 'MU');
}
print '<td class="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(GETPOSTISSET('price_ttc') ? GETPOST('price_ttc') : (isset($upinctax) ? price($upinctax, 0, '', 0) : '')).'"';
if ($situationinvoicelinewithparent) {
print ' readonly';
}

View File

@ -92,7 +92,7 @@ if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currenc
print '<th class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</th>';
}
if ($inputalsopricewithtax) {
if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) {
print '<th class="right nowraponall">'.$langs->trans('PriceUTTC').'</th>';
}

View File

@ -325,8 +325,14 @@ print $tooltiponpriceend;
<td class="linecoluht_currency nowraponall right"><?php $coldisplay++; ?><?php print price($sign * $line->multicurrency_subprice); ?></td>
<?php }
if ($inputalsopricewithtax) { ?>
<td class="linecoluttc nowraponall right"><?php $coldisplay++; ?><?php print (isset($line->pu_ttc) ? price($sign * $line->pu_ttc) : price($sign * $line->subprice)); ?></td>
if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) { ?>
<td class="linecoluttc nowraponall right"><?php $coldisplay++; ?><?php
$upinctax = isset($line->pu_ttc) ? $line->pu_ttc : null;
if (getDolGlobalInt('MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES')) {
$upinctax = price2num($line->total_ttc / $line->qty, 'MU');
}
print (isset($upinctax) ? price($sign * $upinctax) : price($sign * $line->subprice));
?></td>
<?php } ?>
<td class="linecolqty nowraponall right"><?php $coldisplay++; ?>

View File

@ -1497,9 +1497,11 @@ class Holiday extends CommonObject
}
$out .= '</select>'."\n";
$out .= ajax_combobox($htmlname);
print $out;
$showempty= 0;
$out .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($showempty < 0 ? (string) $showempty : '-1'), $morecss);
return $out;
}
/**
@ -2488,7 +2490,7 @@ class Holiday extends CommonObject
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
if (property_exists($this, 'fk_type')) {
$return .= '<br><span class="opacitymedium">'.$langs->trans("Type").'</span> : ';
$return .= '<span class="info_box-label maxwidth100">'.arraydata['labeltype'].'</span>';
$return .= '<span class="info_box-label maxwidth100">'.$arraydata['labeltype'].'</span>';
}
if (property_exists($this, 'date_debut') && property_exists($this, 'date_fin')) {
$return .= '<br><span class="info-box-label">'.dol_print_date($this->date_debut, 'day').'</span>';

View File

@ -363,6 +363,7 @@ if (count($typeleaves) == 0) {
print_liste_field_titre((empty($user->rights->holiday->define_holiday) ? '' : 'Note'), $_SERVER["PHP_SELF"]);
print_liste_field_titre('');
$selectedfields = '';
if ($massactionbutton) {
$selectedfields = $form->showCheckAddButtons('checkforselect', 1);
}

File diff suppressed because it is too large Load Diff

View File

@ -279,255 +279,255 @@ INSERT INTO llx_c_country (rowid, code, code_iso, label, active, favorite) VALUE
UPDATE llx_c_country SET numeric_code = '004' WHERE code_iso = "AFG";
UPDATE llx_c_country SET numeric_code = '248' WHERE code_iso = "ALA";
UPDATE llx_c_country SET numeric_code = '008' WHERE code_iso = "ALB";
UPDATE llx_c_country SET numeric_code = '276' WHERE code_iso = "DEU";
UPDATE llx_c_country SET numeric_code = '020' WHERE code_iso = "AND";
UPDATE llx_c_country SET numeric_code = '024' WHERE code_iso = "AGO";
UPDATE llx_c_country SET numeric_code = '660' WHERE code_iso = "AIA";
UPDATE llx_c_country SET numeric_code = '010' WHERE code_iso = "ATA";
UPDATE llx_c_country SET numeric_code = '028' WHERE code_iso = "ATG";
UPDATE llx_c_country SET numeric_code = '682' WHERE code_iso = "SAU";
UPDATE llx_c_country SET numeric_code = '012' WHERE code_iso = "DZA";
UPDATE llx_c_country SET numeric_code = '032' WHERE code_iso = "ARG";
UPDATE llx_c_country SET numeric_code = '051' WHERE code_iso = "ARM";
UPDATE llx_c_country SET numeric_code = '533' WHERE code_iso = "ABW";
UPDATE llx_c_country SET numeric_code = '036' WHERE code_iso = "AUS";
UPDATE llx_c_country SET numeric_code = '040' WHERE code_iso = "AUT";
UPDATE llx_c_country SET numeric_code = '031' WHERE code_iso = "AZE";
UPDATE llx_c_country SET numeric_code = '044' WHERE code_iso = "BHS";
UPDATE llx_c_country SET numeric_code = '050' WHERE code_iso = "BGD";
UPDATE llx_c_country SET numeric_code = '052' WHERE code_iso = "BRB";
UPDATE llx_c_country SET numeric_code = '048' WHERE code_iso = "BHR";
UPDATE llx_c_country SET numeric_code = '056' WHERE code_iso = "BEL";
UPDATE llx_c_country SET numeric_code = '084' WHERE code_iso = "BLZ";
UPDATE llx_c_country SET numeric_code = '204' WHERE code_iso = "BEN";
UPDATE llx_c_country SET numeric_code = '060' WHERE code_iso = "BMU";
UPDATE llx_c_country SET numeric_code = '112' WHERE code_iso = "BLR";
UPDATE llx_c_country SET numeric_code = '068' WHERE code_iso = "BOL";
UPDATE llx_c_country SET numeric_code = '535' WHERE code_iso = "BES";
UPDATE llx_c_country SET numeric_code = '070' WHERE code_iso = "BIH";
UPDATE llx_c_country SET numeric_code = '072' WHERE code_iso = "BWA";
UPDATE llx_c_country SET numeric_code = '076' WHERE code_iso = "BRA";
UPDATE llx_c_country SET numeric_code = '096' WHERE code_iso = "BRN";
UPDATE llx_c_country SET numeric_code = '100' WHERE code_iso = "BGR";
UPDATE llx_c_country SET numeric_code = '854' WHERE code_iso = "BFA";
UPDATE llx_c_country SET numeric_code = '108' WHERE code_iso = "BDI";
UPDATE llx_c_country SET numeric_code = '064' WHERE code_iso = "BTN";
UPDATE llx_c_country SET numeric_code = '132' WHERE code_iso = "CPV";
UPDATE llx_c_country SET numeric_code = '116' WHERE code_iso = "KHM";
UPDATE llx_c_country SET numeric_code = '120' WHERE code_iso = "CMR";
UPDATE llx_c_country SET numeric_code = '124' WHERE code_iso = "CAN";
UPDATE llx_c_country SET numeric_code = '634' WHERE code_iso = "QAT";
UPDATE llx_c_country SET numeric_code = '148' WHERE code_iso = "TCD";
UPDATE llx_c_country SET numeric_code = '152' WHERE code_iso = "CHL";
UPDATE llx_c_country SET numeric_code = '156' WHERE code_iso = "CHN";
UPDATE llx_c_country SET numeric_code = '196' WHERE code_iso = "CYP";
UPDATE llx_c_country SET numeric_code = '170' WHERE code_iso = "COL";
UPDATE llx_c_country SET numeric_code = '174' WHERE code_iso = "COM";
UPDATE llx_c_country SET numeric_code = '408' WHERE code_iso = "PRK";
UPDATE llx_c_country SET numeric_code = '410' WHERE code_iso = "KOR";
UPDATE llx_c_country SET numeric_code = '384' WHERE code_iso = "CIV";
UPDATE llx_c_country SET numeric_code = '188' WHERE code_iso = "CRI";
UPDATE llx_c_country SET numeric_code = '191' WHERE code_iso = "HRV";
UPDATE llx_c_country SET numeric_code = '192' WHERE code_iso = "CUB";
UPDATE llx_c_country SET numeric_code = '531' WHERE code_iso = "CUW";
UPDATE llx_c_country SET numeric_code = '208' WHERE code_iso = "DNK";
UPDATE llx_c_country SET numeric_code = '212' WHERE code_iso = "DMA";
UPDATE llx_c_country SET numeric_code = '218' WHERE code_iso = "ECU";
UPDATE llx_c_country SET numeric_code = '818' WHERE code_iso = "EGY";
UPDATE llx_c_country SET numeric_code = '222' WHERE code_iso = "SLV";
UPDATE llx_c_country SET numeric_code = '784' WHERE code_iso = "ARE";
UPDATE llx_c_country SET numeric_code = '232' WHERE code_iso = "ERI";
UPDATE llx_c_country SET numeric_code = '703' WHERE code_iso = "SVK";
UPDATE llx_c_country SET numeric_code = '705' WHERE code_iso = "SVN";
UPDATE llx_c_country SET numeric_code = '724' WHERE code_iso = "ESP";
UPDATE llx_c_country SET numeric_code = '840' WHERE code_iso = "USA";
UPDATE llx_c_country SET numeric_code = '233' WHERE code_iso = "EST";
UPDATE llx_c_country SET numeric_code = '231' WHERE code_iso = "ETH";
UPDATE llx_c_country SET numeric_code = '608' WHERE code_iso = "PHL";
UPDATE llx_c_country SET numeric_code = '246' WHERE code_iso = "FIN";
UPDATE llx_c_country SET numeric_code = '242' WHERE code_iso = "FJI";
UPDATE llx_c_country SET numeric_code = '250' WHERE code_iso = "FRA";
UPDATE llx_c_country SET numeric_code = '266' WHERE code_iso = "GAB";
UPDATE llx_c_country SET numeric_code = '270' WHERE code_iso = "GMB";
UPDATE llx_c_country SET numeric_code = '268' WHERE code_iso = "GEO";
UPDATE llx_c_country SET numeric_code = '288' WHERE code_iso = "GHA";
UPDATE llx_c_country SET numeric_code = '292' WHERE code_iso = "GIB";
UPDATE llx_c_country SET numeric_code = '308' WHERE code_iso = "GRD";
UPDATE llx_c_country SET numeric_code = '300' WHERE code_iso = "GRC";
UPDATE llx_c_country SET numeric_code = '304' WHERE code_iso = "GRL";
UPDATE llx_c_country SET numeric_code = '312' WHERE code_iso = "GLP";
UPDATE llx_c_country SET numeric_code = '316' WHERE code_iso = "GUM";
UPDATE llx_c_country SET numeric_code = '320' WHERE code_iso = "GTM";
UPDATE llx_c_country SET numeric_code = '254' WHERE code_iso = "GUF";
UPDATE llx_c_country SET numeric_code = '831' WHERE code_iso = "GGY";
UPDATE llx_c_country SET numeric_code = '324' WHERE code_iso = "GIN";
UPDATE llx_c_country SET numeric_code = '624' WHERE code_iso = "GNB";
UPDATE llx_c_country SET numeric_code = '226' WHERE code_iso = "GNQ";
UPDATE llx_c_country SET numeric_code = '328' WHERE code_iso = "GUY";
UPDATE llx_c_country SET numeric_code = '332' WHERE code_iso = "HTI";
UPDATE llx_c_country SET numeric_code = '340' WHERE code_iso = "HND";
UPDATE llx_c_country SET numeric_code = '344' WHERE code_iso = "HKG";
UPDATE llx_c_country SET numeric_code = '348' WHERE code_iso = "HUN";
UPDATE llx_c_country SET numeric_code = '356' WHERE code_iso = "IND";
UPDATE llx_c_country SET numeric_code = '360' WHERE code_iso = "IDN";
UPDATE llx_c_country SET numeric_code = '368' WHERE code_iso = "IRQ";
UPDATE llx_c_country SET numeric_code = '364' WHERE code_iso = "IRN";
UPDATE llx_c_country SET numeric_code = '372' WHERE code_iso = "IRL";
UPDATE llx_c_country SET numeric_code = '074' WHERE code_iso = "BVT";
UPDATE llx_c_country SET numeric_code = '833' WHERE code_iso = "IMN";
UPDATE llx_c_country SET numeric_code = '162' WHERE code_iso = "CXR";
UPDATE llx_c_country SET numeric_code = '352' WHERE code_iso = "ISL";
UPDATE llx_c_country SET numeric_code = '136' WHERE code_iso = "CYM";
UPDATE llx_c_country SET numeric_code = '166' WHERE code_iso = "CCK";
UPDATE llx_c_country SET numeric_code = '184' WHERE code_iso = "COK";
UPDATE llx_c_country SET numeric_code = '234' WHERE code_iso = "FRO";
UPDATE llx_c_country SET numeric_code = '239' WHERE code_iso = "SGS";
UPDATE llx_c_country SET numeric_code = '334' WHERE code_iso = "HMD";
UPDATE llx_c_country SET numeric_code = '238' WHERE code_iso = "FLK";
UPDATE llx_c_country SET numeric_code = '580' WHERE code_iso = "MNP";
UPDATE llx_c_country SET numeric_code = '584' WHERE code_iso = "MHL";
UPDATE llx_c_country SET numeric_code = '612' WHERE code_iso = "PCN";
UPDATE llx_c_country SET numeric_code = '090' WHERE code_iso = "SLB";
UPDATE llx_c_country SET numeric_code = '796' WHERE code_iso = "TCA";
UPDATE llx_c_country SET numeric_code = '581' WHERE code_iso = "UMI";
UPDATE llx_c_country SET numeric_code = '092' WHERE code_iso = "VGB";
UPDATE llx_c_country SET numeric_code = '850' WHERE code_iso = "VIR";
UPDATE llx_c_country SET numeric_code = '376' WHERE code_iso = "ISR";
UPDATE llx_c_country SET numeric_code = '380' WHERE code_iso = "ITA";
UPDATE llx_c_country SET numeric_code = '388' WHERE code_iso = "JAM";
UPDATE llx_c_country SET numeric_code = '392' WHERE code_iso = "JPN";
UPDATE llx_c_country SET numeric_code = '832' WHERE code_iso = "JEY";
UPDATE llx_c_country SET numeric_code = '400' WHERE code_iso = "JOR";
UPDATE llx_c_country SET numeric_code = '398' WHERE code_iso = "KAZ";
UPDATE llx_c_country SET numeric_code = '404' WHERE code_iso = "KEN";
UPDATE llx_c_country SET numeric_code = '417' WHERE code_iso = "KGZ";
UPDATE llx_c_country SET numeric_code = '296' WHERE code_iso = "KIR";
UPDATE llx_c_country SET numeric_code = '414' WHERE code_iso = "KWT";
UPDATE llx_c_country SET numeric_code = '418' WHERE code_iso = "LAO";
UPDATE llx_c_country SET numeric_code = '426' WHERE code_iso = "LSO";
UPDATE llx_c_country SET numeric_code = '428' WHERE code_iso = "LVA";
UPDATE llx_c_country SET numeric_code = '422' WHERE code_iso = "LBN";
UPDATE llx_c_country SET numeric_code = '430' WHERE code_iso = "LBR";
UPDATE llx_c_country SET numeric_code = '434' WHERE code_iso = "LBY";
UPDATE llx_c_country SET numeric_code = '438' WHERE code_iso = "LIE";
UPDATE llx_c_country SET numeric_code = '440' WHERE code_iso = "LTU";
UPDATE llx_c_country SET numeric_code = '442' WHERE code_iso = "LUX";
UPDATE llx_c_country SET numeric_code = '446' WHERE code_iso = "MAC";
UPDATE llx_c_country SET numeric_code = '807' WHERE code_iso = "MKD";
UPDATE llx_c_country SET numeric_code = '450' WHERE code_iso = "MDG";
UPDATE llx_c_country SET numeric_code = '458' WHERE code_iso = "MYS";
UPDATE llx_c_country SET numeric_code = '454' WHERE code_iso = "MWI";
UPDATE llx_c_country SET numeric_code = '462' WHERE code_iso = "MDV";
UPDATE llx_c_country SET numeric_code = '466' WHERE code_iso = "MLI";
UPDATE llx_c_country SET numeric_code = '470' WHERE code_iso = "MLT";
UPDATE llx_c_country SET numeric_code = '504' WHERE code_iso = "MAR";
UPDATE llx_c_country SET numeric_code = '474' WHERE code_iso = "MTQ";
UPDATE llx_c_country SET numeric_code = '480' WHERE code_iso = "MUS";
UPDATE llx_c_country SET numeric_code = '478' WHERE code_iso = "MRT";
UPDATE llx_c_country SET numeric_code = '175' WHERE code_iso = "MYT";
UPDATE llx_c_country SET numeric_code = '484' WHERE code_iso = "MEX";
UPDATE llx_c_country SET numeric_code = '583' WHERE code_iso = "FSM";
UPDATE llx_c_country SET numeric_code = '498' WHERE code_iso = "MDA";
UPDATE llx_c_country SET numeric_code = '492' WHERE code_iso = "MCO";
UPDATE llx_c_country SET numeric_code = '496' WHERE code_iso = "MNG";
UPDATE llx_c_country SET numeric_code = '499' WHERE code_iso = "MNE";
UPDATE llx_c_country SET numeric_code = '500' WHERE code_iso = "MSR";
UPDATE llx_c_country SET numeric_code = '508' WHERE code_iso = "MOZ";
UPDATE llx_c_country SET numeric_code = '104' WHERE code_iso = "MMR";
UPDATE llx_c_country SET numeric_code = '516' WHERE code_iso = "NAM";
UPDATE llx_c_country SET numeric_code = '520' WHERE code_iso = "NRU";
UPDATE llx_c_country SET numeric_code = '524' WHERE code_iso = "NPL";
UPDATE llx_c_country SET numeric_code = '558' WHERE code_iso = "NIC";
UPDATE llx_c_country SET numeric_code = '562' WHERE code_iso = "NER";
UPDATE llx_c_country SET numeric_code = '566' WHERE code_iso = "NGA";
UPDATE llx_c_country SET numeric_code = '570' WHERE code_iso = "NIU";
UPDATE llx_c_country SET numeric_code = '574' WHERE code_iso = "NFK";
UPDATE llx_c_country SET numeric_code = '578' WHERE code_iso = "NOR";
UPDATE llx_c_country SET numeric_code = '540' WHERE code_iso = "NCL";
UPDATE llx_c_country SET numeric_code = '554' WHERE code_iso = "NZL";
UPDATE llx_c_country SET numeric_code = '512' WHERE code_iso = "OMN";
UPDATE llx_c_country SET numeric_code = '528' WHERE code_iso = "NLD";
UPDATE llx_c_country SET numeric_code = '586' WHERE code_iso = "PAK";
UPDATE llx_c_country SET numeric_code = '585' WHERE code_iso = "PLW";
UPDATE llx_c_country SET numeric_code = '275' WHERE code_iso = "PSE";
UPDATE llx_c_country SET numeric_code = '591' WHERE code_iso = "PAN";
UPDATE llx_c_country SET numeric_code = '598' WHERE code_iso = "PNG";
UPDATE llx_c_country SET numeric_code = '600' WHERE code_iso = "PRY";
UPDATE llx_c_country SET numeric_code = '604' WHERE code_iso = "PER";
UPDATE llx_c_country SET numeric_code = '258' WHERE code_iso = "PYF";
UPDATE llx_c_country SET numeric_code = '616' WHERE code_iso = "POL";
UPDATE llx_c_country SET numeric_code = '620' WHERE code_iso = "PRT";
UPDATE llx_c_country SET numeric_code = '630' WHERE code_iso = "PRI";
UPDATE llx_c_country SET numeric_code = '826' WHERE code_iso = "GBR";
UPDATE llx_c_country SET numeric_code = '732' WHERE code_iso = "ESH";
UPDATE llx_c_country SET numeric_code = '140' WHERE code_iso = "CAF";
UPDATE llx_c_country SET numeric_code = '203' WHERE code_iso = "CZE";
UPDATE llx_c_country SET numeric_code = '178' WHERE code_iso = "COG";
UPDATE llx_c_country SET numeric_code = '180' WHERE code_iso = "COD";
UPDATE llx_c_country SET numeric_code = '214' WHERE code_iso = "DOM";
UPDATE llx_c_country SET numeric_code = '638' WHERE code_iso = "REU";
UPDATE llx_c_country SET numeric_code = '646' WHERE code_iso = "RWA";
UPDATE llx_c_country SET numeric_code = '642' WHERE code_iso = "ROU";
UPDATE llx_c_country SET numeric_code = '643' WHERE code_iso = "RUS";
UPDATE llx_c_country SET numeric_code = '882' WHERE code_iso = "WSM";
UPDATE llx_c_country SET numeric_code = '016' WHERE code_iso = "ASM";
UPDATE llx_c_country SET numeric_code = '652' WHERE code_iso = "BLM";
UPDATE llx_c_country SET numeric_code = '659' WHERE code_iso = "KNA";
UPDATE llx_c_country SET numeric_code = '674' WHERE code_iso = "SMR";
UPDATE llx_c_country SET numeric_code = '663' WHERE code_iso = "MAF";
UPDATE llx_c_country SET numeric_code = '666' WHERE code_iso = "SPM";
UPDATE llx_c_country SET numeric_code = '670' WHERE code_iso = "VCT";
UPDATE llx_c_country SET numeric_code = '654' WHERE code_iso = "SHN";
UPDATE llx_c_country SET numeric_code = '662' WHERE code_iso = "LCA";
UPDATE llx_c_country SET numeric_code = '678' WHERE code_iso = "STP";
UPDATE llx_c_country SET numeric_code = '686' WHERE code_iso = "SEN";
UPDATE llx_c_country SET numeric_code = '688' WHERE code_iso = "SRB";
UPDATE llx_c_country SET numeric_code = '690' WHERE code_iso = "SYC";
UPDATE llx_c_country SET numeric_code = '694' WHERE code_iso = "SLE";
UPDATE llx_c_country SET numeric_code = '702' WHERE code_iso = "SGP";
UPDATE llx_c_country SET numeric_code = '534' WHERE code_iso = "SXM";
UPDATE llx_c_country SET numeric_code = '760' WHERE code_iso = "SYR";
UPDATE llx_c_country SET numeric_code = '706' WHERE code_iso = "SOM";
UPDATE llx_c_country SET numeric_code = '144' WHERE code_iso = "LKA";
UPDATE llx_c_country SET numeric_code = '748' WHERE code_iso = "SWZ";
UPDATE llx_c_country SET numeric_code = '710' WHERE code_iso = "ZAF";
UPDATE llx_c_country SET numeric_code = '729' WHERE code_iso = "SDN";
UPDATE llx_c_country SET numeric_code = '728' WHERE code_iso = "SSD";
UPDATE llx_c_country SET numeric_code = '752' WHERE code_iso = "SWE";
UPDATE llx_c_country SET numeric_code = '756' WHERE code_iso = "CHE";
UPDATE llx_c_country SET numeric_code = '740' WHERE code_iso = "SUR";
UPDATE llx_c_country SET numeric_code = '744' WHERE code_iso = "SJM";
UPDATE llx_c_country SET numeric_code = '764' WHERE code_iso = "THA";
UPDATE llx_c_country SET numeric_code = '158' WHERE code_iso = "TWN";
UPDATE llx_c_country SET numeric_code = '834' WHERE code_iso = "TZA";
UPDATE llx_c_country SET numeric_code = '762' WHERE code_iso = "TJK";
UPDATE llx_c_country SET numeric_code = '086' WHERE code_iso = "IOT";
UPDATE llx_c_country SET numeric_code = '260' WHERE code_iso = "ATF";
UPDATE llx_c_country SET numeric_code = '626' WHERE code_iso = "TLS";
UPDATE llx_c_country SET numeric_code = '768' WHERE code_iso = "TGO";
UPDATE llx_c_country SET numeric_code = '772' WHERE code_iso = "TKL";
UPDATE llx_c_country SET numeric_code = '776' WHERE code_iso = "TON";
UPDATE llx_c_country SET numeric_code = '780' WHERE code_iso = "TTO";
UPDATE llx_c_country SET numeric_code = '788' WHERE code_iso = "TUN";
UPDATE llx_c_country SET numeric_code = '795' WHERE code_iso = "TKM";
UPDATE llx_c_country SET numeric_code = '792' WHERE code_iso = "TUR";
UPDATE llx_c_country SET numeric_code = '798' WHERE code_iso = "TUV";
UPDATE llx_c_country SET numeric_code = '804' WHERE code_iso = "UKR";
UPDATE llx_c_country SET numeric_code = '800' WHERE code_iso = "UGA";
UPDATE llx_c_country SET numeric_code = '858' WHERE code_iso = "URY";
UPDATE llx_c_country SET numeric_code = '860' WHERE code_iso = "UZB";
UPDATE llx_c_country SET numeric_code = '548' WHERE code_iso = "VUT";
UPDATE llx_c_country SET numeric_code = '336' WHERE code_iso = "VAT";
UPDATE llx_c_country SET numeric_code = '862' WHERE code_iso = "VEN";
UPDATE llx_c_country SET numeric_code = '704' WHERE code_iso = "VNM";
UPDATE llx_c_country SET numeric_code = '876' WHERE code_iso = "WLF";
UPDATE llx_c_country SET numeric_code = '887' WHERE code_iso = "YEM";
UPDATE llx_c_country SET numeric_code = '262' WHERE code_iso = "DJI";
UPDATE llx_c_country SET numeric_code = '894' WHERE code_iso = "ZMB";
UPDATE llx_c_country SET numeric_code = '716' WHERE code_iso = "ZWE";
UPDATE llx_c_country SET numeric_code = '004' WHERE code_iso = 'AFG';
UPDATE llx_c_country SET numeric_code = '248' WHERE code_iso = 'ALA';
UPDATE llx_c_country SET numeric_code = '008' WHERE code_iso = 'ALB';
UPDATE llx_c_country SET numeric_code = '276' WHERE code_iso = 'DEU';
UPDATE llx_c_country SET numeric_code = '020' WHERE code_iso = 'AND';
UPDATE llx_c_country SET numeric_code = '024' WHERE code_iso = 'AGO';
UPDATE llx_c_country SET numeric_code = '660' WHERE code_iso = 'AIA';
UPDATE llx_c_country SET numeric_code = '010' WHERE code_iso = 'ATA';
UPDATE llx_c_country SET numeric_code = '028' WHERE code_iso = 'ATG';
UPDATE llx_c_country SET numeric_code = '682' WHERE code_iso = 'SAU';
UPDATE llx_c_country SET numeric_code = '012' WHERE code_iso = 'DZA';
UPDATE llx_c_country SET numeric_code = '032' WHERE code_iso = 'ARG';
UPDATE llx_c_country SET numeric_code = '051' WHERE code_iso = 'ARM';
UPDATE llx_c_country SET numeric_code = '533' WHERE code_iso = 'ABW';
UPDATE llx_c_country SET numeric_code = '036' WHERE code_iso = 'AUS';
UPDATE llx_c_country SET numeric_code = '040' WHERE code_iso = 'AUT';
UPDATE llx_c_country SET numeric_code = '031' WHERE code_iso = 'AZE';
UPDATE llx_c_country SET numeric_code = '044' WHERE code_iso = 'BHS';
UPDATE llx_c_country SET numeric_code = '050' WHERE code_iso = 'BGD';
UPDATE llx_c_country SET numeric_code = '052' WHERE code_iso = 'BRB';
UPDATE llx_c_country SET numeric_code = '048' WHERE code_iso = 'BHR';
UPDATE llx_c_country SET numeric_code = '056' WHERE code_iso = 'BEL';
UPDATE llx_c_country SET numeric_code = '084' WHERE code_iso = 'BLZ';
UPDATE llx_c_country SET numeric_code = '204' WHERE code_iso = 'BEN';
UPDATE llx_c_country SET numeric_code = '060' WHERE code_iso = 'BMU';
UPDATE llx_c_country SET numeric_code = '112' WHERE code_iso = 'BLR';
UPDATE llx_c_country SET numeric_code = '068' WHERE code_iso = 'BOL';
UPDATE llx_c_country SET numeric_code = '535' WHERE code_iso = 'BES';
UPDATE llx_c_country SET numeric_code = '070' WHERE code_iso = 'BIH';
UPDATE llx_c_country SET numeric_code = '072' WHERE code_iso = 'BWA';
UPDATE llx_c_country SET numeric_code = '076' WHERE code_iso = 'BRA';
UPDATE llx_c_country SET numeric_code = '096' WHERE code_iso = 'BRN';
UPDATE llx_c_country SET numeric_code = '100' WHERE code_iso = 'BGR';
UPDATE llx_c_country SET numeric_code = '854' WHERE code_iso = 'BFA';
UPDATE llx_c_country SET numeric_code = '108' WHERE code_iso = 'BDI';
UPDATE llx_c_country SET numeric_code = '064' WHERE code_iso = 'BTN';
UPDATE llx_c_country SET numeric_code = '132' WHERE code_iso = 'CPV';
UPDATE llx_c_country SET numeric_code = '116' WHERE code_iso = 'KHM';
UPDATE llx_c_country SET numeric_code = '120' WHERE code_iso = 'CMR';
UPDATE llx_c_country SET numeric_code = '124' WHERE code_iso = 'CAN';
UPDATE llx_c_country SET numeric_code = '634' WHERE code_iso = 'QAT';
UPDATE llx_c_country SET numeric_code = '148' WHERE code_iso = 'TCD';
UPDATE llx_c_country SET numeric_code = '152' WHERE code_iso = 'CHL';
UPDATE llx_c_country SET numeric_code = '156' WHERE code_iso = 'CHN';
UPDATE llx_c_country SET numeric_code = '196' WHERE code_iso = 'CYP';
UPDATE llx_c_country SET numeric_code = '170' WHERE code_iso = 'COL';
UPDATE llx_c_country SET numeric_code = '174' WHERE code_iso = 'COM';
UPDATE llx_c_country SET numeric_code = '408' WHERE code_iso = 'PRK';
UPDATE llx_c_country SET numeric_code = '410' WHERE code_iso = 'KOR';
UPDATE llx_c_country SET numeric_code = '384' WHERE code_iso = 'CIV';
UPDATE llx_c_country SET numeric_code = '188' WHERE code_iso = 'CRI';
UPDATE llx_c_country SET numeric_code = '191' WHERE code_iso = 'HRV';
UPDATE llx_c_country SET numeric_code = '192' WHERE code_iso = 'CUB';
UPDATE llx_c_country SET numeric_code = '531' WHERE code_iso = 'CUW';
UPDATE llx_c_country SET numeric_code = '208' WHERE code_iso = 'DNK';
UPDATE llx_c_country SET numeric_code = '212' WHERE code_iso = 'DMA';
UPDATE llx_c_country SET numeric_code = '218' WHERE code_iso = 'ECU';
UPDATE llx_c_country SET numeric_code = '818' WHERE code_iso = 'EGY';
UPDATE llx_c_country SET numeric_code = '222' WHERE code_iso = 'SLV';
UPDATE llx_c_country SET numeric_code = '784' WHERE code_iso = 'ARE';
UPDATE llx_c_country SET numeric_code = '232' WHERE code_iso = 'ERI';
UPDATE llx_c_country SET numeric_code = '703' WHERE code_iso = 'SVK';
UPDATE llx_c_country SET numeric_code = '705' WHERE code_iso = 'SVN';
UPDATE llx_c_country SET numeric_code = '724' WHERE code_iso = 'ESP';
UPDATE llx_c_country SET numeric_code = '840' WHERE code_iso = 'USA';
UPDATE llx_c_country SET numeric_code = '233' WHERE code_iso = 'EST';
UPDATE llx_c_country SET numeric_code = '231' WHERE code_iso = 'ETH';
UPDATE llx_c_country SET numeric_code = '608' WHERE code_iso = 'PHL';
UPDATE llx_c_country SET numeric_code = '246' WHERE code_iso = 'FIN';
UPDATE llx_c_country SET numeric_code = '242' WHERE code_iso = 'FJI';
UPDATE llx_c_country SET numeric_code = '250' WHERE code_iso = 'FRA';
UPDATE llx_c_country SET numeric_code = '266' WHERE code_iso = 'GAB';
UPDATE llx_c_country SET numeric_code = '270' WHERE code_iso = 'GMB';
UPDATE llx_c_country SET numeric_code = '268' WHERE code_iso = 'GEO';
UPDATE llx_c_country SET numeric_code = '288' WHERE code_iso = 'GHA';
UPDATE llx_c_country SET numeric_code = '292' WHERE code_iso = 'GIB';
UPDATE llx_c_country SET numeric_code = '308' WHERE code_iso = 'GRD';
UPDATE llx_c_country SET numeric_code = '300' WHERE code_iso = 'GRC';
UPDATE llx_c_country SET numeric_code = '304' WHERE code_iso = 'GRL';
UPDATE llx_c_country SET numeric_code = '312' WHERE code_iso = 'GLP';
UPDATE llx_c_country SET numeric_code = '316' WHERE code_iso = 'GUM';
UPDATE llx_c_country SET numeric_code = '320' WHERE code_iso = 'GTM';
UPDATE llx_c_country SET numeric_code = '254' WHERE code_iso = 'GUF';
UPDATE llx_c_country SET numeric_code = '831' WHERE code_iso = 'GGY';
UPDATE llx_c_country SET numeric_code = '324' WHERE code_iso = 'GIN';
UPDATE llx_c_country SET numeric_code = '624' WHERE code_iso = 'GNB';
UPDATE llx_c_country SET numeric_code = '226' WHERE code_iso = 'GNQ';
UPDATE llx_c_country SET numeric_code = '328' WHERE code_iso = 'GUY';
UPDATE llx_c_country SET numeric_code = '332' WHERE code_iso = 'HTI';
UPDATE llx_c_country SET numeric_code = '340' WHERE code_iso = 'HND';
UPDATE llx_c_country SET numeric_code = '344' WHERE code_iso = 'HKG';
UPDATE llx_c_country SET numeric_code = '348' WHERE code_iso = 'HUN';
UPDATE llx_c_country SET numeric_code = '356' WHERE code_iso = 'IND';
UPDATE llx_c_country SET numeric_code = '360' WHERE code_iso = 'IDN';
UPDATE llx_c_country SET numeric_code = '368' WHERE code_iso = 'IRQ';
UPDATE llx_c_country SET numeric_code = '364' WHERE code_iso = 'IRN';
UPDATE llx_c_country SET numeric_code = '372' WHERE code_iso = 'IRL';
UPDATE llx_c_country SET numeric_code = '074' WHERE code_iso = 'BVT';
UPDATE llx_c_country SET numeric_code = '833' WHERE code_iso = 'IMN';
UPDATE llx_c_country SET numeric_code = '162' WHERE code_iso = 'CXR';
UPDATE llx_c_country SET numeric_code = '352' WHERE code_iso = 'ISL';
UPDATE llx_c_country SET numeric_code = '136' WHERE code_iso = 'CYM';
UPDATE llx_c_country SET numeric_code = '166' WHERE code_iso = 'CCK';
UPDATE llx_c_country SET numeric_code = '184' WHERE code_iso = 'COK';
UPDATE llx_c_country SET numeric_code = '234' WHERE code_iso = 'FRO';
UPDATE llx_c_country SET numeric_code = '239' WHERE code_iso = 'SGS';
UPDATE llx_c_country SET numeric_code = '334' WHERE code_iso = 'HMD';
UPDATE llx_c_country SET numeric_code = '238' WHERE code_iso = 'FLK';
UPDATE llx_c_country SET numeric_code = '580' WHERE code_iso = 'MNP';
UPDATE llx_c_country SET numeric_code = '584' WHERE code_iso = 'MHL';
UPDATE llx_c_country SET numeric_code = '612' WHERE code_iso = 'PCN';
UPDATE llx_c_country SET numeric_code = '090' WHERE code_iso = 'SLB';
UPDATE llx_c_country SET numeric_code = '796' WHERE code_iso = 'TCA';
UPDATE llx_c_country SET numeric_code = '581' WHERE code_iso = 'UMI';
UPDATE llx_c_country SET numeric_code = '092' WHERE code_iso = 'VGB';
UPDATE llx_c_country SET numeric_code = '850' WHERE code_iso = 'VIR';
UPDATE llx_c_country SET numeric_code = '376' WHERE code_iso = 'ISR';
UPDATE llx_c_country SET numeric_code = '380' WHERE code_iso = 'ITA';
UPDATE llx_c_country SET numeric_code = '388' WHERE code_iso = 'JAM';
UPDATE llx_c_country SET numeric_code = '392' WHERE code_iso = 'JPN';
UPDATE llx_c_country SET numeric_code = '832' WHERE code_iso = 'JEY';
UPDATE llx_c_country SET numeric_code = '400' WHERE code_iso = 'JOR';
UPDATE llx_c_country SET numeric_code = '398' WHERE code_iso = 'KAZ';
UPDATE llx_c_country SET numeric_code = '404' WHERE code_iso = 'KEN';
UPDATE llx_c_country SET numeric_code = '417' WHERE code_iso = 'KGZ';
UPDATE llx_c_country SET numeric_code = '296' WHERE code_iso = 'KIR';
UPDATE llx_c_country SET numeric_code = '414' WHERE code_iso = 'KWT';
UPDATE llx_c_country SET numeric_code = '418' WHERE code_iso = 'LAO';
UPDATE llx_c_country SET numeric_code = '426' WHERE code_iso = 'LSO';
UPDATE llx_c_country SET numeric_code = '428' WHERE code_iso = 'LVA';
UPDATE llx_c_country SET numeric_code = '422' WHERE code_iso = 'LBN';
UPDATE llx_c_country SET numeric_code = '430' WHERE code_iso = 'LBR';
UPDATE llx_c_country SET numeric_code = '434' WHERE code_iso = 'LBY';
UPDATE llx_c_country SET numeric_code = '438' WHERE code_iso = 'LIE';
UPDATE llx_c_country SET numeric_code = '440' WHERE code_iso = 'LTU';
UPDATE llx_c_country SET numeric_code = '442' WHERE code_iso = 'LUX';
UPDATE llx_c_country SET numeric_code = '446' WHERE code_iso = 'MAC';
UPDATE llx_c_country SET numeric_code = '807' WHERE code_iso = 'MKD';
UPDATE llx_c_country SET numeric_code = '450' WHERE code_iso = 'MDG';
UPDATE llx_c_country SET numeric_code = '458' WHERE code_iso = 'MYS';
UPDATE llx_c_country SET numeric_code = '454' WHERE code_iso = 'MWI';
UPDATE llx_c_country SET numeric_code = '462' WHERE code_iso = 'MDV';
UPDATE llx_c_country SET numeric_code = '466' WHERE code_iso = 'MLI';
UPDATE llx_c_country SET numeric_code = '470' WHERE code_iso = 'MLT';
UPDATE llx_c_country SET numeric_code = '504' WHERE code_iso = 'MAR';
UPDATE llx_c_country SET numeric_code = '474' WHERE code_iso = 'MTQ';
UPDATE llx_c_country SET numeric_code = '480' WHERE code_iso = 'MUS';
UPDATE llx_c_country SET numeric_code = '478' WHERE code_iso = 'MRT';
UPDATE llx_c_country SET numeric_code = '175' WHERE code_iso = 'MYT';
UPDATE llx_c_country SET numeric_code = '484' WHERE code_iso = 'MEX';
UPDATE llx_c_country SET numeric_code = '583' WHERE code_iso = 'FSM';
UPDATE llx_c_country SET numeric_code = '498' WHERE code_iso = 'MDA';
UPDATE llx_c_country SET numeric_code = '492' WHERE code_iso = 'MCO';
UPDATE llx_c_country SET numeric_code = '496' WHERE code_iso = 'MNG';
UPDATE llx_c_country SET numeric_code = '499' WHERE code_iso = 'MNE';
UPDATE llx_c_country SET numeric_code = '500' WHERE code_iso = 'MSR';
UPDATE llx_c_country SET numeric_code = '508' WHERE code_iso = 'MOZ';
UPDATE llx_c_country SET numeric_code = '104' WHERE code_iso = 'MMR';
UPDATE llx_c_country SET numeric_code = '516' WHERE code_iso = 'NAM';
UPDATE llx_c_country SET numeric_code = '520' WHERE code_iso = 'NRU';
UPDATE llx_c_country SET numeric_code = '524' WHERE code_iso = 'NPL';
UPDATE llx_c_country SET numeric_code = '558' WHERE code_iso = 'NIC';
UPDATE llx_c_country SET numeric_code = '562' WHERE code_iso = 'NER';
UPDATE llx_c_country SET numeric_code = '566' WHERE code_iso = 'NGA';
UPDATE llx_c_country SET numeric_code = '570' WHERE code_iso = 'NIU';
UPDATE llx_c_country SET numeric_code = '574' WHERE code_iso = 'NFK';
UPDATE llx_c_country SET numeric_code = '578' WHERE code_iso = 'NOR';
UPDATE llx_c_country SET numeric_code = '540' WHERE code_iso = 'NCL';
UPDATE llx_c_country SET numeric_code = '554' WHERE code_iso = 'NZL';
UPDATE llx_c_country SET numeric_code = '512' WHERE code_iso = 'OMN';
UPDATE llx_c_country SET numeric_code = '528' WHERE code_iso = 'NLD';
UPDATE llx_c_country SET numeric_code = '586' WHERE code_iso = 'PAK';
UPDATE llx_c_country SET numeric_code = '585' WHERE code_iso = 'PLW';
UPDATE llx_c_country SET numeric_code = '275' WHERE code_iso = 'PSE';
UPDATE llx_c_country SET numeric_code = '591' WHERE code_iso = 'PAN';
UPDATE llx_c_country SET numeric_code = '598' WHERE code_iso = 'PNG';
UPDATE llx_c_country SET numeric_code = '600' WHERE code_iso = 'PRY';
UPDATE llx_c_country SET numeric_code = '604' WHERE code_iso = 'PER';
UPDATE llx_c_country SET numeric_code = '258' WHERE code_iso = 'PYF';
UPDATE llx_c_country SET numeric_code = '616' WHERE code_iso = 'POL';
UPDATE llx_c_country SET numeric_code = '620' WHERE code_iso = 'PRT';
UPDATE llx_c_country SET numeric_code = '630' WHERE code_iso = 'PRI';
UPDATE llx_c_country SET numeric_code = '826' WHERE code_iso = 'GBR';
UPDATE llx_c_country SET numeric_code = '732' WHERE code_iso = 'ESH';
UPDATE llx_c_country SET numeric_code = '140' WHERE code_iso = 'CAF';
UPDATE llx_c_country SET numeric_code = '203' WHERE code_iso = 'CZE';
UPDATE llx_c_country SET numeric_code = '178' WHERE code_iso = 'COG';
UPDATE llx_c_country SET numeric_code = '180' WHERE code_iso = 'COD';
UPDATE llx_c_country SET numeric_code = '214' WHERE code_iso = 'DOM';
UPDATE llx_c_country SET numeric_code = '638' WHERE code_iso = 'REU';
UPDATE llx_c_country SET numeric_code = '646' WHERE code_iso = 'RWA';
UPDATE llx_c_country SET numeric_code = '642' WHERE code_iso = 'ROU';
UPDATE llx_c_country SET numeric_code = '643' WHERE code_iso = 'RUS';
UPDATE llx_c_country SET numeric_code = '882' WHERE code_iso = 'WSM';
UPDATE llx_c_country SET numeric_code = '016' WHERE code_iso = 'ASM';
UPDATE llx_c_country SET numeric_code = '652' WHERE code_iso = 'BLM';
UPDATE llx_c_country SET numeric_code = '659' WHERE code_iso = 'KNA';
UPDATE llx_c_country SET numeric_code = '674' WHERE code_iso = 'SMR';
UPDATE llx_c_country SET numeric_code = '663' WHERE code_iso = 'MAF';
UPDATE llx_c_country SET numeric_code = '666' WHERE code_iso = 'SPM';
UPDATE llx_c_country SET numeric_code = '670' WHERE code_iso = 'VCT';
UPDATE llx_c_country SET numeric_code = '654' WHERE code_iso = 'SHN';
UPDATE llx_c_country SET numeric_code = '662' WHERE code_iso = 'LCA';
UPDATE llx_c_country SET numeric_code = '678' WHERE code_iso = 'STP';
UPDATE llx_c_country SET numeric_code = '686' WHERE code_iso = 'SEN';
UPDATE llx_c_country SET numeric_code = '688' WHERE code_iso = 'SRB';
UPDATE llx_c_country SET numeric_code = '690' WHERE code_iso = 'SYC';
UPDATE llx_c_country SET numeric_code = '694' WHERE code_iso = 'SLE';
UPDATE llx_c_country SET numeric_code = '702' WHERE code_iso = 'SGP';
UPDATE llx_c_country SET numeric_code = '534' WHERE code_iso = 'SXM';
UPDATE llx_c_country SET numeric_code = '760' WHERE code_iso = 'SYR';
UPDATE llx_c_country SET numeric_code = '706' WHERE code_iso = 'SOM';
UPDATE llx_c_country SET numeric_code = '144' WHERE code_iso = 'LKA';
UPDATE llx_c_country SET numeric_code = '748' WHERE code_iso = 'SWZ';
UPDATE llx_c_country SET numeric_code = '710' WHERE code_iso = 'ZAF';
UPDATE llx_c_country SET numeric_code = '729' WHERE code_iso = 'SDN';
UPDATE llx_c_country SET numeric_code = '728' WHERE code_iso = 'SSD';
UPDATE llx_c_country SET numeric_code = '752' WHERE code_iso = 'SWE';
UPDATE llx_c_country SET numeric_code = '756' WHERE code_iso = 'CHE';
UPDATE llx_c_country SET numeric_code = '740' WHERE code_iso = 'SUR';
UPDATE llx_c_country SET numeric_code = '744' WHERE code_iso = 'SJM';
UPDATE llx_c_country SET numeric_code = '764' WHERE code_iso = 'THA';
UPDATE llx_c_country SET numeric_code = '158' WHERE code_iso = 'TWN';
UPDATE llx_c_country SET numeric_code = '834' WHERE code_iso = 'TZA';
UPDATE llx_c_country SET numeric_code = '762' WHERE code_iso = 'TJK';
UPDATE llx_c_country SET numeric_code = '086' WHERE code_iso = 'IOT';
UPDATE llx_c_country SET numeric_code = '260' WHERE code_iso = 'ATF';
UPDATE llx_c_country SET numeric_code = '626' WHERE code_iso = 'TLS';
UPDATE llx_c_country SET numeric_code = '768' WHERE code_iso = 'TGO';
UPDATE llx_c_country SET numeric_code = '772' WHERE code_iso = 'TKL';
UPDATE llx_c_country SET numeric_code = '776' WHERE code_iso = 'TON';
UPDATE llx_c_country SET numeric_code = '780' WHERE code_iso = 'TTO';
UPDATE llx_c_country SET numeric_code = '788' WHERE code_iso = 'TUN';
UPDATE llx_c_country SET numeric_code = '795' WHERE code_iso = 'TKM';
UPDATE llx_c_country SET numeric_code = '792' WHERE code_iso = 'TUR';
UPDATE llx_c_country SET numeric_code = '798' WHERE code_iso = 'TUV';
UPDATE llx_c_country SET numeric_code = '804' WHERE code_iso = 'UKR';
UPDATE llx_c_country SET numeric_code = '800' WHERE code_iso = 'UGA';
UPDATE llx_c_country SET numeric_code = '858' WHERE code_iso = 'URY';
UPDATE llx_c_country SET numeric_code = '860' WHERE code_iso = 'UZB';
UPDATE llx_c_country SET numeric_code = '548' WHERE code_iso = 'VUT';
UPDATE llx_c_country SET numeric_code = '336' WHERE code_iso = 'VAT';
UPDATE llx_c_country SET numeric_code = '862' WHERE code_iso = 'VEN';
UPDATE llx_c_country SET numeric_code = '704' WHERE code_iso = 'VNM';
UPDATE llx_c_country SET numeric_code = '876' WHERE code_iso = 'WLF';
UPDATE llx_c_country SET numeric_code = '887' WHERE code_iso = 'YEM';
UPDATE llx_c_country SET numeric_code = '262' WHERE code_iso = 'DJI';
UPDATE llx_c_country SET numeric_code = '894' WHERE code_iso = 'ZMB';
UPDATE llx_c_country SET numeric_code = '716' WHERE code_iso = 'ZWE';

View File

@ -33,8 +33,9 @@
-- Missing in v16 or lower
ALTER TABLE llx_accounting_account DROP FOREIGN KEY fk_accounting_account_fk_pcg_version;
ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32) NOT NULL;
ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version);
ALTER TABLE llx_c_action_trigger MODIFY elementtype VARCHAR(64);

View File

@ -123,254 +123,254 @@ ALTER TABLE llx_element_time ADD INDEX idx_element_time_datehour (element_dateho
ALTER TABLE llx_c_country ADD COLUMN numeric_code VARCHAR(3);
UPDATE llx_c_country SET numeric_code = '004' WHERE code_iso = "AFG";
UPDATE llx_c_country SET numeric_code = '248' WHERE code_iso = "ALA";
UPDATE llx_c_country SET numeric_code = '008' WHERE code_iso = "ALB";
UPDATE llx_c_country SET numeric_code = '276' WHERE code_iso = "DEU";
UPDATE llx_c_country SET numeric_code = '020' WHERE code_iso = "AND";
UPDATE llx_c_country SET numeric_code = '024' WHERE code_iso = "AGO";
UPDATE llx_c_country SET numeric_code = '660' WHERE code_iso = "AIA";
UPDATE llx_c_country SET numeric_code = '010' WHERE code_iso = "ATA";
UPDATE llx_c_country SET numeric_code = '028' WHERE code_iso = "ATG";
UPDATE llx_c_country SET numeric_code = '682' WHERE code_iso = "SAU";
UPDATE llx_c_country SET numeric_code = '012' WHERE code_iso = "DZA";
UPDATE llx_c_country SET numeric_code = '032' WHERE code_iso = "ARG";
UPDATE llx_c_country SET numeric_code = '051' WHERE code_iso = "ARM";
UPDATE llx_c_country SET numeric_code = '533' WHERE code_iso = "ABW";
UPDATE llx_c_country SET numeric_code = '036' WHERE code_iso = "AUS";
UPDATE llx_c_country SET numeric_code = '040' WHERE code_iso = "AUT";
UPDATE llx_c_country SET numeric_code = '031' WHERE code_iso = "AZE";
UPDATE llx_c_country SET numeric_code = '044' WHERE code_iso = "BHS";
UPDATE llx_c_country SET numeric_code = '050' WHERE code_iso = "BGD";
UPDATE llx_c_country SET numeric_code = '052' WHERE code_iso = "BRB";
UPDATE llx_c_country SET numeric_code = '048' WHERE code_iso = "BHR";
UPDATE llx_c_country SET numeric_code = '056' WHERE code_iso = "BEL";
UPDATE llx_c_country SET numeric_code = '084' WHERE code_iso = "BLZ";
UPDATE llx_c_country SET numeric_code = '204' WHERE code_iso = "BEN";
UPDATE llx_c_country SET numeric_code = '060' WHERE code_iso = "BMU";
UPDATE llx_c_country SET numeric_code = '112' WHERE code_iso = "BLR";
UPDATE llx_c_country SET numeric_code = '068' WHERE code_iso = "BOL";
UPDATE llx_c_country SET numeric_code = '535' WHERE code_iso = "BES";
UPDATE llx_c_country SET numeric_code = '070' WHERE code_iso = "BIH";
UPDATE llx_c_country SET numeric_code = '072' WHERE code_iso = "BWA";
UPDATE llx_c_country SET numeric_code = '076' WHERE code_iso = "BRA";
UPDATE llx_c_country SET numeric_code = '096' WHERE code_iso = "BRN";
UPDATE llx_c_country SET numeric_code = '100' WHERE code_iso = "BGR";
UPDATE llx_c_country SET numeric_code = '854' WHERE code_iso = "BFA";
UPDATE llx_c_country SET numeric_code = '108' WHERE code_iso = "BDI";
UPDATE llx_c_country SET numeric_code = '064' WHERE code_iso = "BTN";
UPDATE llx_c_country SET numeric_code = '132' WHERE code_iso = "CPV";
UPDATE llx_c_country SET numeric_code = '116' WHERE code_iso = "KHM";
UPDATE llx_c_country SET numeric_code = '120' WHERE code_iso = "CMR";
UPDATE llx_c_country SET numeric_code = '124' WHERE code_iso = "CAN";
UPDATE llx_c_country SET numeric_code = '634' WHERE code_iso = "QAT";
UPDATE llx_c_country SET numeric_code = '148' WHERE code_iso = "TCD";
UPDATE llx_c_country SET numeric_code = '152' WHERE code_iso = "CHL";
UPDATE llx_c_country SET numeric_code = '156' WHERE code_iso = "CHN";
UPDATE llx_c_country SET numeric_code = '196' WHERE code_iso = "CYP";
UPDATE llx_c_country SET numeric_code = '170' WHERE code_iso = "COL";
UPDATE llx_c_country SET numeric_code = '174' WHERE code_iso = "COM";
UPDATE llx_c_country SET numeric_code = '408' WHERE code_iso = "PRK";
UPDATE llx_c_country SET numeric_code = '410' WHERE code_iso = "KOR";
UPDATE llx_c_country SET numeric_code = '384' WHERE code_iso = "CIV";
UPDATE llx_c_country SET numeric_code = '188' WHERE code_iso = "CRI";
UPDATE llx_c_country SET numeric_code = '191' WHERE code_iso = "HRV";
UPDATE llx_c_country SET numeric_code = '192' WHERE code_iso = "CUB";
UPDATE llx_c_country SET numeric_code = '531' WHERE code_iso = "CUW";
UPDATE llx_c_country SET numeric_code = '208' WHERE code_iso = "DNK";
UPDATE llx_c_country SET numeric_code = '212' WHERE code_iso = "DMA";
UPDATE llx_c_country SET numeric_code = '218' WHERE code_iso = "ECU";
UPDATE llx_c_country SET numeric_code = '818' WHERE code_iso = "EGY";
UPDATE llx_c_country SET numeric_code = '222' WHERE code_iso = "SLV";
UPDATE llx_c_country SET numeric_code = '784' WHERE code_iso = "ARE";
UPDATE llx_c_country SET numeric_code = '232' WHERE code_iso = "ERI";
UPDATE llx_c_country SET numeric_code = '703' WHERE code_iso = "SVK";
UPDATE llx_c_country SET numeric_code = '705' WHERE code_iso = "SVN";
UPDATE llx_c_country SET numeric_code = '724' WHERE code_iso = "ESP";
UPDATE llx_c_country SET numeric_code = '840' WHERE code_iso = "USA";
UPDATE llx_c_country SET numeric_code = '233' WHERE code_iso = "EST";
UPDATE llx_c_country SET numeric_code = '231' WHERE code_iso = "ETH";
UPDATE llx_c_country SET numeric_code = '608' WHERE code_iso = "PHL";
UPDATE llx_c_country SET numeric_code = '246' WHERE code_iso = "FIN";
UPDATE llx_c_country SET numeric_code = '242' WHERE code_iso = "FJI";
UPDATE llx_c_country SET numeric_code = '250' WHERE code_iso = "FRA";
UPDATE llx_c_country SET numeric_code = '266' WHERE code_iso = "GAB";
UPDATE llx_c_country SET numeric_code = '270' WHERE code_iso = "GMB";
UPDATE llx_c_country SET numeric_code = '268' WHERE code_iso = "GEO";
UPDATE llx_c_country SET numeric_code = '288' WHERE code_iso = "GHA";
UPDATE llx_c_country SET numeric_code = '292' WHERE code_iso = "GIB";
UPDATE llx_c_country SET numeric_code = '308' WHERE code_iso = "GRD";
UPDATE llx_c_country SET numeric_code = '300' WHERE code_iso = "GRC";
UPDATE llx_c_country SET numeric_code = '304' WHERE code_iso = "GRL";
UPDATE llx_c_country SET numeric_code = '312' WHERE code_iso = "GLP";
UPDATE llx_c_country SET numeric_code = '316' WHERE code_iso = "GUM";
UPDATE llx_c_country SET numeric_code = '320' WHERE code_iso = "GTM";
UPDATE llx_c_country SET numeric_code = '254' WHERE code_iso = "GUF";
UPDATE llx_c_country SET numeric_code = '831' WHERE code_iso = "GGY";
UPDATE llx_c_country SET numeric_code = '324' WHERE code_iso = "GIN";
UPDATE llx_c_country SET numeric_code = '624' WHERE code_iso = "GNB";
UPDATE llx_c_country SET numeric_code = '226' WHERE code_iso = "GNQ";
UPDATE llx_c_country SET numeric_code = '328' WHERE code_iso = "GUY";
UPDATE llx_c_country SET numeric_code = '332' WHERE code_iso = "HTI";
UPDATE llx_c_country SET numeric_code = '340' WHERE code_iso = "HND";
UPDATE llx_c_country SET numeric_code = '344' WHERE code_iso = "HKG";
UPDATE llx_c_country SET numeric_code = '348' WHERE code_iso = "HUN";
UPDATE llx_c_country SET numeric_code = '356' WHERE code_iso = "IND";
UPDATE llx_c_country SET numeric_code = '360' WHERE code_iso = "IDN";
UPDATE llx_c_country SET numeric_code = '368' WHERE code_iso = "IRQ";
UPDATE llx_c_country SET numeric_code = '364' WHERE code_iso = "IRN";
UPDATE llx_c_country SET numeric_code = '372' WHERE code_iso = "IRL";
UPDATE llx_c_country SET numeric_code = '074' WHERE code_iso = "BVT";
UPDATE llx_c_country SET numeric_code = '833' WHERE code_iso = "IMN";
UPDATE llx_c_country SET numeric_code = '162' WHERE code_iso = "CXR";
UPDATE llx_c_country SET numeric_code = '352' WHERE code_iso = "ISL";
UPDATE llx_c_country SET numeric_code = '136' WHERE code_iso = "CYM";
UPDATE llx_c_country SET numeric_code = '166' WHERE code_iso = "CCK";
UPDATE llx_c_country SET numeric_code = '184' WHERE code_iso = "COK";
UPDATE llx_c_country SET numeric_code = '234' WHERE code_iso = "FRO";
UPDATE llx_c_country SET numeric_code = '239' WHERE code_iso = "SGS";
UPDATE llx_c_country SET numeric_code = '334' WHERE code_iso = "HMD";
UPDATE llx_c_country SET numeric_code = '238' WHERE code_iso = "FLK";
UPDATE llx_c_country SET numeric_code = '580' WHERE code_iso = "MNP";
UPDATE llx_c_country SET numeric_code = '584' WHERE code_iso = "MHL";
UPDATE llx_c_country SET numeric_code = '612' WHERE code_iso = "PCN";
UPDATE llx_c_country SET numeric_code = '090' WHERE code_iso = "SLB";
UPDATE llx_c_country SET numeric_code = '796' WHERE code_iso = "TCA";
UPDATE llx_c_country SET numeric_code = '581' WHERE code_iso = "UMI";
UPDATE llx_c_country SET numeric_code = '092' WHERE code_iso = "VGB";
UPDATE llx_c_country SET numeric_code = '850' WHERE code_iso = "VIR";
UPDATE llx_c_country SET numeric_code = '376' WHERE code_iso = "ISR";
UPDATE llx_c_country SET numeric_code = '380' WHERE code_iso = "ITA";
UPDATE llx_c_country SET numeric_code = '388' WHERE code_iso = "JAM";
UPDATE llx_c_country SET numeric_code = '392' WHERE code_iso = "JPN";
UPDATE llx_c_country SET numeric_code = '832' WHERE code_iso = "JEY";
UPDATE llx_c_country SET numeric_code = '400' WHERE code_iso = "JOR";
UPDATE llx_c_country SET numeric_code = '398' WHERE code_iso = "KAZ";
UPDATE llx_c_country SET numeric_code = '404' WHERE code_iso = "KEN";
UPDATE llx_c_country SET numeric_code = '417' WHERE code_iso = "KGZ";
UPDATE llx_c_country SET numeric_code = '296' WHERE code_iso = "KIR";
UPDATE llx_c_country SET numeric_code = '414' WHERE code_iso = "KWT";
UPDATE llx_c_country SET numeric_code = '418' WHERE code_iso = "LAO";
UPDATE llx_c_country SET numeric_code = '426' WHERE code_iso = "LSO";
UPDATE llx_c_country SET numeric_code = '428' WHERE code_iso = "LVA";
UPDATE llx_c_country SET numeric_code = '422' WHERE code_iso = "LBN";
UPDATE llx_c_country SET numeric_code = '430' WHERE code_iso = "LBR";
UPDATE llx_c_country SET numeric_code = '434' WHERE code_iso = "LBY";
UPDATE llx_c_country SET numeric_code = '438' WHERE code_iso = "LIE";
UPDATE llx_c_country SET numeric_code = '440' WHERE code_iso = "LTU";
UPDATE llx_c_country SET numeric_code = '442' WHERE code_iso = "LUX";
UPDATE llx_c_country SET numeric_code = '446' WHERE code_iso = "MAC";
UPDATE llx_c_country SET numeric_code = '807' WHERE code_iso = "MKD";
UPDATE llx_c_country SET numeric_code = '450' WHERE code_iso = "MDG";
UPDATE llx_c_country SET numeric_code = '458' WHERE code_iso = "MYS";
UPDATE llx_c_country SET numeric_code = '454' WHERE code_iso = "MWI";
UPDATE llx_c_country SET numeric_code = '462' WHERE code_iso = "MDV";
UPDATE llx_c_country SET numeric_code = '466' WHERE code_iso = "MLI";
UPDATE llx_c_country SET numeric_code = '470' WHERE code_iso = "MLT";
UPDATE llx_c_country SET numeric_code = '504' WHERE code_iso = "MAR";
UPDATE llx_c_country SET numeric_code = '474' WHERE code_iso = "MTQ";
UPDATE llx_c_country SET numeric_code = '480' WHERE code_iso = "MUS";
UPDATE llx_c_country SET numeric_code = '478' WHERE code_iso = "MRT";
UPDATE llx_c_country SET numeric_code = '175' WHERE code_iso = "MYT";
UPDATE llx_c_country SET numeric_code = '484' WHERE code_iso = "MEX";
UPDATE llx_c_country SET numeric_code = '583' WHERE code_iso = "FSM";
UPDATE llx_c_country SET numeric_code = '498' WHERE code_iso = "MDA";
UPDATE llx_c_country SET numeric_code = '492' WHERE code_iso = "MCO";
UPDATE llx_c_country SET numeric_code = '496' WHERE code_iso = "MNG";
UPDATE llx_c_country SET numeric_code = '499' WHERE code_iso = "MNE";
UPDATE llx_c_country SET numeric_code = '500' WHERE code_iso = "MSR";
UPDATE llx_c_country SET numeric_code = '508' WHERE code_iso = "MOZ";
UPDATE llx_c_country SET numeric_code = '104' WHERE code_iso = "MMR";
UPDATE llx_c_country SET numeric_code = '516' WHERE code_iso = "NAM";
UPDATE llx_c_country SET numeric_code = '520' WHERE code_iso = "NRU";
UPDATE llx_c_country SET numeric_code = '524' WHERE code_iso = "NPL";
UPDATE llx_c_country SET numeric_code = '558' WHERE code_iso = "NIC";
UPDATE llx_c_country SET numeric_code = '562' WHERE code_iso = "NER";
UPDATE llx_c_country SET numeric_code = '566' WHERE code_iso = "NGA";
UPDATE llx_c_country SET numeric_code = '570' WHERE code_iso = "NIU";
UPDATE llx_c_country SET numeric_code = '574' WHERE code_iso = "NFK";
UPDATE llx_c_country SET numeric_code = '578' WHERE code_iso = "NOR";
UPDATE llx_c_country SET numeric_code = '540' WHERE code_iso = "NCL";
UPDATE llx_c_country SET numeric_code = '554' WHERE code_iso = "NZL";
UPDATE llx_c_country SET numeric_code = '512' WHERE code_iso = "OMN";
UPDATE llx_c_country SET numeric_code = '528' WHERE code_iso = "NLD";
UPDATE llx_c_country SET numeric_code = '586' WHERE code_iso = "PAK";
UPDATE llx_c_country SET numeric_code = '585' WHERE code_iso = "PLW";
UPDATE llx_c_country SET numeric_code = '275' WHERE code_iso = "PSE";
UPDATE llx_c_country SET numeric_code = '591' WHERE code_iso = "PAN";
UPDATE llx_c_country SET numeric_code = '598' WHERE code_iso = "PNG";
UPDATE llx_c_country SET numeric_code = '600' WHERE code_iso = "PRY";
UPDATE llx_c_country SET numeric_code = '604' WHERE code_iso = "PER";
UPDATE llx_c_country SET numeric_code = '258' WHERE code_iso = "PYF";
UPDATE llx_c_country SET numeric_code = '616' WHERE code_iso = "POL";
UPDATE llx_c_country SET numeric_code = '620' WHERE code_iso = "PRT";
UPDATE llx_c_country SET numeric_code = '630' WHERE code_iso = "PRI";
UPDATE llx_c_country SET numeric_code = '826' WHERE code_iso = "GBR";
UPDATE llx_c_country SET numeric_code = '732' WHERE code_iso = "ESH";
UPDATE llx_c_country SET numeric_code = '140' WHERE code_iso = "CAF";
UPDATE llx_c_country SET numeric_code = '203' WHERE code_iso = "CZE";
UPDATE llx_c_country SET numeric_code = '178' WHERE code_iso = "COG";
UPDATE llx_c_country SET numeric_code = '180' WHERE code_iso = "COD";
UPDATE llx_c_country SET numeric_code = '214' WHERE code_iso = "DOM";
UPDATE llx_c_country SET numeric_code = '638' WHERE code_iso = "REU";
UPDATE llx_c_country SET numeric_code = '646' WHERE code_iso = "RWA";
UPDATE llx_c_country SET numeric_code = '642' WHERE code_iso = "ROU";
UPDATE llx_c_country SET numeric_code = '643' WHERE code_iso = "RUS";
UPDATE llx_c_country SET numeric_code = '882' WHERE code_iso = "WSM";
UPDATE llx_c_country SET numeric_code = '016' WHERE code_iso = "ASM";
UPDATE llx_c_country SET numeric_code = '652' WHERE code_iso = "BLM";
UPDATE llx_c_country SET numeric_code = '659' WHERE code_iso = "KNA";
UPDATE llx_c_country SET numeric_code = '674' WHERE code_iso = "SMR";
UPDATE llx_c_country SET numeric_code = '663' WHERE code_iso = "MAF";
UPDATE llx_c_country SET numeric_code = '666' WHERE code_iso = "SPM";
UPDATE llx_c_country SET numeric_code = '670' WHERE code_iso = "VCT";
UPDATE llx_c_country SET numeric_code = '654' WHERE code_iso = "SHN";
UPDATE llx_c_country SET numeric_code = '662' WHERE code_iso = "LCA";
UPDATE llx_c_country SET numeric_code = '678' WHERE code_iso = "STP";
UPDATE llx_c_country SET numeric_code = '686' WHERE code_iso = "SEN";
UPDATE llx_c_country SET numeric_code = '688' WHERE code_iso = "SRB";
UPDATE llx_c_country SET numeric_code = '690' WHERE code_iso = "SYC";
UPDATE llx_c_country SET numeric_code = '694' WHERE code_iso = "SLE";
UPDATE llx_c_country SET numeric_code = '702' WHERE code_iso = "SGP";
UPDATE llx_c_country SET numeric_code = '534' WHERE code_iso = "SXM";
UPDATE llx_c_country SET numeric_code = '760' WHERE code_iso = "SYR";
UPDATE llx_c_country SET numeric_code = '706' WHERE code_iso = "SOM";
UPDATE llx_c_country SET numeric_code = '144' WHERE code_iso = "LKA";
UPDATE llx_c_country SET numeric_code = '748' WHERE code_iso = "SWZ";
UPDATE llx_c_country SET numeric_code = '710' WHERE code_iso = "ZAF";
UPDATE llx_c_country SET numeric_code = '729' WHERE code_iso = "SDN";
UPDATE llx_c_country SET numeric_code = '728' WHERE code_iso = "SSD";
UPDATE llx_c_country SET numeric_code = '752' WHERE code_iso = "SWE";
UPDATE llx_c_country SET numeric_code = '756' WHERE code_iso = "CHE";
UPDATE llx_c_country SET numeric_code = '740' WHERE code_iso = "SUR";
UPDATE llx_c_country SET numeric_code = '744' WHERE code_iso = "SJM";
UPDATE llx_c_country SET numeric_code = '764' WHERE code_iso = "THA";
UPDATE llx_c_country SET numeric_code = '158' WHERE code_iso = "TWN";
UPDATE llx_c_country SET numeric_code = '834' WHERE code_iso = "TZA";
UPDATE llx_c_country SET numeric_code = '762' WHERE code_iso = "TJK";
UPDATE llx_c_country SET numeric_code = '086' WHERE code_iso = "IOT";
UPDATE llx_c_country SET numeric_code = '260' WHERE code_iso = "ATF";
UPDATE llx_c_country SET numeric_code = '626' WHERE code_iso = "TLS";
UPDATE llx_c_country SET numeric_code = '768' WHERE code_iso = "TGO";
UPDATE llx_c_country SET numeric_code = '772' WHERE code_iso = "TKL";
UPDATE llx_c_country SET numeric_code = '776' WHERE code_iso = "TON";
UPDATE llx_c_country SET numeric_code = '780' WHERE code_iso = "TTO";
UPDATE llx_c_country SET numeric_code = '788' WHERE code_iso = "TUN";
UPDATE llx_c_country SET numeric_code = '795' WHERE code_iso = "TKM";
UPDATE llx_c_country SET numeric_code = '792' WHERE code_iso = "TUR";
UPDATE llx_c_country SET numeric_code = '798' WHERE code_iso = "TUV";
UPDATE llx_c_country SET numeric_code = '804' WHERE code_iso = "UKR";
UPDATE llx_c_country SET numeric_code = '800' WHERE code_iso = "UGA";
UPDATE llx_c_country SET numeric_code = '858' WHERE code_iso = "URY";
UPDATE llx_c_country SET numeric_code = '860' WHERE code_iso = "UZB";
UPDATE llx_c_country SET numeric_code = '548' WHERE code_iso = "VUT";
UPDATE llx_c_country SET numeric_code = '336' WHERE code_iso = "VAT";
UPDATE llx_c_country SET numeric_code = '862' WHERE code_iso = "VEN";
UPDATE llx_c_country SET numeric_code = '704' WHERE code_iso = "VNM";
UPDATE llx_c_country SET numeric_code = '876' WHERE code_iso = "WLF";
UPDATE llx_c_country SET numeric_code = '887' WHERE code_iso = "YEM";
UPDATE llx_c_country SET numeric_code = '262' WHERE code_iso = "DJI";
UPDATE llx_c_country SET numeric_code = '894' WHERE code_iso = "ZMB";
UPDATE llx_c_country SET numeric_code = '716' WHERE code_iso = "ZWE";
UPDATE llx_c_country SET numeric_code = '004' WHERE code_iso = 'AFG';
UPDATE llx_c_country SET numeric_code = '248' WHERE code_iso = 'ALA';
UPDATE llx_c_country SET numeric_code = '008' WHERE code_iso = 'ALB';
UPDATE llx_c_country SET numeric_code = '276' WHERE code_iso = 'DEU';
UPDATE llx_c_country SET numeric_code = '020' WHERE code_iso = 'AND';
UPDATE llx_c_country SET numeric_code = '024' WHERE code_iso = 'AGO';
UPDATE llx_c_country SET numeric_code = '660' WHERE code_iso = 'AIA';
UPDATE llx_c_country SET numeric_code = '010' WHERE code_iso = 'ATA';
UPDATE llx_c_country SET numeric_code = '028' WHERE code_iso = 'ATG';
UPDATE llx_c_country SET numeric_code = '682' WHERE code_iso = 'SAU';
UPDATE llx_c_country SET numeric_code = '012' WHERE code_iso = 'DZA';
UPDATE llx_c_country SET numeric_code = '032' WHERE code_iso = 'ARG';
UPDATE llx_c_country SET numeric_code = '051' WHERE code_iso = 'ARM';
UPDATE llx_c_country SET numeric_code = '533' WHERE code_iso = 'ABW';
UPDATE llx_c_country SET numeric_code = '036' WHERE code_iso = 'AUS';
UPDATE llx_c_country SET numeric_code = '040' WHERE code_iso = 'AUT';
UPDATE llx_c_country SET numeric_code = '031' WHERE code_iso = 'AZE';
UPDATE llx_c_country SET numeric_code = '044' WHERE code_iso = 'BHS';
UPDATE llx_c_country SET numeric_code = '050' WHERE code_iso = 'BGD';
UPDATE llx_c_country SET numeric_code = '052' WHERE code_iso = 'BRB';
UPDATE llx_c_country SET numeric_code = '048' WHERE code_iso = 'BHR';
UPDATE llx_c_country SET numeric_code = '056' WHERE code_iso = 'BEL';
UPDATE llx_c_country SET numeric_code = '084' WHERE code_iso = 'BLZ';
UPDATE llx_c_country SET numeric_code = '204' WHERE code_iso = 'BEN';
UPDATE llx_c_country SET numeric_code = '060' WHERE code_iso = 'BMU';
UPDATE llx_c_country SET numeric_code = '112' WHERE code_iso = 'BLR';
UPDATE llx_c_country SET numeric_code = '068' WHERE code_iso = 'BOL';
UPDATE llx_c_country SET numeric_code = '535' WHERE code_iso = 'BES';
UPDATE llx_c_country SET numeric_code = '070' WHERE code_iso = 'BIH';
UPDATE llx_c_country SET numeric_code = '072' WHERE code_iso = 'BWA';
UPDATE llx_c_country SET numeric_code = '076' WHERE code_iso = 'BRA';
UPDATE llx_c_country SET numeric_code = '096' WHERE code_iso = 'BRN';
UPDATE llx_c_country SET numeric_code = '100' WHERE code_iso = 'BGR';
UPDATE llx_c_country SET numeric_code = '854' WHERE code_iso = 'BFA';
UPDATE llx_c_country SET numeric_code = '108' WHERE code_iso = 'BDI';
UPDATE llx_c_country SET numeric_code = '064' WHERE code_iso = 'BTN';
UPDATE llx_c_country SET numeric_code = '132' WHERE code_iso = 'CPV';
UPDATE llx_c_country SET numeric_code = '116' WHERE code_iso = 'KHM';
UPDATE llx_c_country SET numeric_code = '120' WHERE code_iso = 'CMR';
UPDATE llx_c_country SET numeric_code = '124' WHERE code_iso = 'CAN';
UPDATE llx_c_country SET numeric_code = '634' WHERE code_iso = 'QAT';
UPDATE llx_c_country SET numeric_code = '148' WHERE code_iso = 'TCD';
UPDATE llx_c_country SET numeric_code = '152' WHERE code_iso = 'CHL';
UPDATE llx_c_country SET numeric_code = '156' WHERE code_iso = 'CHN';
UPDATE llx_c_country SET numeric_code = '196' WHERE code_iso = 'CYP';
UPDATE llx_c_country SET numeric_code = '170' WHERE code_iso = 'COL';
UPDATE llx_c_country SET numeric_code = '174' WHERE code_iso = 'COM';
UPDATE llx_c_country SET numeric_code = '408' WHERE code_iso = 'PRK';
UPDATE llx_c_country SET numeric_code = '410' WHERE code_iso = 'KOR';
UPDATE llx_c_country SET numeric_code = '384' WHERE code_iso = 'CIV';
UPDATE llx_c_country SET numeric_code = '188' WHERE code_iso = 'CRI';
UPDATE llx_c_country SET numeric_code = '191' WHERE code_iso = 'HRV';
UPDATE llx_c_country SET numeric_code = '192' WHERE code_iso = 'CUB';
UPDATE llx_c_country SET numeric_code = '531' WHERE code_iso = 'CUW';
UPDATE llx_c_country SET numeric_code = '208' WHERE code_iso = 'DNK';
UPDATE llx_c_country SET numeric_code = '212' WHERE code_iso = 'DMA';
UPDATE llx_c_country SET numeric_code = '218' WHERE code_iso = 'ECU';
UPDATE llx_c_country SET numeric_code = '818' WHERE code_iso = 'EGY';
UPDATE llx_c_country SET numeric_code = '222' WHERE code_iso = 'SLV';
UPDATE llx_c_country SET numeric_code = '784' WHERE code_iso = 'ARE';
UPDATE llx_c_country SET numeric_code = '232' WHERE code_iso = 'ERI';
UPDATE llx_c_country SET numeric_code = '703' WHERE code_iso = 'SVK';
UPDATE llx_c_country SET numeric_code = '705' WHERE code_iso = 'SVN';
UPDATE llx_c_country SET numeric_code = '724' WHERE code_iso = 'ESP';
UPDATE llx_c_country SET numeric_code = '840' WHERE code_iso = 'USA';
UPDATE llx_c_country SET numeric_code = '233' WHERE code_iso = 'EST';
UPDATE llx_c_country SET numeric_code = '231' WHERE code_iso = 'ETH';
UPDATE llx_c_country SET numeric_code = '608' WHERE code_iso = 'PHL';
UPDATE llx_c_country SET numeric_code = '246' WHERE code_iso = 'FIN';
UPDATE llx_c_country SET numeric_code = '242' WHERE code_iso = 'FJI';
UPDATE llx_c_country SET numeric_code = '250' WHERE code_iso = 'FRA';
UPDATE llx_c_country SET numeric_code = '266' WHERE code_iso = 'GAB';
UPDATE llx_c_country SET numeric_code = '270' WHERE code_iso = 'GMB';
UPDATE llx_c_country SET numeric_code = '268' WHERE code_iso = 'GEO';
UPDATE llx_c_country SET numeric_code = '288' WHERE code_iso = 'GHA';
UPDATE llx_c_country SET numeric_code = '292' WHERE code_iso = 'GIB';
UPDATE llx_c_country SET numeric_code = '308' WHERE code_iso = 'GRD';
UPDATE llx_c_country SET numeric_code = '300' WHERE code_iso = 'GRC';
UPDATE llx_c_country SET numeric_code = '304' WHERE code_iso = 'GRL';
UPDATE llx_c_country SET numeric_code = '312' WHERE code_iso = 'GLP';
UPDATE llx_c_country SET numeric_code = '316' WHERE code_iso = 'GUM';
UPDATE llx_c_country SET numeric_code = '320' WHERE code_iso = 'GTM';
UPDATE llx_c_country SET numeric_code = '254' WHERE code_iso = 'GUF';
UPDATE llx_c_country SET numeric_code = '831' WHERE code_iso = 'GGY';
UPDATE llx_c_country SET numeric_code = '324' WHERE code_iso = 'GIN';
UPDATE llx_c_country SET numeric_code = '624' WHERE code_iso = 'GNB';
UPDATE llx_c_country SET numeric_code = '226' WHERE code_iso = 'GNQ';
UPDATE llx_c_country SET numeric_code = '328' WHERE code_iso = 'GUY';
UPDATE llx_c_country SET numeric_code = '332' WHERE code_iso = 'HTI';
UPDATE llx_c_country SET numeric_code = '340' WHERE code_iso = 'HND';
UPDATE llx_c_country SET numeric_code = '344' WHERE code_iso = 'HKG';
UPDATE llx_c_country SET numeric_code = '348' WHERE code_iso = 'HUN';
UPDATE llx_c_country SET numeric_code = '356' WHERE code_iso = 'IND';
UPDATE llx_c_country SET numeric_code = '360' WHERE code_iso = 'IDN';
UPDATE llx_c_country SET numeric_code = '368' WHERE code_iso = 'IRQ';
UPDATE llx_c_country SET numeric_code = '364' WHERE code_iso = 'IRN';
UPDATE llx_c_country SET numeric_code = '372' WHERE code_iso = 'IRL';
UPDATE llx_c_country SET numeric_code = '074' WHERE code_iso = 'BVT';
UPDATE llx_c_country SET numeric_code = '833' WHERE code_iso = 'IMN';
UPDATE llx_c_country SET numeric_code = '162' WHERE code_iso = 'CXR';
UPDATE llx_c_country SET numeric_code = '352' WHERE code_iso = 'ISL';
UPDATE llx_c_country SET numeric_code = '136' WHERE code_iso = 'CYM';
UPDATE llx_c_country SET numeric_code = '166' WHERE code_iso = 'CCK';
UPDATE llx_c_country SET numeric_code = '184' WHERE code_iso = 'COK';
UPDATE llx_c_country SET numeric_code = '234' WHERE code_iso = 'FRO';
UPDATE llx_c_country SET numeric_code = '239' WHERE code_iso = 'SGS';
UPDATE llx_c_country SET numeric_code = '334' WHERE code_iso = 'HMD';
UPDATE llx_c_country SET numeric_code = '238' WHERE code_iso = 'FLK';
UPDATE llx_c_country SET numeric_code = '580' WHERE code_iso = 'MNP';
UPDATE llx_c_country SET numeric_code = '584' WHERE code_iso = 'MHL';
UPDATE llx_c_country SET numeric_code = '612' WHERE code_iso = 'PCN';
UPDATE llx_c_country SET numeric_code = '090' WHERE code_iso = 'SLB';
UPDATE llx_c_country SET numeric_code = '796' WHERE code_iso = 'TCA';
UPDATE llx_c_country SET numeric_code = '581' WHERE code_iso = 'UMI';
UPDATE llx_c_country SET numeric_code = '092' WHERE code_iso = 'VGB';
UPDATE llx_c_country SET numeric_code = '850' WHERE code_iso = 'VIR';
UPDATE llx_c_country SET numeric_code = '376' WHERE code_iso = 'ISR';
UPDATE llx_c_country SET numeric_code = '380' WHERE code_iso = 'ITA';
UPDATE llx_c_country SET numeric_code = '388' WHERE code_iso = 'JAM';
UPDATE llx_c_country SET numeric_code = '392' WHERE code_iso = 'JPN';
UPDATE llx_c_country SET numeric_code = '832' WHERE code_iso = 'JEY';
UPDATE llx_c_country SET numeric_code = '400' WHERE code_iso = 'JOR';
UPDATE llx_c_country SET numeric_code = '398' WHERE code_iso = 'KAZ';
UPDATE llx_c_country SET numeric_code = '404' WHERE code_iso = 'KEN';
UPDATE llx_c_country SET numeric_code = '417' WHERE code_iso = 'KGZ';
UPDATE llx_c_country SET numeric_code = '296' WHERE code_iso = 'KIR';
UPDATE llx_c_country SET numeric_code = '414' WHERE code_iso = 'KWT';
UPDATE llx_c_country SET numeric_code = '418' WHERE code_iso = 'LAO';
UPDATE llx_c_country SET numeric_code = '426' WHERE code_iso = 'LSO';
UPDATE llx_c_country SET numeric_code = '428' WHERE code_iso = 'LVA';
UPDATE llx_c_country SET numeric_code = '422' WHERE code_iso = 'LBN';
UPDATE llx_c_country SET numeric_code = '430' WHERE code_iso = 'LBR';
UPDATE llx_c_country SET numeric_code = '434' WHERE code_iso = 'LBY';
UPDATE llx_c_country SET numeric_code = '438' WHERE code_iso = 'LIE';
UPDATE llx_c_country SET numeric_code = '440' WHERE code_iso = 'LTU';
UPDATE llx_c_country SET numeric_code = '442' WHERE code_iso = 'LUX';
UPDATE llx_c_country SET numeric_code = '446' WHERE code_iso = 'MAC';
UPDATE llx_c_country SET numeric_code = '807' WHERE code_iso = 'MKD';
UPDATE llx_c_country SET numeric_code = '450' WHERE code_iso = 'MDG';
UPDATE llx_c_country SET numeric_code = '458' WHERE code_iso = 'MYS';
UPDATE llx_c_country SET numeric_code = '454' WHERE code_iso = 'MWI';
UPDATE llx_c_country SET numeric_code = '462' WHERE code_iso = 'MDV';
UPDATE llx_c_country SET numeric_code = '466' WHERE code_iso = 'MLI';
UPDATE llx_c_country SET numeric_code = '470' WHERE code_iso = 'MLT';
UPDATE llx_c_country SET numeric_code = '504' WHERE code_iso = 'MAR';
UPDATE llx_c_country SET numeric_code = '474' WHERE code_iso = 'MTQ';
UPDATE llx_c_country SET numeric_code = '480' WHERE code_iso = 'MUS';
UPDATE llx_c_country SET numeric_code = '478' WHERE code_iso = 'MRT';
UPDATE llx_c_country SET numeric_code = '175' WHERE code_iso = 'MYT';
UPDATE llx_c_country SET numeric_code = '484' WHERE code_iso = 'MEX';
UPDATE llx_c_country SET numeric_code = '583' WHERE code_iso = 'FSM';
UPDATE llx_c_country SET numeric_code = '498' WHERE code_iso = 'MDA';
UPDATE llx_c_country SET numeric_code = '492' WHERE code_iso = 'MCO';
UPDATE llx_c_country SET numeric_code = '496' WHERE code_iso = 'MNG';
UPDATE llx_c_country SET numeric_code = '499' WHERE code_iso = 'MNE';
UPDATE llx_c_country SET numeric_code = '500' WHERE code_iso = 'MSR';
UPDATE llx_c_country SET numeric_code = '508' WHERE code_iso = 'MOZ';
UPDATE llx_c_country SET numeric_code = '104' WHERE code_iso = 'MMR';
UPDATE llx_c_country SET numeric_code = '516' WHERE code_iso = 'NAM';
UPDATE llx_c_country SET numeric_code = '520' WHERE code_iso = 'NRU';
UPDATE llx_c_country SET numeric_code = '524' WHERE code_iso = 'NPL';
UPDATE llx_c_country SET numeric_code = '558' WHERE code_iso = 'NIC';
UPDATE llx_c_country SET numeric_code = '562' WHERE code_iso = 'NER';
UPDATE llx_c_country SET numeric_code = '566' WHERE code_iso = 'NGA';
UPDATE llx_c_country SET numeric_code = '570' WHERE code_iso = 'NIU';
UPDATE llx_c_country SET numeric_code = '574' WHERE code_iso = 'NFK';
UPDATE llx_c_country SET numeric_code = '578' WHERE code_iso = 'NOR';
UPDATE llx_c_country SET numeric_code = '540' WHERE code_iso = 'NCL';
UPDATE llx_c_country SET numeric_code = '554' WHERE code_iso = 'NZL';
UPDATE llx_c_country SET numeric_code = '512' WHERE code_iso = 'OMN';
UPDATE llx_c_country SET numeric_code = '528' WHERE code_iso = 'NLD';
UPDATE llx_c_country SET numeric_code = '586' WHERE code_iso = 'PAK';
UPDATE llx_c_country SET numeric_code = '585' WHERE code_iso = 'PLW';
UPDATE llx_c_country SET numeric_code = '275' WHERE code_iso = 'PSE';
UPDATE llx_c_country SET numeric_code = '591' WHERE code_iso = 'PAN';
UPDATE llx_c_country SET numeric_code = '598' WHERE code_iso = 'PNG';
UPDATE llx_c_country SET numeric_code = '600' WHERE code_iso = 'PRY';
UPDATE llx_c_country SET numeric_code = '604' WHERE code_iso = 'PER';
UPDATE llx_c_country SET numeric_code = '258' WHERE code_iso = 'PYF';
UPDATE llx_c_country SET numeric_code = '616' WHERE code_iso = 'POL';
UPDATE llx_c_country SET numeric_code = '620' WHERE code_iso = 'PRT';
UPDATE llx_c_country SET numeric_code = '630' WHERE code_iso = 'PRI';
UPDATE llx_c_country SET numeric_code = '826' WHERE code_iso = 'GBR';
UPDATE llx_c_country SET numeric_code = '732' WHERE code_iso = 'ESH';
UPDATE llx_c_country SET numeric_code = '140' WHERE code_iso = 'CAF';
UPDATE llx_c_country SET numeric_code = '203' WHERE code_iso = 'CZE';
UPDATE llx_c_country SET numeric_code = '178' WHERE code_iso = 'COG';
UPDATE llx_c_country SET numeric_code = '180' WHERE code_iso = 'COD';
UPDATE llx_c_country SET numeric_code = '214' WHERE code_iso = 'DOM';
UPDATE llx_c_country SET numeric_code = '638' WHERE code_iso = 'REU';
UPDATE llx_c_country SET numeric_code = '646' WHERE code_iso = 'RWA';
UPDATE llx_c_country SET numeric_code = '642' WHERE code_iso = 'ROU';
UPDATE llx_c_country SET numeric_code = '643' WHERE code_iso = 'RUS';
UPDATE llx_c_country SET numeric_code = '882' WHERE code_iso = 'WSM';
UPDATE llx_c_country SET numeric_code = '016' WHERE code_iso = 'ASM';
UPDATE llx_c_country SET numeric_code = '652' WHERE code_iso = 'BLM';
UPDATE llx_c_country SET numeric_code = '659' WHERE code_iso = 'KNA';
UPDATE llx_c_country SET numeric_code = '674' WHERE code_iso = 'SMR';
UPDATE llx_c_country SET numeric_code = '663' WHERE code_iso = 'MAF';
UPDATE llx_c_country SET numeric_code = '666' WHERE code_iso = 'SPM';
UPDATE llx_c_country SET numeric_code = '670' WHERE code_iso = 'VCT';
UPDATE llx_c_country SET numeric_code = '654' WHERE code_iso = 'SHN';
UPDATE llx_c_country SET numeric_code = '662' WHERE code_iso = 'LCA';
UPDATE llx_c_country SET numeric_code = '678' WHERE code_iso = 'STP';
UPDATE llx_c_country SET numeric_code = '686' WHERE code_iso = 'SEN';
UPDATE llx_c_country SET numeric_code = '688' WHERE code_iso = 'SRB';
UPDATE llx_c_country SET numeric_code = '690' WHERE code_iso = 'SYC';
UPDATE llx_c_country SET numeric_code = '694' WHERE code_iso = 'SLE';
UPDATE llx_c_country SET numeric_code = '702' WHERE code_iso = 'SGP';
UPDATE llx_c_country SET numeric_code = '534' WHERE code_iso = 'SXM';
UPDATE llx_c_country SET numeric_code = '760' WHERE code_iso = 'SYR';
UPDATE llx_c_country SET numeric_code = '706' WHERE code_iso = 'SOM';
UPDATE llx_c_country SET numeric_code = '144' WHERE code_iso = 'LKA';
UPDATE llx_c_country SET numeric_code = '748' WHERE code_iso = 'SWZ';
UPDATE llx_c_country SET numeric_code = '710' WHERE code_iso = 'ZAF';
UPDATE llx_c_country SET numeric_code = '729' WHERE code_iso = 'SDN';
UPDATE llx_c_country SET numeric_code = '728' WHERE code_iso = 'SSD';
UPDATE llx_c_country SET numeric_code = '752' WHERE code_iso = 'SWE';
UPDATE llx_c_country SET numeric_code = '756' WHERE code_iso = 'CHE';
UPDATE llx_c_country SET numeric_code = '740' WHERE code_iso = 'SUR';
UPDATE llx_c_country SET numeric_code = '744' WHERE code_iso = 'SJM';
UPDATE llx_c_country SET numeric_code = '764' WHERE code_iso = 'THA';
UPDATE llx_c_country SET numeric_code = '158' WHERE code_iso = 'TWN';
UPDATE llx_c_country SET numeric_code = '834' WHERE code_iso = 'TZA';
UPDATE llx_c_country SET numeric_code = '762' WHERE code_iso = 'TJK';
UPDATE llx_c_country SET numeric_code = '086' WHERE code_iso = 'IOT';
UPDATE llx_c_country SET numeric_code = '260' WHERE code_iso = 'ATF';
UPDATE llx_c_country SET numeric_code = '626' WHERE code_iso = 'TLS';
UPDATE llx_c_country SET numeric_code = '768' WHERE code_iso = 'TGO';
UPDATE llx_c_country SET numeric_code = '772' WHERE code_iso = 'TKL';
UPDATE llx_c_country SET numeric_code = '776' WHERE code_iso = 'TON';
UPDATE llx_c_country SET numeric_code = '780' WHERE code_iso = 'TTO';
UPDATE llx_c_country SET numeric_code = '788' WHERE code_iso = 'TUN';
UPDATE llx_c_country SET numeric_code = '795' WHERE code_iso = 'TKM';
UPDATE llx_c_country SET numeric_code = '792' WHERE code_iso = 'TUR';
UPDATE llx_c_country SET numeric_code = '798' WHERE code_iso = 'TUV';
UPDATE llx_c_country SET numeric_code = '804' WHERE code_iso = 'UKR';
UPDATE llx_c_country SET numeric_code = '800' WHERE code_iso = 'UGA';
UPDATE llx_c_country SET numeric_code = '858' WHERE code_iso = 'URY';
UPDATE llx_c_country SET numeric_code = '860' WHERE code_iso = 'UZB';
UPDATE llx_c_country SET numeric_code = '548' WHERE code_iso = 'VUT';
UPDATE llx_c_country SET numeric_code = '336' WHERE code_iso = 'VAT';
UPDATE llx_c_country SET numeric_code = '862' WHERE code_iso = 'VEN';
UPDATE llx_c_country SET numeric_code = '704' WHERE code_iso = 'VNM';
UPDATE llx_c_country SET numeric_code = '876' WHERE code_iso = 'WLF';
UPDATE llx_c_country SET numeric_code = '887' WHERE code_iso = 'YEM';
UPDATE llx_c_country SET numeric_code = '262' WHERE code_iso = 'DJI';
UPDATE llx_c_country SET numeric_code = '894' WHERE code_iso = 'ZMB';
UPDATE llx_c_country SET numeric_code = '716' WHERE code_iso = 'ZWE';

View File

@ -222,6 +222,12 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
// For FR, default value of option to show category of operations is on by default. Decret n°2099-1299 2022-10-07
$conf->global->INVOICE_CATEGORY_OF_OPERATION = 1;
}
if ($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) {
// For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account).
// Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set.
$conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX = 1;
}
}

View File

@ -547,14 +547,14 @@ if (empty($reshook)) {
if (!empty($moreforfilter)) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters = array('type'=>$type);
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
@ -631,7 +631,7 @@ $totalarray['nbfield'] = 0;
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
foreach ($object->fields as $key => $val) {
@ -663,7 +663,7 @@ print $hookmanager->resPrint;
}*/
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
print '</tr>'."\n";

View File

@ -1821,7 +1821,6 @@ class Task extends CommonObjectLine
}
if (!$error) {
$timespent = new TimeSpent($this->db);
$timespent->fetch($this->timespent_id);

View File

@ -1111,11 +1111,11 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
$j = 0; $level = 0;
$nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields, $arrayofselected);
} else {
$colspan = 10;
$colspan = 11;
if ($object->usage_bill_time) {
$colspan += 2;
}
print '<tr class="oddeven nobottom"><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoTasks").'</span></td></tr>';
print '<tr class="oddeven"><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoTasks").'</span></td></tr>';
}
print "</table>";

View File

@ -512,7 +512,7 @@ $arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
print '<div class="ticketpublicarea">';
print '<div class="ticketpublicarea ticketlargemargin centpercent">';
if ($action != "infos_success") {
$formticket->withfromsocid = isset($socid) ? $socid : $user->socid;

View File

@ -80,7 +80,7 @@ $arrayofcss = array('/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
print '<div class="ticketpublicarea">';
print '<div class="ticketpublicarea ticketlargemargin centpercent">';
print '<p style="text-align: center">'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HOME", '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc")).'</span></p>').'</p>';
print '<br>';

View File

@ -193,9 +193,8 @@ $arrayofcss = array('/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
if ($action == "view_ticketlist") {
print '<div class="ticketpublicarealist">';
print '<div class="ticketpublicarealist ticketlargemargin centpercent">';
print '<br>';
if ($display_ticket_list) {
@ -426,6 +425,7 @@ if ($action == "view_ticketlist") {
$reshook=$hookmanager->executeHooks('printFieldListHeader', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<div class="div-table-responsive">';
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';
// Filter bar
@ -697,6 +697,8 @@ if ($action == "view_ticketlist") {
}
print '</table>';
print '</div>';
print '</form>';
print '<form method="post" id="form_view_ticket" name="form_view_ticket" action="'.dol_buildpath('/public/ticket/view.php', 1).(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" style="display:none;">';
@ -724,7 +726,7 @@ if ($action == "view_ticketlist") {
print '</div>';
} else {
print '<div class="ticketpublicarea">';
print '<div class="ticketpublicarea ticketlargemargin centpercent">';
print '<p class="center opacitymedium">'.$langs->trans("TicketPublicMsgViewLogIn").'</p>';
print '<br>';

View File

@ -232,7 +232,7 @@ $arrayofcss = array('/ticket/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
print '<div class="ticketpublicarea">';
print '<div class="ticketpublicarea ticketlargemargin centpercent">';
if ($action == "view_ticket" || $action == "presend" || $action == "close" || $action == "confirm_public_close") {
if ($display_ticket) {
@ -382,7 +382,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
// Close ticket
if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'">'.$langs->trans('CloseTicket').'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&token='.newToken().'&track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'&entity='.$entity:'').'">'.$langs->trans('CloseTicket').'</a></div>';
}
}
@ -396,10 +396,11 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>';
}
} else {
print '<div class="center opacitymedium margintoponly marginbottomonly">'.$langs->trans("TicketPublicMsgViewLogIn").'</div>';
print '<div class="center opacitymedium margintoponly marginbottomonly ticketlargemargin">'.$langs->trans("TicketPublicMsgViewLogIn").'</div>';
print '<div id="form_view_ticket">';
print '<form method="post" name="form_view_ticket" action="'.$_SERVER['PHP_SELF'].(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'').'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="view_ticket">';

View File

@ -205,7 +205,7 @@ $arrayofjs = array();
$arrayofcss = array();
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'.(GETPOST('mode')=='preview' ? ' scalepreview nopointervent' : ''), $replacemainarea, 1, 1);
llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'.(GETPOST('mode')=='preview' ? ' scalepreview cursorpointer virtualcardpreview' : ''), $replacemainarea, 1, 1);
print '<span id="dolpaymentspan"></span>'."\n";
print '<div class="center">'."\n";
@ -451,8 +451,6 @@ print '</div>'."\n";
print '<br>';
//htmlPrintOnlinePaymentFooter($mysoc, $langs);
print '<div class="backgreypublicpayment">';
print '<div class="center">';
print '<a href="'.$urlforqrcode.'">';
@ -465,6 +463,19 @@ print '</div>';
//print '</div>';
print '</div>';
$fullexternaleurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'external');
$fullinternalurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'internal');
print '<script>';
print 'jQuery(document).ready(function() {
jQuery(".virtualcardpreview").click(function(event) {
event.preventDefault();
console.log("We click on the card");
window.open("'.$fullexternaleurltovirtualcard.'");
});
});';
print '</script>';
llxFooter('', 'public');
$db->close();

View File

@ -1248,10 +1248,12 @@ if ($action == 'create' || $action == 'presend') {
}
print '</td></tr>';
// Group
print '<tr><td>'.$langs->trans("TicketCategory").'</td><td>';
$s = '';
if (!empty($object->category_code)) {
print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
$s = $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
}
print '<tr><td>'.$langs->trans("TicketCategory").'</td><td class="tdoverflowmax200" title="'.dol_escape_htmltag($s).'">';
print dol_escape_htmltag($s);
print '</td></tr>';
// Severity
print '<tr><td>'.$langs->trans("TicketSeverity").'</td><td>';

View File

@ -124,4 +124,10 @@ div.ticketform .index_create, div.ticketform .index_display {
@media only screen and (max-width: 767px)
{
#form_create_ticket input.text, #form_create_ticket textarea { width: unset;}
#form_create_ticket, #form_view_ticket
{
margin-left: 0;
margin-right: 0;
}
}

View File

@ -1046,13 +1046,13 @@ if ($action == 'create' || $action == 'adduserldap') {
if (preg_match('/http/', $dolibarr_main_authentication)) {
$valuetoshow .= ($valuetoshow ? ' + ' : '').$langs->trans("HTTPBasicPassword");
}
if (preg_match('/dolibarr/', $dolibarr_main_authentication)) {
if (preg_match('/dolibarr/', $dolibarr_main_authentication) || preg_match('/forceuser/', $dolibarr_main_authentication)) {
if (!empty($ldap_pass)) { // For very old system comaptibilty. Now clear password can't be viewed from LDAP read
$valuetoshow .= ($valuetoshow ? ' + ' : '').'<input type="hidden" name="password" value="'.dol_escape_htmltag($ldap_pass).'">'; // Dolibarr password is preffiled with LDAP known password
$valuetoshow .= preg_replace('/./i', '*', $ldap_pass);
} else {
// We do not use a field password but a field text to show new password to use.
$valuetoshow .= ($valuetoshow ? ' + '.$langs->trans("DolibarrPassword") : '').'<input class="minwidth300 maxwidth400 widthcentpercentminusx" maxsize="32" type="text" id="password" name="password" value="'.dol_escape_htmltag($password).'" autocomplete="new-password">';
$valuetoshow .= ($valuetoshow ? ' + '.$langs->trans("DolibarrPassword") : '').'<input class="minwidth300 maxwidth400 widthcentpercentminusx" maxlength="128" type="text" id="password" name="password" value="'.dol_escape_htmltag($password).'" autocomplete="new-password">';
if (!empty($conf->use_javascript_ajax)) {
$valuetoshow .= '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_password" class="linkobject"');
}
@ -1076,7 +1076,7 @@ if ($action == 'create' || $action == 'adduserldap') {
//$generated_password = getRandomPassword(false);
print '<tr><td>'.$langs->trans("ApiKey").'</td>';
print '<td>';
print '<input class="minwidth300 maxwidth400 widthcentpercentminusx" maxsize="32" type="text" id="api_key" name="api_key" value="'.GETPOST('api_key', 'alphanohtml').'" autocomplete="off">';
print '<input class="minwidth300 maxwidth400 widthcentpercentminusx" maxlength="128" type="text" id="api_key" name="api_key" value="'.GETPOST('api_key', 'alphanohtml').'" autocomplete="off">';
if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_api_key" class="linkobject"');
}
@ -2423,14 +2423,16 @@ if ($action == 'create' || $action == 'adduserldap') {
if (preg_match('/http/', $dolibarr_main_authentication)) {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$form->textwithpicto($text, $langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless", $dolibarr_main_authentication), 1, 'warning');
}
if (preg_match('/dolibarr/', $dolibarr_main_authentication)) {
if (preg_match('/dolibarr/', $dolibarr_main_authentication) || preg_match('/forceuser/', $dolibarr_main_authentication)) {
if ($caneditpassword) {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').'<input maxlength="128" type="password" class="flat" id="password" name="password" value="'.dol_escape_htmltag($object->pass).'" autocomplete="new-password">';
if (!empty($conf->use_javascript_ajax)) {
$valuetoshow .= '&nbsp;'.img_picto((getDolGlobalString('USER_PASSWORD_GENERATED') === 'none' ? $langs->trans('NoPasswordGenerationRuleConfigured') : $langs->trans('Generate')), 'refresh', 'id="generate_password" class="'.(getDolGlobalString('USER_PASSWORD_GENERATED') === 'none' ? ' opacitymedium' : ' linkobject').'"');
}
} else {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass);
}
}
// Other form for user password
$parameters = array('valuetoshow' => $valuetoshow, 'caneditpassword' => $caneditpassword);
$reshook = $hookmanager->executeHooks('printUserPasswordField', $parameters, $object, $action); // Note that $action and $object may have been modified by hook

View File

@ -35,9 +35,11 @@
* \ingroup core
*/
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
/**
* Class to manage Dolibarr users
*/
@ -509,7 +511,7 @@ class User extends CommonObject
$this->pass_indatabase_crypted = $obj->pass_crypted;
$this->pass = $obj->pass;
$this->pass_temp = $obj->pass_temp;
$this->api_key = $obj->api_key;
$this->api_key = dolDecrypt($obj->api_key);
$this->address = $obj->address;
$this->zip = $obj->zip;
@ -1963,7 +1965,7 @@ class User extends CommonObject
$sql .= ", national_registration_number = '".$this->db->escape($this->national_registration_number)."'";
$sql .= ", employee = ".(int) $this->employee;
$sql .= ", login = '".$this->db->escape($this->login)."'";
$sql .= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null");
$sql .= ", api_key = ".($this->api_key ? "'".$this->db->escape(dolEncrypt($this->api_key, '', '', 'dolibarr'))."'" : "null");
$sql .= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman'
$sql .= ", birth=".(strval($this->birth) != '' ? "'".$this->db->idate($this->birth, 'tzserver')."'" : 'null');
if (!empty($user->admin)) {
@ -3867,9 +3869,10 @@ class User extends CommonObject
* Return string with full Url to virtual card
*
* @param string $mode Mode for link
* @param string $typeofurl 'external' or 'internal'
* @return string Url string link
*/
public function getOnlineVirtualCardUrl($mode = '')
public function getOnlineVirtualCardUrl($mode = '', $typeofurl = 'external')
{
global $dolibarr_main_instance_unique_id, $dolibarr_main_url_root;
global $conf;
@ -3885,6 +3888,10 @@ class User extends CommonObject
$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
if ($typeofurl == 'internal') {
$urlwithroot = DOL_URL_ROOT;
}
return $urlwithroot.'/public/users/view.php?id='.$this->id.'&securekey='.$encodedsecurekey.$entity_qr.($mode ? '&mode='.urlencode($mode) : '');
}

View File

@ -116,7 +116,7 @@ class UserGroup extends CommonObject
'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
'nom'=>array('type'=>'varchar(180)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Group name'),
'note' => array('type'=>'html', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>20, 'notnull'=>-1,),
'note' => array('type'=>'html', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1),
'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>50, 'notnull'=>1,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>60, 'notnull'=>1,),
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>100),

View File

@ -473,7 +473,7 @@ if ($action == 'create') {
print "</td></tr>\n";
}
} else {
print '<tr><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr><td colspan="6"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print "</table>";
print '</div>';

View File

@ -30,9 +30,9 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
// Load translation files required by page
$langs->load("users");
$langs->loadLangs(array("users"));
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
@ -40,8 +40,8 @@ $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ09'); // Option for the css output (always '' except when 'print')
$mode = GETPOST('mode', 'aZ');
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_group = GETPOST('search_group');
@ -64,7 +64,7 @@ $pagenext = $page + 1;
$object = new UserGroup($db);
$extrafields = new ExtraFields($db);
//$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
//$hookmanager->initHooks(array('myobjectlist')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@ -80,10 +80,12 @@ if (!$sortorder) {
}
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
'g.nom'=>"Group",
'g.note'=>"Note"
);
$fieldstosearchall = array();
foreach ($object->fields as $key => $val) {
if (!empty($val['searchall'])) {
$fieldstosearchall['t.'.$key] = $val['label'];
}
}
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (!$user->hasRight("user", "group_advance", "read") && !$user->admin) {
@ -102,6 +104,7 @@ if (!$user->hasRight("user", "user", "read") && !$user->admin) {
// Defini si peux lire/modifier utilisateurs et permisssions
$caneditperms = ($user->admin || $user->hasRight("user", "user", "write"));
$permissiontodelete = ($user->admin || $user->hasRight("user", "user", "write"));
// Advanced permissions
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
$caneditperms = ($user->admin || $user->hasRight("user", "group_advance", "write"));
@ -146,6 +149,12 @@ if (empty($reshook)) {
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
// Mass actions
$objectclass = 'UserGroup';
$objectlabel = 'UserGroup';
$uploaddir = $conf->user->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -155,8 +164,10 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
$now = dol_now();
$title = $langs->trans("UserGroups");
$help_url = '';
$morejs = array();
$morecss = array();
@ -214,7 +225,7 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
$param .= '&limit='.((int) $limit);
}
foreach ($search as $key => $val) {
if (is_array($search[$key])) {
@ -238,7 +249,7 @@ if ($optioncss != '') {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Add $param from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$param .= $hookmanager->resPrint;
// List of mass actions available
@ -267,6 +278,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="page_y" value="">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
$newcardbutton = '';
@ -274,11 +286,18 @@ $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars i
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
if ($caneditperms) {
$newcardbutton .= dolGetButtonTitleSeparator();
$newcardbutton .= dolGetButtonTitle($langs->trans('NewGroup'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/group/card.php?action=create&leftmenu=');
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_group', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendGroup";
$modelmail = "group";
$objecttmp = new UserGroup($db);
$trackid = 'grp'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($search_all) {
$setupstring = '';
@ -286,14 +305,14 @@ if ($search_all) {
$fieldstosearchall[$key] = $langs->trans($val);
$setupstring .= $key."=".$val.";";
}
print '<!-- Search done like if USER_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
print '<!-- Search done like if GROUP_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>'."\n";
}
$moreforfilter = '';
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$moreforfilter .= $hookmanager->resPrint;
} else {
@ -303,16 +322,15 @@ if (empty($reshook)) {
if (!empty($moreforfilter)) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$arrayfields = array();
$selectedfields = '';
if (!empty($arrayfields)) {
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
}
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">';
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
@ -327,8 +345,9 @@ $totalarray['nbfield'] = 0;
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
print_liste_field_titre("Group", $_SERVER["PHP_SELF"], "g.nom", $param, "", "", $sortfield, $sortorder);
$totalarray['nbfield']++;
@ -349,17 +368,17 @@ $totalarray['nbfield']++;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
/*if (!empty($arrayfields['anotherfield']['checked'])) {
print '<th class="liste_titre right">'.$langs->trans("AnotherField").'</th>';
$totalarray['nbfield']++;
}*/
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
$totalarray['nbfield']++; // For the column action
print '</tr>'."\n";
@ -390,6 +409,12 @@ while ($i < $imaxinloop) {
print '<div class="box-flex-container kanban">';
}
// Output Kanban
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($object->id, $arrayofselected)) {
$selected = 1;
}
}
print $object->getKanbanView('');
if ($i == ($imaxinloop - 1)) {
print '</div>';
@ -400,7 +425,7 @@ while ($i < $imaxinloop) {
$j = 0;
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
@ -410,6 +435,9 @@ while ($i < $imaxinloop) {
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
print '<td>';
@ -451,10 +479,10 @@ while ($i < $imaxinloop) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
@ -464,9 +492,9 @@ while ($i < $imaxinloop) {
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
}
if (!$i) {
$totalarray['nbfield']++;
if (!$i) {
$totalarray['nbfield']++;
}
}
print '</tr>'."\n";
@ -485,7 +513,12 @@ if ($num == 0) {
$colspan++;
}
}*/
$colspan = $savnbfield;
$colspan = 1;
foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) {
$colspan++;
}
}
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
}

View File

@ -1152,10 +1152,13 @@ while ($i < $imaxinloop) {
}
}
if (!empty($arrayfields['u.api_key']['checked'])) {
print '<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->api_key).'">';
if ($obj->api_key) {
$api_key = dolDecrypt($obj->api_key);
print '<td class="tdoverflowmax125" title="'.dol_escape_htmltag($api_key).'">';
if ($api_key) {
if ($canreadsecretapi) {
print dol_escape_htmltag($obj->api_key);
print '<span class="opacitymedium">';
print showValueWithClipboardCPButton($object->api_key, 1, dol_trunc($api_key, 3)); // TODO Add an option to also reveal the hash, not only copy paste
print '</span>';
} else {
print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
}

View File

@ -165,7 +165,8 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('PublicVirtualCardUrl').'</span><br>';
$fullexternaleurltovirtualcard = $object->getOnlineVirtualCardUrl();
$fullexternaleurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'external');
$fullinternalurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'internal');
print '<div class="urllink">';
print '<input type="text" id="publicurluser" class="quatrevingtpercentminusx" value="'.$fullexternaleurltovirtualcard.'">';
@ -310,8 +311,8 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
print '<div class="center">';
print '<span class="opacitymedium">'.$langs->trans("Preview").'</span><br>';
print '<div class="virtualcard-div">';
print '<a target="_blank" rel="noopener noreferrer" href="'.$fullexternaleurltovirtualcard.'">';
print '<iframe id="virtualcard-iframe" title="" class="center" src="'.$fullexternaleurltovirtualcard.'&mode=preview">';
print '<a target="_blank" rel="noopener noreferrer cursorpointer" href="'.$fullexternaleurltovirtualcard.'">'."\n";
print '<iframe id="virtualcard-iframe" title="" class="center" src="'.$fullinternalurltovirtualcard.'&mode=preview">';
print '</iframe>';
print '</a>';
print '</div>';

View File

@ -180,12 +180,12 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
// An attempt for SQL injection
$filter='if(now()=sysdate()%2Csleep(6)%2C0)';
$sql = forgeSQLFromUniversalSearchCriteria($filter);
$this->assertEquals($sql, '1 = 3');
$this->assertEquals($sql, 'Filter syntax error');
// A real search string
$filter='(((statut:=:1) or (entity:in:__AAA__)) and (abc:<:2.0) and (abc:!=:1.23))';
$sql = forgeSQLFromUniversalSearchCriteria($filter);
$this->assertEquals($sql, ' AND (((statut = 1 or entity IN (__AAA__)) and abc < 2 and abc = 1.23))');
$this->assertEquals($sql, ' AND (((statut = 1 or entity IN (__AAA__)) and abc < 2 and abc <> 1.23))');
$filter="(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.date_creation:<:'2016-01-01 12:30:00') or (t.nature:is:NULL)";
$sql = forgeSQLFromUniversalSearchCriteria($filter);