diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7045695c1c2..353389c98a8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -551,6 +551,14 @@ if ($id == 25) if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder'); if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice'); if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty'); + + $parameters=array('elementList'=>$elementList); + $reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks + if ($reshook == 0) { + foreach ($hookmanager->resArray as $item => $value) { + $elementList[$item] = $value; + } + } } // Define localtax_typeList (used for dictionary "llx_c_tva") diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index f4e3d704121..2dff436ffe6 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; $langs->load("errors"); $langs->load("admin"); -$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):(isset($_SESSION['mode'])?$_SESSION['mode']:0); +$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):0; $action=GETPOST('action','alpha'); $value=GETPOST('value', 'alpha'); $page_y=GETPOST('page_y','int'); @@ -107,8 +107,6 @@ if (GETPOST('buttonreset')) $form = new Form($db); -$_SESSION["mode"]=$mode; - $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('',$langs->trans("Setup"),$help_url); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index b22ad287302..74684c823e7 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -263,7 +263,7 @@ if ($action == 'edit') // Edit print ''; $var=!$var; - print ''.$langs->trans("ShowDetailsInPDFPageFoot").''; + print ''.$langs->trans("ShowDetailsInPDFPageFoot").''; print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS); print ''; diff --git a/htdocs/api/admin/explorer.php b/htdocs/api/admin/explorer.php index 66d06e91679..262b3f69476 100644 --- a/htdocs/api/admin/explorer.php +++ b/htdocs/api/admin/explorer.php @@ -1,5 +1,6 @@ + * Copyright (C) 2016 Laurent Destailleur * * 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 @@ -19,11 +20,7 @@ * \defgroup api Module DolibarrApi * \brief API loader * Search files htdocs//class/api_.class.php - * \file htdocs/api/indexphp - * - * @todo User authentication with api_key - * - * + * \file htdocs/api/admin/explorer.php */ require_once '../../main.inc.php'; @@ -51,7 +48,6 @@ use \Luracast\Restler\Defaults; $api = new DolibarrApi($db); $api->r->addAPIClass('Luracast\\Restler\\Resources'); //this creates resources.json at API Root -$api->r->addAPIClass('DolibarrApiInit',''); // Just for url root page $api->r->setSupportedFormats('JsonFormat', 'XmlFormat'); $api->r->addAuthenticationClass('DolibarrApiAccess',''); @@ -149,7 +145,6 @@ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ApiSetup"),$linkback,'title_setup'); - // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file @@ -158,27 +153,46 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain // Show message print '
'; $message=''; -$url=''.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword'; +$url=''.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword[&reset=1]'; $message.=$langs->trans("UrlToGetKeyToUseAPIs").':
'; $message.=img_picto('','object_globe.png').' '.$url; print $message; print '
'; print '
'; +$oldclass=''; + print $langs->trans("ListOfAvailableAPIs").':
'; foreach($listofapis['v1'] as $key => $val) { if ($key == 'login') continue; + if ($key) { - //print $key.' - '.$val['classname'].' - '.$val['fullpath']." - ".DOL_MAIN_URL_ROOT.'/api/index.php/'.strtolower(preg_replace('/Api$/','',$val['classname']))."/xxx
\n"; - $url=$urlwithroot.'/api/index.php/'.$key; - $url.='?api_key=token'; - print img_picto('','object_globe.png').' '.$url."
\n"; - + foreach($val as $method => $val2) + { + $newclass=$val2['className']; + + if (preg_match('/restler/i', $newclass)) continue; + + if ($oldclass != $newclass) + { + print "\n
\n".$langs->trans("Class").': '.$newclass.'
'."\n"; + $oldclass = $newclass; + } + //print $key.' - '.$val['classname'].' - '.$val['fullpath']." - ".DOL_MAIN_URL_ROOT.'/api/index.php/'.strtolower(preg_replace('/Api$/','',$val['classname']))."/xxx
\n"; + $url=$urlwithroot.'/api/index.php/'.$key; + $url.='?api_key=token'; + print img_picto('','object_globe.png').' '.$method.' '.$url."
\n"; + } } } +print '
'; +print '
'; +print $langs->trans("OnlyActiveElementsAreExposed", DOL_URL_ROOT.'/admin/modules.php'); + + llxFooter(); $db->close(); diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index 2c31432b63b..3a69dadaaba 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -100,19 +100,6 @@ print ''.$langs->trans("ApiExporerIs").':
'; $url=DOL_MAIN_URL_ROOT.'/api/admin/explorer.php'; print img_picto('','object_globe.png').' '.$url."
\n"; -// API endpoint -/*print ''.$langs->trans("ApiEndPointIs").':
'; -$url=DOL_MAIN_URL_ROOT.'/api/index.php/xxx/list'; -print img_picto('','object_globe.png').' '.$url."
\n"; -$url=DOL_MAIN_URL_ROOT.'/api/xxx/list.json'; -print img_picto('','object_globe.png').' '.$url."
\n"; -*/ - -print '
'; -print '
'; -print $langs->trans("OnlyActiveElementsAreExposed", DOL_URL_ROOT.'/admin/modules.php'); - - llxFooter(); $db->close(); diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index bc5b4378c0c..b3a2cdaf9d0 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -140,89 +140,3 @@ class DolibarrApi return checkUserAccessToObject(DolibarrApiAccess::$user, $featuresarray,$resource_id,$dbtablename,$feature2,$dbt_keyfield,$dbt_select); } } - -/** - * API init - * - */ -class DolibarrApiInit extends DolibarrApi -{ - - function __construct() { - global $db; - $this->db = $db; - } - - /** - * Login - * - * Log user with username and password - * - * @param string $login Username - * @param string $password User password - * @param int $entity User entity - * @return array Response status and user token - * - * @throws RestException - */ - public function login($login, $password, $entity = 0) { - - global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; - - // Authentication mode - if (empty($dolibarr_main_authentication)) - $dolibarr_main_authentication = 'http,dolibarr'; - // Authentication mode: forceuser - if ($dolibarr_main_authentication == 'forceuser' && empty($dolibarr_auto_user)) - $dolibarr_auto_user = 'auto'; - // Set authmode - $authmode = explode(',', $dolibarr_main_authentication); - - include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; - $login = checkLoginPassEntity($login, $password, $entity, $authmode); - if (empty($login)) - { - throw new RestException(403, 'Access denied'); - } - - // Generate token for user - $token = dol_hash($login.uniqid().$conf->global->MAIN_API_KEY,1); - - // We store API token into database - $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql.= " SET api_key = '".$this->db->escape($token)."'"; - $sql.= " WHERE login = '".$this->db->escape($login)."'"; - - dol_syslog(get_class($this)."::login", LOG_DEBUG); // No log - $result = $this->db->query($sql); - if (!$result) - { - throw new RestException(500, 'Error when updating user :'.$this->db->error_msg); - } - - //return token - return array( - 'success' => array( - 'code' => 200, - 'token' => $token, - 'message' => 'Welcome ' . $login - ) - ); - } - - /** - * Get status (Dolibarr version) - * - * @access protected - * @class DolibarrApiAccess {@requires admin} - */ - function status() { - require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; - return array( - 'success' => array( - 'code' => 200, - 'dolibarr_version' => DOL_VERSION - ) - ); - } -} diff --git a/htdocs/api/class/api_generic.class.php b/htdocs/api/class/api_generic.class.php new file mode 100644 index 00000000000..038621b6235 --- /dev/null +++ b/htdocs/api/class/api_generic.class.php @@ -0,0 +1,124 @@ + + * + * 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 . + */ + +use Luracast\Restler\Restler; +use Luracast\Restler\RestException; +use Luracast\Restler\Defaults; + +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php'; + + +/** + * API generic (login, status, ...) + * + */ +class GenericApi extends DolibarrApi +{ + + function __construct() { + global $db; + $this->db = $db; + } + + /** + * Login + * + * Log user with username and password + * + * @param string $login Username + * @param string $password User password + * @param int $entity User entity + * @param int $reset Reset token + * @return array Response status and user token + * + * @throws RestException + */ + public function login($login, $password, $entity=0, $reset=0) { + + global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; + + // Authentication mode + if (empty($dolibarr_main_authentication)) + $dolibarr_main_authentication = 'http,dolibarr'; + // Authentication mode: forceuser + if ($dolibarr_main_authentication == 'forceuser' && empty($dolibarr_auto_user)) + $dolibarr_auto_user = 'auto'; + // Set authmode + $authmode = explode(',', $dolibarr_main_authentication); + + include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; + $login = checkLoginPassEntity($login, $password, $entity, $authmode); + if (empty($login)) + { + throw new RestException(403, 'Access denied'); + } + + $token = 'failedtogenerateorgettoken'; + + $tmpuser=new User($this->db); + $tmpuser->fetch(0, $login); + + // Renew the hash + if (empty($tmpuser->api_key) || $reset) + { + // Generate token for user + $token = dol_hash($login.uniqid().$conf->global->MAIN_API_KEY,1); + + // We store API token into database + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; + $sql.= " SET api_key = '".$this->db->escape($token)."'"; + $sql.= " WHERE login = '".$this->db->escape($login)."'"; + + dol_syslog(get_class($this)."::login", LOG_DEBUG); // No log + $result = $this->db->query($sql); + if (!$result) + { + throw new RestException(500, 'Error when updating api_key for user :'.$this->db->lasterror()); + } + } + else + { + $token = $tmpuser->api_key; + } + + //return token + return array( + 'success' => array( + 'code' => 200, + 'token' => $token, + 'message' => 'Welcome ' . $login.($reset?' - Token is new':' - Token was generated by a previous call') + ) + ); + } + + /** + * Get status (Dolibarr version) + * + * @access protected + * @class DolibarrApiAccess {@requires admin} + */ + function status() { + require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; + return array( + 'success' => array( + 'code' => 200, + 'dolibarr_version' => DOL_VERSION + ) + ); + } +} diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 55a45aea4b9..2fbad04ecbb 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -60,7 +60,6 @@ use \Luracast\Restler\Defaults; $api = new DolibarrApi($db); $api->r->addAPIClass('Luracast\\Restler\\Resources'); //this creates resources.json at API Root -$api->r->addAPIClass('DolibarrApiInit',''); // Just for url root page $api->r->setSupportedFormats('JsonFormat', 'XmlFormat'); $api->r->addAuthenticationClass('DolibarrApiAccess',''); diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index ecb11c3e6ee..8ddd7e48a85 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -203,7 +203,7 @@ $langs->load("cashdesk"); ?> " onclick="javascript: verifClic('DIF');" /> trans("DateEcheance").' :'; + print $langs->trans("DateDue").' :'; print $form->select_date(-1,'txtDatePaiement',0,0,0,'paymentmode',1,0,1); print ''; ?> diff --git a/htdocs/cashdesk/tpl/validation1.tpl.php b/htdocs/cashdesk/tpl/validation1.tpl.php index 047d597a6ef..bb6bd92c8bd 100644 --- a/htdocs/cashdesk/tpl/validation1.tpl.php +++ b/htdocs/cashdesk/tpl/validation1.tpl.php @@ -83,7 +83,7 @@ $langs->load("bills"); // Affichage des infos en fonction du mode de paiement if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) { - echo (''.$langs->trans("DateEcheance").''.$obj_facturation->paiementLe().''); + echo (''.$langs->trans("DateDue").''.$obj_facturation->paiementLe().''); } else { diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b602bc0076d..672ea7b6408 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -48,14 +48,13 @@ class Categorie extends CommonObject const TYPE_CUSTOMER = 2; const TYPE_MEMBER = 3; const TYPE_CONTACT = 4; - const TYPE_USER = 4; // categorie contact and user are same - // bank account - const TYPE_ACCOUNT = 5; + const TYPE_USER = 4; // categorie contact and user are same ! + const TYPE_ACCOUNT = 5; // bank account /** * @var array ID mapping from type string * - * @note Move to const array when PHP 5.6 will be our minimum target + * @note This array should be remove in future, once previous constants are moved to the string value. */ private $MAP_ID = array( 'product' => 0, @@ -1274,14 +1273,12 @@ class Categorie extends CommonObject * Should be named getListOfCategForObject * * @param int $id Id of element - * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode - * (0, 1, 2, ...) is deprecated. + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. * @param string $mode 'object'=Get array of fetched category instances, 'label'=Get array of category * labels, 'id'= Get array of category IDs - * * @return mixed Array of category objects or < 0 if KO */ - function containing($id,$type,$mode='object') + function containing($id, $type, $mode='object') { $cats = array(); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 72c184af113..d3b1f8854b9 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -29,6 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; $langs->load("categories"); @@ -90,6 +91,7 @@ if ($action == 'addthumb' && $_GET["file"]) llxHeader("","",$langs->trans("Categories")); $form = new Form($db); +$formother = new FormOther($db); if ($object->id) { @@ -117,8 +119,8 @@ if ($object->id) print ''; // Path of category - print ''; // Description - print ''; - // Visibility - /* if ($type == 0 && ! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) - { - if ($object->socid) - { - $soc = new Societe($db); - $soc->fetch($object->socid); - - print ''; - - $catsMeres = $object->get_meres (); - - if ($catsMeres < 0) - { - dol_print_error(); - } - else if (count($catsMeres) > 0) - { - print ''; - } - } - else - { - print ''; - } - } - else - { - print ''; - } - */ - + print "
'; - $ways = $object->print_all_ways(); + print '
'; + $ways = $object->print_all_ways(" >> ", '', 1); print $langs->trans("Ref").''; print ''.$langs->trans("Root").' >> '; foreach ($ways as $way) @@ -128,55 +130,17 @@ if ($object->id) print '
'; + print '
'; print $langs->trans("Description").''; print dol_htmlentitiesbr($object->description); print '
'; - print $langs->trans("AssignedToTheCustomer").''; - print $soc->getNomUrl(1); + // Color + print '
'; + print $langs->trans("Color").''; + print $formother->showColor($object->color); print '
'; - print $langs->trans("CategoryContents").''; - print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible")); - print '
'; - print $langs->trans("CategoryContents").''; - print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible")); - print '
'; - print $langs->trans("CategoryContents").''; - print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible")); - print '
\n"; print "\n"; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 9d88098e56b..25fb000a594 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("categories"); $langs->load("languages"); @@ -143,6 +144,7 @@ llxHeader("","",$langs->trans("Translation")); $form = new Form($db); $formadmin=new FormAdmin($db); +$formother = new FormOther($db); if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort"); elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort"); @@ -159,8 +161,8 @@ print ''; // Reference print ''; -print ''; print ''; // Description -print ''; +// Color +print ''; + print '
'; -$ways = $object->print_all_ways(); +print ''; +$ways = $object->print_all_ways(" >> ", '', 1); print $langs->trans("Ref").''; print ''.$langs->trans("Root").' >> '; foreach ($ways as $way) @@ -171,11 +173,17 @@ print '
'; +print '
'; print $langs->trans("Description").''; print dol_htmlentitiesbr($object->description); print '
'; +print $langs->trans("Color").''; +print $formother->showColor($object->color); +print '
'; if ($action == 'edit') @@ -194,8 +202,8 @@ if ($action == 'edit') { print "
".$langs->trans('Language_'.$key)." :
"; print ''; - print ''; - print ''; + print ''; @@ -205,7 +213,7 @@ if ($action == 'edit') } } - print '
'; + print '
'; print ''; print '     '; print ''; @@ -225,9 +233,9 @@ else $s=picto_from_langcode($key); print "
".($s?$s.' ':'')." ".$langs->trans('Language_'.$key).":
"; print '
'.$langs->trans('Label').'
'.$langs->trans('Description').''; + print '
'.$langs->trans('Label').'
'.$langs->trans('Description').''; $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80); $doleditor->Create(); print '
'; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print '
'.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'.$langs->trans('Note').''.$object->multilangs[$key]["note"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'.$langs->trans('Note').''.$object->multilangs[$key]["note"].'
'; } } @@ -271,11 +279,11 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print ''; - print ''; - print ''; - print ''; + print ''; @@ -283,7 +291,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print '
'.$langs->trans('Translation').''; + print '
'.$langs->trans('Translation').''; print $formadmin->select_language('','forcelangprod',0,$object->multilangs); print '
'.$langs->trans('Label').'
'.$langs->trans('Description').''; + print '
'.$langs->trans('Label').'
'.$langs->trans('Description').''; $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80); $doleditor->Create(); print '
'; - print '
'; + print '
'; print ''; print '     '; print ''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 284add47add..b9beb792ba6 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -193,10 +193,10 @@ if ($action == 'delete') print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete'); } -print ''; +print '
'; // Path of category -print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 2d9241301a6..9b4d37d6335 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Dourseanud - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014-2106 Ferran Marcet * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry * @@ -633,18 +633,18 @@ if (! empty($conf->expensereport->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); - $sql.= " AND p.fk_statut>5"; + $sql.= " AND p.fk_statut>=5"; $column='p.date_valid'; } else { - $sql = "SELECT p.rowid, p.ref, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; + $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); - $sql.= " AND p.fk_statut=6"; + $sql.= " AND p.fk_statut>=5"; $column='pe.datep'; } @@ -654,7 +654,7 @@ if (! empty($conf->expensereport->enabled)) if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; - $sql.= " GROUP BY p.rowid, p.ref, u.firstname, u.lastname, dm"; + $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; $sql.= " ORDER BY p.ref"; dol_syslog("get expense report outcome"); @@ -677,7 +677,7 @@ if (! empty($conf->expensereport->enabled)) $var = !$var; print ""; - print "\n"; + print "\n"; if ($modecompta == 'CREANCES-DETTES') print ''; print ''; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index a98ce53ae81..861b44edd6c 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014-2016 Ferran Marcet * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry * @@ -529,7 +529,7 @@ if (! empty($conf->expensereport->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); - $sql.= " AND p.fk_statut>5"; + $sql.= " AND p.fk_statut>=5"; $column='p.date_valid'; @@ -540,7 +540,7 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); - $sql.= " AND p.fk_statut=6"; + $sql.= " AND p.fk_statut>=5"; $column='pe.datep'; } diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index f50bff34a86..7b5a01d6bca 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -95,7 +95,7 @@ class box_factures extends ModeleBoxes $now=dol_now(); $line = 0; - $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; + $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateDue').': %s)'; while ($line < $num) { $objp = $db->fetch_object($result); @@ -118,7 +118,7 @@ class box_factures extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { - $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); + $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); } $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 7c90bb69683..88b64947f05 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -95,7 +95,7 @@ class box_factures_fourn extends ModeleBoxes $num = $db->num_rows($result); $line = 0; - $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; + $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateDue').': %s)'; while ($line < $num) { $objp = $db->fetch_object($result); diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 4e54b590955..27441f22ea5 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -88,7 +88,7 @@ class box_factures_fourn_imp extends ModeleBoxes $num = $db->num_rows($result); $line = 0; - $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; + $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateDue').': %s)'; $facturestatic = new FactureFournisseur($db); diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 63ce986e181..783aa8b2c64 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -96,7 +96,7 @@ class box_factures_imp extends ModeleBoxes $now=dol_now(); $line = 0; - $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; + $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateDue')).': %s)'; while ($line < $num) { diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 0b55e2cc814..914c7077c8b 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -123,8 +123,6 @@ class Conf */ function setValues($db) { - global $conf; - dol_syslog(get_class($this)."::setValues"); /* @@ -205,17 +203,19 @@ class Conf $db->free($resql); } - // Include local constants files and fetch their values to the corresponding database constants - if(! empty($this->global->LOCAL_CONSTS_FILES)) { - $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); - foreach ($filesList as $file) { - $file=dol_sanitizeFileName($file); - include_once DOL_DOCUMENT_ROOT . "/$file/{$file}_consts.php"; - foreach ($file2bddconsts as $key=>$value) { - $conf->global->$key=constant($value); - } - } - } + + // Include other local consts.php files and fetch their values to the corresponding database constants + if (! empty($this->global->LOCAL_CONSTS_FILES)) { + $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); + foreach ($filesList as $file) { + $file=dol_sanitizeFileName($file); + include_once DOL_DOCUMENT_ROOT . "/".$file."/".$file."_consts.php"; + foreach ($file2bddconsts as $key=>$value) { + $this->global->$key=constant($value); + } + } + } + //var_dump($this->modules); //var_dump($this->modules_parts['theme']); @@ -398,7 +398,7 @@ class Conf unset($this->global->PROJECT_USE_SEARCH_TO_SELECT); } - if (! empty($conf->productbatch->enabled)) + if (! empty($this->productbatch->enabled)) { $this->global->STOCK_CALCULATE_ON_BILL=0; $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER=0; @@ -419,7 +419,7 @@ class Conf $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1; // MAIN_HTML_TITLE - if (! isset($conf->global->MAIN_HTML_TITLE)) $conf->global->MAIN_HTML_TITLE='noapp,thirdpartynameonly,contactnameonly,projectnameonly'; + if (! isset($this->global->MAIN_HTML_TITLE)) $this->global->MAIN_HTML_TITLE='noapp,thirdpartynameonly,contactnameonly,projectnameonly'; // conf->liste_limit = constante de taille maximale des listes if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25; @@ -446,7 +446,7 @@ class Conf // conf->mailing->email_from = email pour envoi par Dolibarr des mailings $this->mailing->email_from=$this->email_from; if (! empty($this->global->MAILING_EMAIL_FROM)) $this->mailing->email_from=$this->global->MAILING_EMAIL_FROM; - if (! isset($conf->global->MAIN_EMAIL_ADD_TRACK_ID)) $conf->global->MAIN_EMAIL_ADD_TRACK_ID=1; + if (! isset($this->global->MAIN_EMAIL_ADD_TRACK_ID)) $this->global->MAIN_EMAIL_ADD_TRACK_ID=1; // Format for date (used by default when not found or not searched in lang) $this->format_date_short="%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions) @@ -579,7 +579,7 @@ class Conf throw new Exception('Log handler does not extend LogHandlerInterface'); } - if (empty($conf->loghandlers[$handler])) $this->loghandlers[$handler]=$loghandlerinstance; + if (empty($this->loghandlers[$handler])) $this->loghandlers[$handler]=$loghandlerinstance; } } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index dcf593e6ccd..70a4738366d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3145,7 +3145,7 @@ class Form /** * Return list of categories having choosed type * - * @param int $type Type de categories (0=product, 1=supplier, 2=customer, 3=member) + * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. * @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element) * @param string $htmlname HTML field name * @param int $maxlength Maximum length for labels @@ -3161,6 +3161,12 @@ class Form include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + // For backward compatibility + if (is_numeric($type)) + { + dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); + } + $cat = new Categorie($this->db); $cate_arbo = $cat->get_full_arbo($type,$excludeafterid); diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index f446caa12a2..3664424764d 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -302,7 +302,7 @@ class FormOther /** * Return select list for categories (to use in form search selectors) * - * @param int $type Type of categories (0=product, 1=supplier, 2=customer, 3=member, 4=contact) + * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. * @param integer $selected Preselected value * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" @@ -315,6 +315,12 @@ class FormOther global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + // For backward compatibility + if (is_numeric($type)) + { + dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); + } + // Load list of "categories" $static_categs = new Categorie($this->db); $tab_categs = $static_categs->get_full_arbo($type); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 99318d43b93..f831de667bd 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -807,7 +807,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default * @param int $marge_gauche Margin left (no more used) * @param int $page_hauteur Page height (no more used) * @param Object $object Object shown in PDF - * @param int $showdetails Show company details into footer. This param seems to not be used by standard version. (1=Show address, 2=Show managers, 3=Both) + * @param int $showdetails Show company adress details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) * @param int $hidefreetext 1=Hide free text, 0=Show free text * @return int Return height of bottom margin including footer text */ diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index dd135c10b24..e51862922a0 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -465,6 +465,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) } else { + $default='515870'; + if ($conf->theme == 'md') $default='5A3278'; $var=!$var; print ''; print ''; @@ -479,7 +481,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) if ($color) print ''; else print $langs->trans("Default"); } - print '   ('.$langs->trans("Default").': 515870, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': '.$default.', '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print ''; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 127d80ff197..5474b1dfffe 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -51,16 +51,16 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) if (empty($noout)) print_start_menu_array(); // Show/Hide vertical menu - if (GETPOST('testhidemenu') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + if (GETPOST('testmenuhider') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $showmode=1; $classname = 'class="tmenu"'; - $idsel='home'; + $idsel='menu'; if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("XXX"), 1, '#', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_text_menu_entry('', 1, '#', $id, $idsel, $classname, $atarget); if (empty($noout)) print_end_menu_entry($showmode); - $menu->add('#', $langs->trans("XXX"), 0, $showmode, $atarget, "xxx", ''); + $menu->add('#', '', 0, $showmode, $atarget, "xxx", ''); } // Home diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4f2ac6b3f18..046a47a699e 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1535,7 +1535,7 @@ class pdf_crabe extends ModelePDFFactures $posy+=3; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell($w, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("DateDue")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R'); } if ($object->thirdparty->code_client) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index f996ca3677a..5342dd56f7b 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -463,9 +463,15 @@ ALTER TABLE llx_advtargetemailing ADD UNIQUE INDEX uk_advtargetemailing_name (na update llx_product_batch set batch = '000000' where batch = 'Non défini'; update llx_product_batch set batch = '000000' where batch = 'Non défini'; update llx_product_batch set batch = '000000' where batch = 'Undefined'; + +update llx_product_batch set batch = '000000' where batch = ''; +update llx_product_batch set batch = '000000' where batch = ''; +update llx_product_batch set batch = '000000' where batch = ''; + update llx_product_lot set batch = '000000' where batch = 'Undefined'; update llx_stock_mouvement set batch = '000000' where batch = 'Undefined'; + -- At end (higher risk of error) -- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 2c894163071..74c1b4680c0 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -84,7 +84,7 @@ DELETE FROM llx_product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product DROP TABLE tmp_llx_product_batch; DROP TABLE tmp_llx_product_batch2; CREATE TABLE tmp_llx_product_batch AS select fk_product_stock, eatby, sellby, batch, SUM(qty) as qty, COUNT(rowid) as nb FROM llx_product_batch GROUP BY fk_product_stock, eatby, sellby, batch HAVING COUNT(rowid) > 1; -CREATE TABLE tmp_llx_product_batch2 AS select pb.rowid, pb.fk_product_stock, pb.eatby, pb.sellby, pb.batch, pb.qty from llx_product_batch as pb, tmp_llx_product_batch as tpb where pb.fk_product_stock = tpb.fk_product_stock and COALESCE(pb.eatby, '') = COALESCE(tpb.eatby,'') and COALESCE(pb.sellby, '') = COALESCE(tpb.sellby, '') and pb.batch = tpb.batch +CREATE TABLE tmp_llx_product_batch2 AS select pb.rowid, pb.fk_product_stock, pb.eatby, pb.sellby, pb.batch, pb.qty from llx_product_batch as pb, tmp_llx_product_batch as tpb where pb.fk_product_stock = tpb.fk_product_stock and COALESCE(pb.eatby, '') = COALESCE(tpb.eatby,'') and COALESCE(pb.sellby, '') = COALESCE(tpb.sellby, '') and pb.batch = tpb.batch; --select * from tmp_llx_product_batch; --select * from tmp_llx_product_batch2; DELETE FROM llx_product_batch WHERE rowid IN (select rowid FROM tmp_llx_product_batch2); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d701978c741..88d1646027c 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -423,7 +423,12 @@ AllBarcodeReset=All barcode values have been removed NoBarcodeNumberingTemplateDefined=No numbering barcode template enabled into barcode module setup. NoRecordWithoutBarcodeDefined=No record with no barcode value defined. EnableFileCache=Enable file cache - +ShowDetailsInPDFPageFoot=Add more details into footer of PDF files, like your company address, or manager names (to complete professional ids, capital and VAT number). +NoDetails=No more details in footer +DisplayCompanyInfo=Display company address +DisplayCompanyManager=Display manager names +DisplayCompanyInfoAndManagers=Display company and manager names + # Modules Module0Name=Users & groups Module0Desc=Users and groups management diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index a159e7aae8d..a4e2ba643b3 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -222,7 +222,6 @@ RelatedCommercialProposals=Related commercial proposals RelatedRecurringCustomerInvoices=Related recurring customer invoices MenuToValid=To valid DateMaxPayment=Payment due before -DateEcheance=Due date limit DateInvoice=Invoice date NoInvoice=No invoice ClassifyBill=Classify invoice diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ffdb4288928..bd65a1e63bd 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1036,7 +1036,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs //if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION); $ext='version='.urlencode(DOL_VERSION); if (GETPOST('version')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js - + if (GETPOST('testmenuhider')) $ext='testmenuhider='.GETPOST('testmenuhider','int'); + if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax) { print ''."\n"; diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index ecfe319828a..7dd0168c77a 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -227,7 +227,7 @@ if (! isset($_SESSION['mois'])) $_SESSION['mois']= date('n'); if (! isset($_SESSION['annee'])) $_SESSION['annee']= date('Y'); //mise a jour des valeurs de session si bouton retour a aujourd'hui -if ((!issetAndNoEmpty('choixjourajout')) && !issetAndNoEmpty('choixjourretrait') || issetAndNoEmpty('retourmois')){ +if (!issetAndNoEmpty('choixjourajout') && !issetAndNoEmpty('choixjourretrait') && (issetAndNoEmpty('retourmois') || issetAndNoEmpty('retourmois_x'))) { $_SESSION["jour"]=date("j"); $_SESSION["mois"]=date("n"); $_SESSION["annee"]=date("Y"); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d8adf66bcc1..0fdafd64ae5 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012-2013 Marcos García - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013-2016 Juanjo Menent * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2013 Jean Heimburger * Copyright (C) 2013 Cédric Salvador @@ -282,7 +282,7 @@ else $sql.=$hookmanager->resPrint; $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; - $sql.= ' p.datec, p.tms'; + $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy'; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); // Add fields from hooks diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 6503ac5ca41..7968b0a809a 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -118,9 +118,9 @@ $arrayfields=array( 'p.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), 'p.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), 'p.public'=>array('label'=>$langs->trans("Visibility"), 'checked'=>1, 'position'=>102), - 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>1, 'enabled'=>$conf->global->PROJECT_USE_OPPORTUNITIES, 'position'=>103), - 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>$conf->global->PROJECT_USE_OPPORTUNITIES, 'position'=>104), - 'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>$conf->global->PROJECT_USE_OPPORTUNITIES, 'position'=>105), + 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>103), + 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104), + 'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105), 'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), diff --git a/htdocs/theme/common/folder-new.png b/htdocs/theme/common/folder-new.png index fdeea131de2..da7ed005f56 100644 Binary files a/htdocs/theme/common/folder-new.png and b/htdocs/theme/common/folder-new.png differ diff --git a/htdocs/theme/common/view-refresh.png b/htdocs/theme/common/view-refresh.png index d5e3dbd4782..5601cf45857 100644 Binary files a/htdocs/theme/common/view-refresh.png and b/htdocs/theme/common/view-refresh.png differ diff --git a/htdocs/theme/eldy/img/menus/README.md b/htdocs/theme/eldy/img/menus/README.md index 3b04bafbc9b..2c3e65e4e23 100644 --- a/htdocs/theme/eldy/img/menus/README.md +++ b/htdocs/theme/eldy/img/menus/README.md @@ -5,9 +5,10 @@ Tutorial to create a new image for menu: 2) With Gimp, open image and check there is a alpha channel. If not add one. 3) Convert image into back and white (Menu Image - Mode - Grey levels). 4) Use the degrade tool with option (Menu Tools - Paint - Degrade - CTRL+L): -* Mode: Erase color (you can also try "Elear only") +* Mode: Erase color (you can also try "Clear only") * Opacity: 50 +/- * Offset: 0 +* PP toward transparent * Shape: Linear * Select on image top of file and drag to bottom. Il est possible aussi d'augmenter la transparence globale depuis le calque. diff --git a/htdocs/theme/eldy/img/menus/menu.png b/htdocs/theme/eldy/img/menus/menu.png index e8ef108b127..97f2da4df4e 100644 Binary files a/htdocs/theme/eldy/img/menus/menu.png and b/htdocs/theme/eldy/img/menus/menu.png differ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 1c6a841fb53..0d53504f337 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -124,8 +124,6 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_FONT_SIZE1='13'; $conf->global->THEME_ELDY_FONT_SIZE2='11'; } -//var_dump($conf->global->THEME_ELDY_BACKBODY); -//var_dump($user->conf->THEME_ELDY_BACKTITLE1); // Case of option availables only if THEME_ELDY_ENABLE_PERSONALIZED is on @@ -153,6 +151,9 @@ if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) $colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER)); } +$colortopbordertitle1=$colorbackhmenu1; + + // Set text color to black or white $tmppart=explode(',',$colorbackhmenu1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); @@ -783,7 +784,7 @@ img.photoref { .underrefbanner { } .underbanner { - border-bottom: 2px solid #888; + border-bottom: 2px solid rgb(); } @@ -1024,6 +1025,11 @@ div.mainmenu.members { background-image: url(); } +div.mainmenu.menu { + background-image: url(); + top: 7px; +} + div.mainmenu.products { background-image: url(); } @@ -1444,7 +1450,7 @@ td.barre_select { td.photo { background: #F4F4F4; color: #000000; - border: 1px solid #b3c5cc; + border: 1px solid #bbb; } /* ============================================================================== */ @@ -1796,7 +1802,7 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { border-right: 1px solid #AAA !important; border-left: 1px solid #AAA !important; - border-top: 2px solid #111 !important; + border-top: 2px solid rgb() !important; /* box-shadow: 0 -1px 4px rgba(0,0,0,.1); -moz-box-shadow: 0 -1px 4px rgba(0,0,0,.1); @@ -2177,7 +2183,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-collapse: separate !important; border-spacing: 0px; - border-top-width: 1px; + border-top-width: 2px; border-top-color: rgb(); border-top-style: solid; @@ -2543,7 +2549,7 @@ div.liste_titre { border-top-style: solid; } div.liste_titre_bydiv { - border-top-width: 1px; + border-top-width: 2px; border-top-color: rgb(); border-top-style: solid; diff --git a/htdocs/theme/md/img/menus/menu.png b/htdocs/theme/md/img/menus/menu.png new file mode 100644 index 00000000000..97f2da4df4e Binary files /dev/null and b/htdocs/theme/md/img/menus/menu.png differ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 731b99117bf..78208e06ce4 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -80,9 +80,9 @@ $dol_use_jmobile=$conf->dol_use_jmobile; //var_dump($user->conf->THEME_ELDY_RGB); // Colors -$colorbackhmenu1='0,0,80'; // topmenu +$colorbackhmenu1='90,50,120'; // topmenu $colorbackvmenu1='255,255,255'; // vmenu -$colortopbordertitle1='40,40,40'; // top border of tables-lists title +$colortopbordertitle1=''; // top border of tables-lists title. not defined = default to colorbackhmenu1 $colorbacktitle1='230,230,230'; // title of tables-lists $colorbacktabcard1='255,255,255'; // card $colorbacktabactive='234,234,234'; @@ -103,7 +103,7 @@ $useboldtitle=(isset($conf->global->THEME_ELDY_USEBOLDTITLE)?$conf->global->THEM // Case of option always editable if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody; -if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1='50,50,60'; +if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1='90,50,120'; if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1; if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER=='238,246,252'; if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab; @@ -126,8 +126,8 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_FONT_SIZE1='13'; $conf->global->THEME_ELDY_FONT_SIZE2='11'; } -//var_dump($conf->global->THEME_ELDY_BACKBODY); -//var_dump($user->conf->THEME_ELDY_BACKTITLE1); + + // Case of option availables only if THEME_ELDY_ENABLE_PERSONALIZED is on $colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); $colorbackvmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$user->conf->THEME_ELDY_VERMENU_BACK1); @@ -146,7 +146,6 @@ $colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( $colortextlink =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTLINK) ?$colortext:$conf->global->THEME_ELDY_TEXTLINK) :(empty($user->conf->THEME_ELDY_TEXTLINK)?$colortextlink:$user->conf->THEME_ELDY_TEXTLINK); $fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); - // Hover color $colorbacklinepairhover=((! isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '0')?'':($conf->global->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_HOVER)); if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) @@ -154,6 +153,9 @@ if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) $colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER)); } +$colortopbordertitle1=$colorbackhmenu1; + + // Set text color to black or white $tmppart=explode(',',$colorbackhmenu1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); @@ -834,7 +836,7 @@ img.photoref { .underrefbanner { } .underbanner { - border-bottom: 2px solid #888; + border-bottom: 2px solid rgb();; } @@ -1081,6 +1083,11 @@ div.mainmenu.members { background-image: url(); } +div.mainmenu.menu { + background-image: url(); + top: 7px; +} + div.mainmenu.products { background-image: url(); } @@ -1451,7 +1458,7 @@ td.barre_select { td.photo { background: #F4F4F4; color: #000000; - border: 1px solid #b3c5cc; + border: 1px solid #bbb; } /* ============================================================================== */ @@ -4059,7 +4066,7 @@ img.demothumb { ::-webkit-scrollbar { - width: 10px; + width: 12px; } ::-webkit-scrollbar-button { background: #aaa
'; +print '
'; $ways = $object->print_all_ways(" >> ", '', 1); print $langs->trans("Ref").''; print ''.$langs->trans("Root").' >> '; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 30b06a351d2..f89d7d5d5a2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1542,7 +1542,7 @@ class Commande extends CommonOrder $this->id = $obj->rowid; $this->ref = $obj->ref; $this->ref_client = $obj->ref_client; - $this->ref_customer = $obj->ref_customer; + $this->ref_customer = $obj->ref_client; $this->ref_ext = $obj->ref_ext; $this->ref_int = $obj->ref_int; $this->socid = $obj->fk_soc; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 0cee6211b49..26be80caa68 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -118,7 +118,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) // Ligne de titre tableau des ecritures print '
'.$langs->trans("DateEcheance").''.$langs->trans("DateDue").''.$langs->trans("Description").''.$langs->trans("ThirdParty").''.$langs->trans("Debit").'
 ".$langs->trans("ExpenseReport")." rowid."\">".$obj->ref.' ('.$obj->firstname." ".$obj->lastname.")".$langs->trans("ExpenseReport")." userid."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount_ht).''.price(-$obj->amount_ttc).'
'.$langs->trans("TopMenuBackgroundColor").'