From 33c1fd2a01ad28ec385b02282050cc54a6992a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 9 Sep 2012 14:43:41 +0200 Subject: [PATCH 01/16] Allow to search barcodes in the permanent mini search box Requested by Joaquim in Dolibarr.es forum http://dolibarr.es/index.php/foro/9-sugerencias/1337-buscador-de-la-izquierda/ --- htdocs/product/liste.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index cc052401fa0..a51e7441138 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -129,7 +129,15 @@ else if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; - if ($sall) $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')"; + if ($sall) + { + $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'"; + if (! empty($conf->global->MAIN_MODULE_BARCODE)) + { + $sql .= " OR p.barcode LIKE '%".$db->escape($sall)."%'"; + } + $sql .= ')'; + } // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type)) { From e0624abb2c177ad4f5b5cd7b4bee5934ba486f3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Sep 2012 14:49:20 +0200 Subject: [PATCH 02/16] Added option THEME_ELDY_USE_HOVER to enable mouse hover, because when using software a lot, it becomes annoying. So we let user choose (choice possible only with eldy theme for the moment). --- htdocs/core/modules/export/modules_export.php | 8 +- htdocs/exports/index.php | 181 +++++++++--------- htdocs/imports/index.php | 161 ++++++++-------- htdocs/theme/auguria/style.css.php | 46 +++-- htdocs/theme/eldy/style.css.php | 31 ++- 5 files changed, 236 insertions(+), 191 deletions(-) diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php index 7ad5b05ebf2..ee9f06674af 100644 --- a/htdocs/core/modules/export/modules_export.php +++ b/htdocs/core/modules/export/modules_export.php @@ -26,8 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; /** - * \class ModeleExports - * \brief Parent class for export modules + * Parent class for export modules */ class ModeleExports extends CommonDocGenerator // This class can't be abstract as there is instance propreties loaded by liste_modeles { @@ -41,7 +40,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac /** - * Charge en memoire et renvoie la liste des modeles actifs + * Load into memory list of available export format * * @param DoliDB $db Database handler * @param string $maxfilenamelength Max length of value to show @@ -87,6 +86,9 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac } closedir($handle); } + + asort($this->driverlabel); + return $this->driverlabel; } diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index 3317554ec1c..0cf3a0f0ef1 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2012 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 @@ -18,7 +18,7 @@ /** * \file htdocs/exports/index.php * \ingroup export - * \brief Home page of export tools + * \brief Home page of export wizard */ require_once '../main.inc.php'; @@ -51,100 +51,101 @@ print '
'; print ''; -print ''; print '
'; +print '
'; - -// List of available export format -$var=true; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - -include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; -$model=new ModeleExports(); -$liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties - -$var=true; -foreach($liste as $key => $val) -{ - $var=!$var; - print ''; - print ''; - $text=$model->getDriverDesc($key); - print ''; - print ''; - print ''; - print ''; -} - -print '
'.$langs->trans("AvailableFormats").''.$langs->trans("LibraryShort").''.$langs->trans("LibraryVersion").'
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.$form->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'
'; - - -print '
'; - - -// Affiche les modules d'exports -print ''; -print ''; -print ''; -print ''; -//print ''; -print ''; -$var=true; -if (count($export->array_export_code)) -{ - foreach ($export->array_export_code as $key => $value) - { - $var=!$var; - print ''; -// print ''; - print ''; - - } -} -else -{ - print ''; -} -print '
'.$langs->trans("Module").''.$langs->trans("ExportableDatas").' 
'; - //print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' '; - print $export->array_export_module[$key]->getName(); - print ''; - print img_object($export->array_export_module[$key]->getName(),$export->array_export_icon[$key]).' '; - $string=$langs->trans($export->array_export_label[$key]); - print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]); - print ''; -// print ''.img_picto($langs->trans("NewExport"),'filenew').''; -// print '
'.$langs->trans("NoExportableData").'
'; -print '
'; - -print '
'; -if (count($export->array_export_code)) -{ - if ($user->rights->export->creer) - { - print ''.$langs->trans("NewExport").''; - } - else - { - print ''.$langs->trans("NewExport").''; - } - /* - print '
rights->export->creer?'':' disabled="disabled"'); - print '>
'; - */ -} + +// List export set +print ''; +print ''; +print ''; +print ''; +//print ''; +print ''; +$var=true; +if (count($export->array_export_code)) +{ + foreach ($export->array_export_code as $key => $value) + { + $var=!$var; + print ''; + // print ''; + print ''; + + } +} +else +{ + print ''; +} +print '
'.$langs->trans("Module").''.$langs->trans("ExportableDatas").' 
'; + //print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' '; + print $export->array_export_module[$key]->getName(); + print ''; + print img_object($export->array_export_module[$key]->getName(),$export->array_export_icon[$key]).' '; + $string=$langs->trans($export->array_export_label[$key]); + print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]); + print ''; + // print ''.img_picto($langs->trans("NewExport"),'filenew').''; + // print '
'.$langs->trans("NoExportableData").'
'; +print '
'; + +print '
'; +if (count($export->array_export_code)) +{ + if ($user->rights->export->creer) + { + print ''.$langs->trans("NewExport").''; + } + else + { + print ''.$langs->trans("NewExport").''; + } + /* + print '
rights->export->creer?'':' disabled="disabled"'); + print '>
'; + */ +} print '
'; + +print '
'; + + +// List of available export format +$var=true; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; +$model=new ModeleExports(); +$liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties + +$var=true; +foreach($liste as $key => $val) +{ + $var=!$var; + print ''; + print ''; + $text=$model->getDriverDesc($key); + print ''; + print ''; + print ''; + print ''; +} + +print '
'.$langs->trans("AvailableFormats").''.$langs->trans("LibraryShort").''.$langs->trans("LibraryVersion").'
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.$form->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'
'; + + print '
'; -$db->close(); - llxFooter(); + +$db->close(); ?> diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php index 3682a8c5947..c421dafc554 100644 --- a/htdocs/imports/index.php +++ b/htdocs/imports/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2012 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 @@ -18,7 +18,7 @@ /** * \file htdocs/imports/index.php * \ingroup import - * \brief Page accueil de la zone import + * \brief Home page of import wizard */ require_once '../main.inc.php'; @@ -49,88 +49,89 @@ print '
'; print ''; -print ''; print '
'; +print '
'; -// Liste des formats d'imports disponibles -$var=true; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - -include_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php'; -$model=new ModeleImports(); -$liste=$model->liste_modeles($db); - -foreach($liste as $key) -{ - $var=!$var; - print ''; - print ''; - $text=$model->getDriverDesc($key); - print ''; - print ''; - print ''; - print ''; -} - -print '
'.$langs->trans("AvailableFormats").''.$langs->trans("LibraryShort").''.$langs->trans("LibraryVersion").'
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.$form->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'
'; - - -print '
'; - - -// Affiche les modules d'imports -print ''; -print ''; -print ''; -print ''; -//print ''; -print ''; -$val=true; -if (count($import->array_import_code)) -{ - foreach ($import->array_import_code as $key => $value) - { - $val=!$val; - print ''; -// print ''; - print ''; - - } -} -else -{ - print ''; -} -print '
'.$langs->trans("Module").''.$langs->trans("ImportableDatas").' 
'; - print img_object($import->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' '; - print $import->array_import_module[$key]->getName(); - print ''; - $string=$langs->trans($import->array_import_label[$key]); - print ($string!=$import->array_import_label[$key]?$string:$import->array_import_label[$key]); - print ''; -// print ''.img_picto($langs->trans("NewImport"),'filenew').''; -// print '
'.$langs->trans("NoImportableData").'
'; -print '
'; - -print '
'; -if (count($import->array_import_code)) -{ - //if ($user->rights->import->run) - //{ - print ''.$langs->trans("NewImport").''; - //} - //else - //{ - // print ''.$langs->trans("NewImport").''; - //} -} +// List of import set +print ''; +print ''; +print ''; +print ''; +//print ''; +print ''; +$val=true; +if (count($import->array_import_code)) +{ + foreach ($import->array_import_code as $key => $value) + { + $val=!$val; + print ''; + // print ''; + print ''; + + } +} +else +{ + print ''; +} +print '
'.$langs->trans("Module").''.$langs->trans("ImportableDatas").' 
'; + print img_object($import->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' '; + print $import->array_import_module[$key]->getName(); + print ''; + $string=$langs->trans($import->array_import_label[$key]); + print ($string!=$import->array_import_label[$key]?$string:$import->array_import_label[$key]); + print ''; + // print ''.img_picto($langs->trans("NewImport"),'filenew').''; + // print '
'.$langs->trans("NoImportableData").'
'; +print '
'; + +print '
'; +if (count($import->array_import_code)) +{ + //if ($user->rights->import->run) + //{ + print ''.$langs->trans("NewImport").''; + //} + //else + //{ + // print ''.$langs->trans("NewImport").''; + //} +} print '
'; + +print '
'; + + +// List of available import format +$var=true; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +include_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php'; +$model=new ModeleImports(); +$liste=$model->liste_modeles($db); + +foreach($liste as $key) +{ + $var=!$var; + print ''; + print ''; + $text=$model->getDriverDesc($key); + print ''; + print ''; + print ''; + print ''; +} + +print '
'.$langs->trans("AvailableFormats").''.$langs->trans("LibraryShort").''.$langs->trans("LibraryVersion").'
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.$form->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'
'; + + print '
'; diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 391e9eaa0c7..5ee989db284 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -65,6 +65,22 @@ $img_liste_titre=dol_buildpath($path.'/theme/auguria/img/menus/trtitle.png',1); $img_head=dol_buildpath($path.'/theme/auguria/img/headbg2.jpg',1); $img_button=dol_buildpath($path.'/theme/auguria/img/button_bg.png',1); +$colorbacklineimpairhover='210,214,217'; +$colorbacklinepairhover='210,214,217'; + +// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER +if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) + || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) +{ + $colorbacklineimpairhover=''; + $colorbacklinepairhover=''; +} + +print '/*'."\n"; +print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; +print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print '*/'."\n"; + ?> /* ============================================================================== */ @@ -1316,28 +1332,30 @@ white-space: nowrap; .impair:hover { -background: #c0c4c7; -border: 0px; + + background: rgb(); + + border: 0px; } -.impair, table.nohover .impair:hover { -/* background: #d0d4d7; */ -background: #F5F6F7; -font-family: ; -border: 0px; +.impair, .nohover .impair:hover, tr.impair td.nohover { + background: #F5F6F7; + font-family: ; + border: 0px; } .pair:hover { -background: #c0c4c7; -border: 0px; + + background: rgb(); + + border: 0px; } -.pair, table.nohover .pair:hover { -/* background: #e6ebed; */ -background: #FBFCFC; -font-family: ; -border: 0px; +.pair, .nohover .pair:hover, tr.pair td.nohover { + background: #FBFCFC; + font-family: ; + border: 0px; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 7d706c3c6d1..d9d658c2039 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -94,8 +94,10 @@ $colorbacktabcard2=($colred-15).','.($colgreen-15).','.($colblue-15); $colorbacktabactive=($colred-15).','.($colgreen-15).','.($colblue-15); $colorbacklineimpair1=(244+round($isred/3)).','.(244+round($isgreen/3)).','.(244+round($isblue/3)); // line impair $colorbacklineimpair2=(250+round($isred/3)).','.(250+round($isgreen/3)).','.(250+round($isblue/3)); // line impair +$colorbacklineimpairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); // line impair $colorbacklinepair1='255,255,255'; // line pair $colorbacklinepair2='255,255,255'; // line pair +$colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); $colorbackbody='#ffffff url('.$img_head.') 0 0 no-repeat;'; $colortext='40,40,40'; $fontsize=empty($conf->browser->phone)?'12':'14'; @@ -117,8 +119,10 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_BACKBODY='#ffffff url('.$img_head.') 0 0 no-repeat;'; $conf->global->THEME_ELDY_LINEIMPAIR1='242,242,242'; $conf->global->THEME_ELDY_LINEIMPAIR2='248,248,248'; + $conf->global->THEME_ELDY_LINEIMPAIRHOVER='238,246,252'; $conf->global->THEME_ELDY_LINEPAIR1='255,255,255'; $conf->global->THEME_ELDY_LINEPAIR2='255,255,255'; + $conf->global->THEME_ELDY_LINEPAIRHOVER='238,246,252'; $conf->global->THEME_ELDY_BACKBODY='#ffffff url('.$img_head.') 0 0 no-repeat;'; $conf->global->THEME_ELDY_TEXT='48,102,102'; } @@ -135,12 +139,21 @@ $colorbacktabcard2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( $colorbacktabactive =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$conf->global->THEME_ELDY_BACKTABACTIVE):(empty($user->conf->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$user->conf->THEME_ELDY_BACKTABACTIVE); $colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR1) ?$colorbacklineimpair1:$conf->global->THEME_ELDY_LINEIMPAIR1):(empty($user->conf->THEME_ELDY_LINEIMPAIR1)?$colorbacklineimpair1:$user->conf->THEME_ELDY_LINEIMPAIR1); $colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); +$colorbacklineimpairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIRHOVER) ?$colorbacklineimpairhover:$conf->global->THEME_ELDY_LINEIMPAIRHOVER):(empty($user->conf->THEME_ELDY_LINEIMPAIRHOVER)?$colorbacklineimpairhover:$user->conf->THEME_ELDY_LINEIMPAIRHOVER); $colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); $colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); +$colorbacklinepairhover =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); $colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); $colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); $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); +// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER +if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) + || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) +{ + $colorbacklineimpairhover=''; + $colorbacklinepairhover=''; +} // Set text color to black or white $tmppart=explode(',',$colorback1); @@ -161,8 +174,10 @@ print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n"; print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n"; print 'colorbacklineimpair1='.$colorbacklineimpair1."\n"; print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; +print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; print 'colorbacklinepair1='.$colorbacklinepair1."\n"; print 'colorbacklinepair2='.$colorbacklinepair2."\n"; +print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; print 'usecss3='.$usecss3."\n"; print '*/'."\n"; @@ -1598,11 +1613,15 @@ tr.liste_total td { } .impair:hover { - background: #c0c4c7; + + background: rgb(); + + background: #fafafa; + border: 0px; } -.impair, table.nohover .impair:hover { +.impair, .nohover .impair:hover, tr.impair td.nohover { background: linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); @@ -1619,11 +1638,15 @@ tr.liste_total td { } .pair:hover { - background: #c0c4c7; + + background: rgb(); + + background: #fafafa; + border: 0px; } -.pair, table.nohover .pair:hover { +.pair, .nohover .pair:hover, tr.pair td.nohover { background: linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); From fcce22026abe26418aaabd55521d10733c626bb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Sep 2012 15:09:54 +0200 Subject: [PATCH 03/16] Fix: Bad name of var --- htdocs/core/class/html.formbarcode.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 563fc4b00e7..12e9acba071 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -169,7 +169,7 @@ class FormBarCode { print '
'; print ''; - print ''; + print ''; print ''; print '
'; $this->select_barcode_type($selected, $htmlname, 1); From 94090e85db18357e6a5884aa6fcc5395733b94db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 9 Sep 2012 15:12:04 +0200 Subject: [PATCH 04/16] Added Copyright and changelog entry --- ChangeLog | 1 + htdocs/product/liste.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a583ceead3e..82c2b13c337 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,7 @@ For users: New experimental modules: - New: Add margin and commissions management module. - New: Add holiday module. +- New: Allow to search product from barcodes directly from the permanent mini search left box - Fix: [ bug #499 ]: Supplier order input method not translated - Fix: No images into product description lines as PDF generation does diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index a51e7441138..b6d26f82682 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2006 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 Marcos García * * 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 @@ -131,7 +132,7 @@ else $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; if ($sall) { - $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'"; + $sql .= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'"; if (! empty($conf->global->MAIN_MODULE_BARCODE)) { $sql .= " OR p.barcode LIKE '%".$db->escape($sall)."%'"; From 90584390152699f119fc7eb299ada2fc2f2ded2e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 9 Sep 2012 16:17:19 +0200 Subject: [PATCH 05/16] Fix: best practice --- htdocs/core/class/html.formbarcode.class.php | 6 +++--- htdocs/product/liste.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 9964657c3a3..5a9ab8b6ee8 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008-2012 Laurent Destailleur +/* Copyright (C) 2007-2012 Regis Houssin + * Copyright (C) 2008-2012 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 @@ -169,7 +169,7 @@ class FormBarCode { print ''; print ''; - print ''; + print ''; print ''; print ''; } - if (! empty($conf->global->MAIN_MODULE_BARCODE)) + if (! empty($conf->barcode->enabled)) { print ''; } diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index d25245c7288..6a72d73cb50 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -105,7 +105,7 @@ if ($socid) print ''; } - if ($conf->global->MAIN_MODULE_BARCODE) + if (! empty($conf->barcode->enabled)) { print ''; } diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index 181e248f849..d519f125c09 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -96,7 +96,7 @@ -global->MAIN_MODULE_BARCODE) { ?> +barcode->enabled)) { ?> diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index c0e865c6aef..4d89f95b8c8 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -111,7 +111,7 @@ if ($this->control->tpl['fournisseur']) { -global->MAIN_MODULE_BARCODE) { ?> +barcode->enabled)) { ?> diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index a0a9c7ec47a..1eaf013af0d 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -69,7 +69,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); -global->MAIN_MODULE_BARCODE) { ?> +barcode->enabled)) { ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index 6c7e029b8e3..ac4e4cceef0 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -106,7 +106,7 @@ -global->MAIN_MODULE_BARCODE) { ?> +barcode->enabled)) { ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 19d7f4b67d5..296869bbae3 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -108,7 +108,7 @@ if ($this->control->tpl['fournisseur']) { -global->MAIN_MODULE_BARCODE) { ?> +barcode->enabled)) { ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 6f82f5c6aeb..a47f3c7711f 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -68,7 +68,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); -global->MAIN_MODULE_BARCODE) { ?> +barcode->enabled)) { ?> diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 156133c9252..a81426f1739 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -784,7 +784,7 @@ else print ''; // Barcode - if (! empty($conf->global->MAIN_MODULE_BARCODE)) + if (! empty($conf->barcode->enabled)) { print ''; @@ -1218,7 +1218,7 @@ else } // Barcode - if ($conf->global->MAIN_MODULE_BARCODE) + if (! empty($conf->barcode->enabled)) { print ''; @@ -1469,7 +1469,7 @@ else if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++; if (! empty($object->client)) $rowspan++; if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) $rowspan++; - if (! empty($conf->global->MAIN_MODULE_BARCODE)) $rowspan++; + if (! empty($conf->barcode->enabled)) $rowspan++; if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++; $htmllogobar=''; if ($showlogo || $showbarcode) @@ -1514,7 +1514,7 @@ else } // Barcode - if (! empty($conf->global->MAIN_MODULE_BARCODE)) + if (! empty($conf->barcode->enabled)) { print ' print '
'; $this->select_barcode_type($selected, $htmlname, 1); diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index b6d26f82682..e750faa0357 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -132,12 +132,12 @@ else $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; if ($sall) { - $sql .= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'"; - if (! empty($conf->global->MAIN_MODULE_BARCODE)) + $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'"; + if (! empty($conf->barcode->enabled)) { - $sql .= " OR p.barcode LIKE '%".$db->escape($sall)."%'"; + $sql.= " OR p.barcode LIKE '%".$db->escape($sall)."%'"; } - $sql .= ')'; + $sql.= ')'; } // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type)) From a7bfc722d55efa1fa1b82c1b98ba773db0a41422 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 9 Sep 2012 16:31:00 +0200 Subject: [PATCH 06/16] Fix: use specific variable --- htdocs/categories/categorie.php | 2 +- htdocs/societe/agenda.php | 2 +- htdocs/societe/canvas/company/tpl/card_create.tpl.php | 2 +- htdocs/societe/canvas/company/tpl/card_edit.tpl.php | 2 +- htdocs/societe/canvas/company/tpl/card_view.tpl.php | 2 +- htdocs/societe/canvas/individual/tpl/card_create.tpl.php | 2 +- htdocs/societe/canvas/individual/tpl/card_edit.tpl.php | 2 +- htdocs/societe/canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/societe/soc.php | 8 ++++---- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 48832c0eb86..a50a3a53896 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -223,7 +223,7 @@ if ($socid) print '
'.$langs->trans('Gencod').''.$soc->barcode.'
'.$langs->trans('Gencod').''.$soc->barcode.'
trans('Gencod'); ?>
trans('Gencod'); ?>
trans('Gencod'); ?> control->tpl['barcode']; ?>
trans('Gencod'); ?>
trans('Gencod'); ?>
trans('Gencod'); ?> control->tpl['barcode']; ?>
'.$langs->trans('Gencod').''; print '
'.$langs->trans('Gencod').''; print '
'; print $langs->trans('Gencod').''.$object->barcode; From d7f3deffce96f4e5dc818d511a337a0db1aa0e5b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 9 Sep 2012 16:32:03 +0200 Subject: [PATCH 07/16] Fix: convert line delimiters --- htdocs/admin/system/database.php | 10 +- htdocs/core/menus/standard/eldy.lib.php | 18 +-- htdocs/exports/index.php | 164 ++++++++++++------------ htdocs/imports/index.php | 144 ++++++++++----------- htdocs/theme/auguria/style.css.php | 20 +-- 5 files changed, 178 insertions(+), 178 deletions(-) diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index d1f6cf52ab8..33cb8a640a2 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -56,11 +56,11 @@ print '
'.$langs->trans("DBSortingCharset").'
'; // Tables -print '
'; -print ''; -print ''."\n"; -print ''."\n"; -print '
'.$langs->trans("Tables").'
'.$langs->trans("List").'
'; +print '
'; +print ''; +print ''."\n"; +print ''."\n"; +print '
'.$langs->trans("Tables").'
'.$langs->trans("List").'
'; $base=0; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b164d5a0d13..99368e609d8 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -689,15 +689,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("SystemTools"), 0, 1, '', $mainmenu, 'admintools'); if ($leftmenu=="admintools") { - $newmenu->add('/admin/system/dolibarr.php?mainmenu=home', $langs->trans('InfoDolibarr'), 1); - $newmenu->add('/admin/system/constall.php?mainmenu=home', $langs->trans('AllParameters'), 2); - $newmenu->add('/admin/system/modules.php?mainmenu=home', $langs->trans('Modules'), 2); - $newmenu->add('/admin/triggers.php?mainmenu=home', $langs->trans('Triggers'), 2); - $newmenu->add('/admin/system/os.php?mainmenu=home', $langs->trans('InfoOS'), 1); - $newmenu->add('/admin/system/web.php?mainmenu=home', $langs->trans('InfoWebServer'), 1); - $newmenu->add('/admin/system/phpinfo.php?mainmenu=home', $langs->trans('InfoPHP'), 1); - //if (function_exists('xdebug_is_enabled')) $newmenu->add('/admin/system/xdebug.php', $langs->trans('XDebug'),1); - $newmenu->add('/admin/system/database.php?mainmenu=home', $langs->trans('InfoDatabase'), 1); + $newmenu->add('/admin/system/dolibarr.php?mainmenu=home', $langs->trans('InfoDolibarr'), 1); + $newmenu->add('/admin/system/constall.php?mainmenu=home', $langs->trans('AllParameters'), 2); + $newmenu->add('/admin/system/modules.php?mainmenu=home', $langs->trans('Modules'), 2); + $newmenu->add('/admin/triggers.php?mainmenu=home', $langs->trans('Triggers'), 2); + $newmenu->add('/admin/system/os.php?mainmenu=home', $langs->trans('InfoOS'), 1); + $newmenu->add('/admin/system/web.php?mainmenu=home', $langs->trans('InfoWebServer'), 1); + $newmenu->add('/admin/system/phpinfo.php?mainmenu=home', $langs->trans('InfoPHP'), 1); + //if (function_exists('xdebug_is_enabled')) $newmenu->add('/admin/system/xdebug.php', $langs->trans('XDebug'),1); + $newmenu->add('/admin/system/database.php?mainmenu=home', $langs->trans('InfoDatabase'), 1); $newmenu->add("/admin/tools/dolibarr_export.php?mainmenu=home", $langs->trans("Backup"),1); $newmenu->add("/admin/tools/dolibarr_import.php?mainmenu=home", $langs->trans("Restore"),1); diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index 0cf3a0f0ef1..079fd67ceca 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -53,93 +53,93 @@ print ''; print ''; print '
'; - -// List export set -print ''; -print ''; -print ''; -print ''; -//print ''; -print ''; -$var=true; -if (count($export->array_export_code)) -{ - foreach ($export->array_export_code as $key => $value) - { - $var=!$var; - print ''; - // print ''; - print ''; - - } -} -else -{ - print ''; -} -print '
'.$langs->trans("Module").''.$langs->trans("ExportableDatas").' 
'; - //print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' '; - print $export->array_export_module[$key]->getName(); - print ''; - print img_object($export->array_export_module[$key]->getName(),$export->array_export_icon[$key]).' '; - $string=$langs->trans($export->array_export_label[$key]); - print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]); - print ''; - // print ''.img_picto($langs->trans("NewExport"),'filenew').''; - // print '
'.$langs->trans("NoExportableData").'
'; -print '
'; - -print '
'; -if (count($export->array_export_code)) -{ - if ($user->rights->export->creer) - { - print ''.$langs->trans("NewExport").''; - } - else - { - print ''.$langs->trans("NewExport").''; - } - /* - print '
rights->export->creer?'':' disabled="disabled"'); - print '>
'; - */ -} + +// List export set +print ''; +print ''; +print ''; +print ''; +//print ''; +print ''; +$var=true; +if (count($export->array_export_code)) +{ + foreach ($export->array_export_code as $key => $value) + { + $var=!$var; + print ''; + // print ''; + print ''; + + } +} +else +{ + print ''; +} +print '
'.$langs->trans("Module").''.$langs->trans("ExportableDatas").' 
'; + //print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' '; + print $export->array_export_module[$key]->getName(); + print ''; + print img_object($export->array_export_module[$key]->getName(),$export->array_export_icon[$key]).' '; + $string=$langs->trans($export->array_export_label[$key]); + print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]); + print ''; + // print ''.img_picto($langs->trans("NewExport"),'filenew').''; + // print '
'.$langs->trans("NoExportableData").'
'; +print '
'; + +print '
'; +if (count($export->array_export_code)) +{ + if ($user->rights->export->creer) + { + print ''.$langs->trans("NewExport").''; + } + else + { + print ''.$langs->trans("NewExport").''; + } + /* + print '
rights->export->creer?'':' disabled="disabled"'); + print '>
'; + */ +} print '
'; print '
'; - -// List of available export format -$var=true; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - -include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; -$model=new ModeleExports(); -$liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties - -$var=true; -foreach($liste as $key => $val) -{ - $var=!$var; - print ''; - print ''; - $text=$model->getDriverDesc($key); - print ''; - print ''; - print ''; - print ''; -} - -print '
'.$langs->trans("AvailableFormats").''.$langs->trans("LibraryShort").''.$langs->trans("LibraryVersion").'
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.$form->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'
'; - + +// List of available export format +$var=true; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; +$model=new ModeleExports(); +$liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties + +$var=true; +foreach($liste as $key => $val) +{ + $var=!$var; + print ''; + print ''; + $text=$model->getDriverDesc($key); + print ''; + print ''; + print ''; + print ''; +} + +print '
'.$langs->trans("AvailableFormats").''.$langs->trans("LibraryShort").''.$langs->trans("LibraryVersion").'
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.$form->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'
'; + print '
'; diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php index c421dafc554..f9f6dfb9d27 100644 --- a/htdocs/imports/index.php +++ b/htdocs/imports/index.php @@ -52,84 +52,84 @@ print ''; print ''; diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 5ee989db284..8cba8d76e4f 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -68,17 +68,17 @@ $img_button=dol_buildpath($path.'/theme/auguria/img/button_bg.png',1); $colorbacklineimpairhover='210,214,217'; $colorbacklinepairhover='210,214,217'; -// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER -if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) - || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) -{ - $colorbacklineimpairhover=''; - $colorbacklinepairhover=''; -} +// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER +if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) + || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) +{ + $colorbacklineimpairhover=''; + $colorbacklinepairhover=''; +} -print '/*'."\n"; -print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; -print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print '/*'."\n"; +print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; +print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; print '*/'."\n"; ?> From 5ff12402878eda8ac6323f43a15a1e647c3e2352 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 9 Sep 2012 18:28:36 +0200 Subject: [PATCH 08/16] Fix: increase size for big path and where data is encrypted --- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 6 ++++-- htdocs/install/mysql/tables/llx_ecm_directories.sql | 2 +- htdocs/install/mysql/tables/llx_ecm_documents.sql | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 32717194577..99a947c2510 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -92,7 +92,8 @@ ALTER TABLE llx_actioncomm MODIFY elementtype VARCHAR(32); -- TASK #107 ALTER TABLE llx_ecm_directories MODIFY COLUMN label varchar(64) NOT NULL; -ALTER TABLE llx_ecm_directories ADD COLUMN fullpath varchar(255) AFTER cachenbofdoc; +ALTER TABLE llx_ecm_directories ADD COLUMN fullpath text AFTER cachenbofdoc; +ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath text; ALTER TABLE llx_ecm_directories ADD COLUMN extraparams varchar(255) AFTER fullpath; ALTER TABLE llx_ecm_directories ADD COLUMN acl text; ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_c (fk_user_c); @@ -107,7 +108,8 @@ ALTER TABLE llx_ecm_documents DROP COLUMN private; ALTER TABLE llx_ecm_documents DROP COLUMN crc; ALTER TABLE llx_ecm_documents DROP COLUMN cryptkey; ALTER TABLE llx_ecm_documents DROP COLUMN cipher; -ALTER TABLE llx_ecm_documents CHANGE COLUMN fullpath_dol fullpath varchar(255) NOT NULL; +ALTER TABLE llx_ecm_documents CHANGE COLUMN fullpath_dol fullpath text; +ALTER TABLE llx_ecm_documents MODIFY COLUMN fullpath text; ALTER TABLE llx_ecm_documents MODIFY COLUMN filemime varchar(128) NOT NULL; ALTER TABLE llx_ecm_documents ADD COLUMN metadata text after description; ALTER TABLE llx_ecm_documents ADD COLUMN extraparams varchar(255) AFTER fk_directory; diff --git a/htdocs/install/mysql/tables/llx_ecm_directories.sql b/htdocs/install/mysql/tables/llx_ecm_directories.sql index 7e11694ad0b..06cc553ebca 100644 --- a/htdocs/install/mysql/tables/llx_ecm_directories.sql +++ b/htdocs/install/mysql/tables/llx_ecm_directories.sql @@ -27,7 +27,7 @@ create table llx_ecm_directories fk_parent integer, description varchar(255) NOT NULL, cachenbofdoc integer NOT NULL DEFAULT 0, - fullpath varchar(255), -- can be NULL for virtual directory + fullpath text, extraparams varchar(255), -- for stock other parameters with json format date_c datetime, date_m timestamp, diff --git a/htdocs/install/mysql/tables/llx_ecm_documents.sql b/htdocs/install/mysql/tables/llx_ecm_documents.sql index b1d8ecd3bba..7a3440e5649 100644 --- a/htdocs/install/mysql/tables/llx_ecm_documents.sql +++ b/htdocs/install/mysql/tables/llx_ecm_documents.sql @@ -28,7 +28,7 @@ create table llx_ecm_documents filemime varchar(128) NOT NULL, description text, metadata text, - fullpath varchar(255) NOT NULL, + fullpath text, fk_directory integer, extraparams varchar(255), -- for stock other parameters with json format fk_create integer NOT NULL, From 3b3e67758e9fd0d9a11aeccb107115964c1e3818 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Sep 2012 20:33:00 +0200 Subject: [PATCH 09/16] Fix: Removed warnings --- htdocs/admin/modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 170e4ad0bce..65ea4f5a700 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -150,8 +150,8 @@ foreach ($modulesdir as $dir) // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); - if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; - if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) $modulequalified=0; + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) $modulequalified=0; if ($modulequalified) { From 61159ca2206f24acd9ccee30ea85345f270107f5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 9 Sep 2012 22:05:53 +0200 Subject: [PATCH 10/16] Fix: use specific hash for ref --- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 6 ++++-- htdocs/install/mysql/tables/llx_ecm_documents.key.sql | 3 +-- htdocs/install/mysql/tables/llx_ecm_documents.sql | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 99a947c2510..a3499ec2de7 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -101,6 +101,8 @@ ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_m (fk_user ALTER TABLE llx_ecm_directories ADD CONSTRAINT fk_ecm_directories_fk_user_c FOREIGN KEY (fk_user_c) REFERENCES llx_user (rowid); ALTER TABLE llx_ecm_directories ADD CONSTRAINT fk_ecm_directories_fk_user_m FOREIGN KEY (fk_user_m) REFERENCES llx_user (rowid); +ALTER TABLE llx_ecm_documents DROP FOREIGN KEY fk_ecm_documents_fk_directory; +ALTER TABLE llx_ecm_documents DROP INDEX idx_ecm_documents_ref; ALTER TABLE llx_ecm_documents DROP INDEX idx_ecm_documents; ALTER TABLE llx_ecm_documents DROP COLUMN manualkeyword; ALTER TABLE llx_ecm_documents DROP COLUMN fullpath_orig; @@ -109,14 +111,14 @@ ALTER TABLE llx_ecm_documents DROP COLUMN crc; ALTER TABLE llx_ecm_documents DROP COLUMN cryptkey; ALTER TABLE llx_ecm_documents DROP COLUMN cipher; ALTER TABLE llx_ecm_documents CHANGE COLUMN fullpath_dol fullpath text; +ALTER TABLE llx_ecm_documents MODIFY COLUMN ref varchar(32) NOT NULL; ALTER TABLE llx_ecm_documents MODIFY COLUMN fullpath text; ALTER TABLE llx_ecm_documents MODIFY COLUMN filemime varchar(128) NOT NULL; ALTER TABLE llx_ecm_documents ADD COLUMN metadata text after description; ALTER TABLE llx_ecm_documents ADD COLUMN extraparams varchar(255) AFTER fk_directory; -ALTER TABLE llx_ecm_documents ADD UNIQUE INDEX idx_ecm_documents_ref (ref, fk_directory, entity); +ALTER TABLE llx_ecm_documents ADD UNIQUE INDEX idx_ecm_documents_ref (ref, entity); ALTER TABLE llx_ecm_documents ADD INDEX idx_ecm_documents_fk_create (fk_create); ALTER TABLE llx_ecm_documents ADD INDEX idx_ecm_documents_fk_update (fk_update); -ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_directory FOREIGN KEY (fk_directory) REFERENCES llx_ecm_directories (rowid); ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_create FOREIGN KEY (fk_create) REFERENCES llx_user (rowid); ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_update FOREIGN KEY (fk_update) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_ecm_documents.key.sql b/htdocs/install/mysql/tables/llx_ecm_documents.key.sql index a29292dea1c..0f7616d8a59 100644 --- a/htdocs/install/mysql/tables/llx_ecm_documents.key.sql +++ b/htdocs/install/mysql/tables/llx_ecm_documents.key.sql @@ -18,11 +18,10 @@ -- ============================================================================ -ALTER TABLE llx_ecm_documents ADD UNIQUE INDEX idx_ecm_documents_ref (ref, fk_directory, entity); +ALTER TABLE llx_ecm_documents ADD UNIQUE INDEX idx_ecm_documents_ref (ref, entity); ALTER TABLE llx_ecm_documents ADD INDEX idx_ecm_documents_fk_create (fk_create); ALTER TABLE llx_ecm_documents ADD INDEX idx_ecm_documents_fk_update (fk_update); -ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_directory FOREIGN KEY (fk_directory) REFERENCES llx_ecm_directories (rowid); ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_create FOREIGN KEY (fk_create) REFERENCES llx_user (rowid); ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_update FOREIGN KEY (fk_update) REFERENCES llx_user (rowid); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_ecm_documents.sql b/htdocs/install/mysql/tables/llx_ecm_documents.sql index 7a3440e5649..148fec437f2 100644 --- a/htdocs/install/mysql/tables/llx_ecm_documents.sql +++ b/htdocs/install/mysql/tables/llx_ecm_documents.sql @@ -21,16 +21,16 @@ create table llx_ecm_documents ( rowid integer AUTO_INCREMENT PRIMARY KEY, - ref varchar(16) NOT NULL, entity integer DEFAULT 1 NOT NULL, + ref varchar(32) NOT NULL, -- hash(fullpath + filename + version) filename varchar(255) NOT NULL, filesize integer NOT NULL, - filemime varchar(128) NOT NULL, + filemime varchar(128) NOT NULL, description text, - metadata text, + metadata text, -- Secure file information (json format / encrypted) fullpath text, fk_directory integer, - extraparams varchar(255), -- for stock other parameters with json format + extraparams varchar(255), -- Other parameters (json format) fk_create integer NOT NULL, fk_update integer, date_c datetime NOT NULL, From f390bec1ac6c0747b7df005a66f2592e3d643b83 Mon Sep 17 00:00:00 2001 From: simnandez Date: Mon, 10 Sep 2012 09:06:37 +0200 Subject: [PATCH 11/16] Fix: use $ldap instead $this --- htdocs/user/fiche.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 05fe306facd..4198f8c2a3f 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot + * Copyright (C) 2012 Juanjo Menent * * 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 @@ -882,7 +883,7 @@ else $result=$ldap->connect_bind(); if ($result > 0) { - $userSearchFilter = '('.$conf->global->LDAP_FILTER_CONNECTION.'('.$this->getUserIdentifier().'='.$fuser->login.'))'; + $userSearchFilter = '('.$conf->global->LDAP_FILTER_CONNECTION.'('.$ldap->getUserIdentifier().'='.$fuser->login.'))'; $entries = $ldap->fetch($fuser->login,$userSearchFilter); if (! $entries) { From 75647aa19d2c606c9b92614d75e090af8cfb260f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Mon, 10 Sep 2012 10:00:22 +0200 Subject: [PATCH 12/16] Inverted the clause for commercial_id affectation This permits using a script to import commercial_id. The clause to automatically affect the current user as commercial doesn't seem to work anyway --- htdocs/societe/class/societe.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6ad2bde8468..5e3d592c23e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -227,16 +227,16 @@ class Societe extends CommonObject $ret = $this->update($this->id,$user,0,1,1,'add'); - // si un commercial cree un client il lui est affecte automatiquement - if (!$user->rights->societe->client->voir) - { - $this->add_commercial($user, $user->id); - } // Ajout du commercial affecte - else if ($this->commercial_id != '' && $this->commercial_id != -1) + if ($this->commercial_id != '' && $this->commercial_id != -1) { $this->add_commercial($user, $this->commercial_id); } + // si un commercial cree un client il lui est affecte automatiquement + else if (!$user->rights->societe->client->voir) + { + $this->add_commercial($user, $user->id); + } // si le fournisseur est classe on l'ajoute $this->AddFournisseurInCategory($this->fournisseur_categorie); From 66af48697cdada59b16a3fc45cb0a4c3a28e94e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Sep 2012 10:25:47 +0200 Subject: [PATCH 13/16] Doc --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5e3d592c23e..6e14a1ec6e6 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -130,7 +130,7 @@ class Societe extends CommonObject var $datec; var $date_update; - var $commercial_id; //Id du commercial affecte + var $commercial_id; // Id of sales representative to link (used for thirdparty creation). Not filled by a fetch, because we can have several sales representatives. var $default_lang; var $ref_int; From e1fcaf738f74b84789c24743468d380de81df546 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 10 Sep 2012 10:55:06 +0200 Subject: [PATCH 14/16] Fix: move llx_ecm_documents in external module --- .../install/mysql/migration/3.2.0-3.3.0.sql | 25 +----------- .../mysql/tables/llx_ecm_documents.key.sql | 27 ------------- .../mysql/tables/llx_ecm_documents.sql | 40 ------------------- 3 files changed, 1 insertion(+), 91 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_ecm_documents.key.sql delete mode 100644 htdocs/install/mysql/tables/llx_ecm_documents.sql diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index a3499ec2de7..34e06092833 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -90,7 +90,6 @@ ALTER TABLE llx_accountingaccount ADD COLUMN active tinyint DEFAULT 1 NOT NULL ALTER TABLE llx_actioncomm MODIFY elementtype VARCHAR(32); --- TASK #107 ALTER TABLE llx_ecm_directories MODIFY COLUMN label varchar(64) NOT NULL; ALTER TABLE llx_ecm_directories ADD COLUMN fullpath text AFTER cachenbofdoc; ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath text; @@ -101,31 +100,10 @@ ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_m (fk_user ALTER TABLE llx_ecm_directories ADD CONSTRAINT fk_ecm_directories_fk_user_c FOREIGN KEY (fk_user_c) REFERENCES llx_user (rowid); ALTER TABLE llx_ecm_directories ADD CONSTRAINT fk_ecm_directories_fk_user_m FOREIGN KEY (fk_user_m) REFERENCES llx_user (rowid); -ALTER TABLE llx_ecm_documents DROP FOREIGN KEY fk_ecm_documents_fk_directory; -ALTER TABLE llx_ecm_documents DROP INDEX idx_ecm_documents_ref; -ALTER TABLE llx_ecm_documents DROP INDEX idx_ecm_documents; -ALTER TABLE llx_ecm_documents DROP COLUMN manualkeyword; -ALTER TABLE llx_ecm_documents DROP COLUMN fullpath_orig; -ALTER TABLE llx_ecm_documents DROP COLUMN private; -ALTER TABLE llx_ecm_documents DROP COLUMN crc; -ALTER TABLE llx_ecm_documents DROP COLUMN cryptkey; -ALTER TABLE llx_ecm_documents DROP COLUMN cipher; -ALTER TABLE llx_ecm_documents CHANGE COLUMN fullpath_dol fullpath text; -ALTER TABLE llx_ecm_documents MODIFY COLUMN ref varchar(32) NOT NULL; -ALTER TABLE llx_ecm_documents MODIFY COLUMN fullpath text; -ALTER TABLE llx_ecm_documents MODIFY COLUMN filemime varchar(128) NOT NULL; -ALTER TABLE llx_ecm_documents ADD COLUMN metadata text after description; -ALTER TABLE llx_ecm_documents ADD COLUMN extraparams varchar(255) AFTER fk_directory; -ALTER TABLE llx_ecm_documents ADD UNIQUE INDEX idx_ecm_documents_ref (ref, entity); -ALTER TABLE llx_ecm_documents ADD INDEX idx_ecm_documents_fk_create (fk_create); -ALTER TABLE llx_ecm_documents ADD INDEX idx_ecm_documents_fk_update (fk_update); -ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_create FOREIGN KEY (fk_create) REFERENCES llx_user (rowid); -ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_update FOREIGN KEY (fk_update) REFERENCES llx_user (rowid); - create table llx_element_tag ( rowid integer AUTO_INCREMENT PRIMARY KEY, - entity integer DEFAULT 1 NOT NULL, -- multi company id + entity integer DEFAULT 1 NOT NULL, lang varchar(5) NOT NULL, tag varchar(255) NOT NULL, fk_element integer NOT NULL, @@ -134,7 +112,6 @@ create table llx_element_tag )ENGINE=innodb; ALTER TABLE llx_element_tag ADD UNIQUE INDEX uk_element_tag (entity, lang, tag, fk_element, element); --- END TASK #107 CREATE TABLE llx_holiday_config diff --git a/htdocs/install/mysql/tables/llx_ecm_documents.key.sql b/htdocs/install/mysql/tables/llx_ecm_documents.key.sql deleted file mode 100644 index 0f7616d8a59..00000000000 --- a/htdocs/install/mysql/tables/llx_ecm_documents.key.sql +++ /dev/null @@ -1,27 +0,0 @@ --- ============================================================================ --- Copyright (C) 2010 Laurent Destailleur --- Copyright (C) 2012 Regis Houssin --- --- 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 2 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 . --- --- ============================================================================ - - -ALTER TABLE llx_ecm_documents ADD UNIQUE INDEX idx_ecm_documents_ref (ref, entity); -ALTER TABLE llx_ecm_documents ADD INDEX idx_ecm_documents_fk_create (fk_create); -ALTER TABLE llx_ecm_documents ADD INDEX idx_ecm_documents_fk_update (fk_update); - -ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_create FOREIGN KEY (fk_create) REFERENCES llx_user (rowid); -ALTER TABLE llx_ecm_documents ADD CONSTRAINT fk_ecm_documents_fk_update FOREIGN KEY (fk_update) REFERENCES llx_user (rowid); - \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_ecm_documents.sql b/htdocs/install/mysql/tables/llx_ecm_documents.sql deleted file mode 100644 index 148fec437f2..00000000000 --- a/htdocs/install/mysql/tables/llx_ecm_documents.sql +++ /dev/null @@ -1,40 +0,0 @@ --- =================================================================== --- Copyright (C) 2008-2012 Laurent Destailleur --- Copyright (C) 2009-2012 Regis Houssin --- --- 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 2 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 . --- --- =================================================================== - - -create table llx_ecm_documents -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - entity integer DEFAULT 1 NOT NULL, - ref varchar(32) NOT NULL, -- hash(fullpath + filename + version) - filename varchar(255) NOT NULL, - filesize integer NOT NULL, - filemime varchar(128) NOT NULL, - description text, - metadata text, -- Secure file information (json format / encrypted) - fullpath text, - fk_directory integer, - extraparams varchar(255), -- Other parameters (json format) - fk_create integer NOT NULL, - fk_update integer, - date_c datetime NOT NULL, - date_u timestamp, - fk_status smallint DEFAULT 0 - -) ENGINE=innodb; From 2e4aa1131a945fb6c0ffedfb6799405bdd823737 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 10 Sep 2012 11:00:35 +0200 Subject: [PATCH 15/16] prepare database for local taxes management add localtax1_type and localtax2_type in database. these type are char(1) and support following values : '0' : local tax not applied '1' : local tax apply on products and services without vat (vat is not applied on local tax) '2' : local tax apply on products and services before vat (vat is calculated on amount + localtax) '3' : local tax apply on products without vat (vat is not applied on local tax) '4' : local tax apply on products before vat (vat is calculated on amount + localtax) '5' : local tax apply on services without vat (vat is not applied on local tax) '6' : local tax apply on services before vat (vat is calculated on amount + localtax) '7' : local tax is a fix amount applied on global invoice --- htdocs/install/mysql/data/llx_c_tva.sql | 14 ++++++------- .../install/mysql/migration/3.2.0-3.3.0.sql | 20 +++++++++++++++++++ htdocs/install/mysql/tables/llx_c_tva.sql | 2 ++ .../tables/llx_commande_fournisseurdet.sql | 2 ++ .../install/mysql/tables/llx_commandedet.sql | 6 ++++-- .../mysql/tables/llx_facture_fourn_det.sql | 6 ++++-- .../install/mysql/tables/llx_facturedet.sql | 6 ++++-- htdocs/install/mysql/tables/llx_propaldet.sql | 6 ++++-- 8 files changed, 47 insertions(+), 15 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index b22295e0466..82348a15f89 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -208,13 +208,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 6 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '0','0','VAT Rate 0', 1); -- TUNISIA (id country=10) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (101,10, '6','0','VAT 6%', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (102,10, '12','0','VAT 12%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (103,10, '18','0','VAT 18%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (107,10, '0','0','VAT Rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1, localtax1_type, localtax2, localtax2_type) values (101,10, '6','0','VAT 6%', 1, 1, '4', 0.4, '7'); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1, localtax1_type, localtax2, localtax2_type) values (102,10, '12','0','VAT 12%',1, 1, '4', 0.4, '7'); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1, localtax1_type, localtax2, localtax2_type) values (103,10, '18','0','VAT 18%',1, 1, '4', 0.4, '7'); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1, localtax1_type, localtax2, localtax2_type) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1, 1, '4', 0.4, '7'); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1, localtax1_type, localtax2, localtax2_type) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1, 1, '4', 0.4, '7'); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1, localtax1_type, localtax2, localtax2_type) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1, 1, '4', 0.4, '7'); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1, localtax1_type, localtax2, localtax2_type) values (107,10, '0','0','VAT Rate 0', 1, 1, '4', 0.4, '7'); -- UKRAINE (id country=226) INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '20','0','VAT standart rate',1); diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index a3499ec2de7..a61dfc8c790 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -209,3 +209,23 @@ ALTER TABLE llx_boxes DROP INDEX uk_boxes; ALTER TABLE llx_boxes ADD COLUMN entity integer NOT NULL DEFAULT 1 AFTER rowid; ALTER TABLE llx_boxes ADD UNIQUE INDEX uk_boxes (entity, box_id, position, fk_user); UPDATE llx_boxes as b SET b.entity = (SELECT bd.entity FROM llx_boxes_def as bd WHERE bd.rowid = b.box_id); + +-- TASK #204 +alter table llx_c_tva add column localtax1_type char(1) default '0' after localtax1; +alter table llx_c_tva add column localtax2_type char(1) default '0' after localtax2; + +alter table llx_commande_fournisseurdet add column localtax1_type char(1) after localtax1_tx; +alter table llx_commande_fournisseurdet add column localtax2_type char(1) after localtax2_tx; + +alter table llx_commandedet add column localtax1_type char(1) after localtax1_tx; +alter table llx_commandedet add column localtax2_type char(1) after localtax2_tx; + +alter table llx_facture_fourn_det add column localtax1_type char(1) after localtax1_tx; +alter table llx_facture_fourn_det add column localtax2_type char(1) after localtax2_tx; + +alter table llx_facturedet add column localtax1_type char(1) after localtax1_tx; +alter table llx_facturedet add column localtax2_type char(1) after localtax2_tx; + +alter table llx_propaldet add column localtax1_type char(1) after localtax1_tx; +alter table llx_propaldet add column localtax2_type char(1) after localtax2_tx; +-- END TASK #204 \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_c_tva.sql b/htdocs/install/mysql/tables/llx_c_tva.sql index 524543a356b..85fe4bdd34c 100644 --- a/htdocs/install/mysql/tables/llx_c_tva.sql +++ b/htdocs/install/mysql/tables/llx_c_tva.sql @@ -23,7 +23,9 @@ create table llx_c_tva fk_pays integer NOT NULL, taux double NOT NULL, localtax1 double NOT NULL DEFAULT 0, + localtax1_type char(1) NOT NULL DEFAULT '0', localtax2 double NOT NULL DEFAULT 0, + localtax2_type char(1) NOT NULL DEFAULT '0', recuperableonly integer NOT NULL DEFAULT 0, note varchar(128), active tinyint DEFAULT 1 NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql b/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql index de30de48309..532e0a1b3fd 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql @@ -28,7 +28,9 @@ create table llx_commande_fournisseurdet description text, tva_tx double(6,3) DEFAULT 0, -- taux tva localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate + localtax1_type char(1) NULL, -- localtax1 type localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate + localtax2_type char(1) NULL, -- localtax2 type qty real, -- quantity remise_percent real DEFAULT 0, -- pourcentage de remise remise real DEFAULT 0, -- montant de la remise diff --git a/htdocs/install/mysql/tables/llx_commandedet.sql b/htdocs/install/mysql/tables/llx_commandedet.sql index 42a9bb1845d..c14d1ed01b4 100644 --- a/htdocs/install/mysql/tables/llx_commandedet.sql +++ b/htdocs/install/mysql/tables/llx_commandedet.sql @@ -28,8 +28,10 @@ create table llx_commandedet label varchar(255) DEFAULT NULL, description text, tva_tx double(6,3), -- vat rate - localtax1_tx double(6,3), -- localtax1 rate - localtax2_tx double(6,3), -- localtax2 rate + localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate + localtax1_type char(1) NULL, -- localtax1 type + localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate + localtax2_type char(1) NULL, -- localtax2 type qty real, -- quantity remise_percent real DEFAULT 0, -- pourcentage de remise remise real DEFAULT 0, -- montant de la remise diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql index c9edf7b55ba..58c9b14ee0c 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql @@ -30,8 +30,10 @@ create table llx_facture_fourn_det pu_ttc double(24,8), -- unit price with tax qty real, -- quantity of product/service tva_tx double(6,3), -- TVA taux product/service - localtax1_tx double(6,3) DEFAULT 0, -- tax local tax 1 - localtax2_tx double(6,3) DEFAULT 0, -- tax local tax 2 + localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate + localtax1_type char(1) NULL, -- localtax1 type + localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate + localtax2_type char(1) NULL, -- localtax2 type total_ht double(24,8), -- Total line price of product excluding tax tva double(24,8), -- Total TVA of line total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line diff --git a/htdocs/install/mysql/tables/llx_facturedet.sql b/htdocs/install/mysql/tables/llx_facturedet.sql index 8ccfeb35fb7..4abfbe83d6b 100644 --- a/htdocs/install/mysql/tables/llx_facturedet.sql +++ b/htdocs/install/mysql/tables/llx_facturedet.sql @@ -29,8 +29,10 @@ create table llx_facturedet label varchar(255) DEFAULT NULL, description text, tva_tx double(6,3), -- Taux tva produit/service (exemple 19.6) - localtax1_tx double(6,3) DEFAULT 0, -- tax local tax 1 - localtax2_tx double(6,3) DEFAULT 0, -- tax local tax 2 + localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate + localtax1_type char(1) NULL, -- localtax1 type + localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate + localtax2_type char(1) NULL, -- localtax2 type qty real, -- Quantity (exemple 2) remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%) remise real DEFAULT 0, -- Montant calcule de la remise % sur PU HT (exemple 20) diff --git a/htdocs/install/mysql/tables/llx_propaldet.sql b/htdocs/install/mysql/tables/llx_propaldet.sql index d869316b855..3b2deef6bb3 100644 --- a/htdocs/install/mysql/tables/llx_propaldet.sql +++ b/htdocs/install/mysql/tables/llx_propaldet.sql @@ -28,8 +28,10 @@ create table llx_propaldet description text, fk_remise_except integer NULL, -- Lien vers table des remises fixes tva_tx double(6,3) DEFAULT 0, -- taux tva - localtax1_tx double(6,3) DEFAULT 0, -- localtax1 tax - localtax2_tx double(6,3) DEFAULT 0, -- localtax2 tax + localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate + localtax1_type char(1) NULL, -- localtax1 type + localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate + localtax2_type char(1) NULL, -- localtax2 type qty real, -- quantity remise_percent real DEFAULT 0, -- pourcentage de remise remise real DEFAULT 0, -- montant de la remise (obsolete) From 4269878e6d3ab3ce0b1c164a902d9eae79ced98f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 10 Sep 2012 11:59:17 +0200 Subject: [PATCH 16/16] Fix: restore varchar for the moment --- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 4 ++-- htdocs/install/mysql/tables/llx_ecm_directories.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 34e06092833..0abaa6229d7 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -91,8 +91,8 @@ ALTER TABLE llx_accountingaccount ADD COLUMN active tinyint DEFAULT 1 NOT NULL ALTER TABLE llx_actioncomm MODIFY elementtype VARCHAR(32); ALTER TABLE llx_ecm_directories MODIFY COLUMN label varchar(64) NOT NULL; -ALTER TABLE llx_ecm_directories ADD COLUMN fullpath text AFTER cachenbofdoc; -ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath text; +ALTER TABLE llx_ecm_directories ADD COLUMN fullpath varchar(255) AFTER cachenbofdoc; +ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(255); ALTER TABLE llx_ecm_directories ADD COLUMN extraparams varchar(255) AFTER fullpath; ALTER TABLE llx_ecm_directories ADD COLUMN acl text; ALTER TABLE llx_ecm_directories ADD INDEX idx_ecm_directories_fk_user_c (fk_user_c); diff --git a/htdocs/install/mysql/tables/llx_ecm_directories.sql b/htdocs/install/mysql/tables/llx_ecm_directories.sql index 06cc553ebca..9e7fcf1249d 100644 --- a/htdocs/install/mysql/tables/llx_ecm_directories.sql +++ b/htdocs/install/mysql/tables/llx_ecm_directories.sql @@ -27,7 +27,7 @@ create table llx_ecm_directories fk_parent integer, description varchar(255) NOT NULL, cachenbofdoc integer NOT NULL DEFAULT 0, - fullpath text, + fullpath varchar(255), extraparams varchar(255), -- for stock other parameters with json format date_c datetime, date_m timestamp,
'; -// List of import set -print ''; -print ''; -print ''; -print ''; -//print ''; -print ''; -$val=true; -if (count($import->array_import_code)) -{ - foreach ($import->array_import_code as $key => $value) - { - $val=!$val; - print ''; - // print ''; - print ''; - - } -} -else -{ - print ''; -} -print '
'.$langs->trans("Module").''.$langs->trans("ImportableDatas").' 
'; - print img_object($import->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' '; - print $import->array_import_module[$key]->getName(); - print ''; - $string=$langs->trans($import->array_import_label[$key]); - print ($string!=$import->array_import_label[$key]?$string:$import->array_import_label[$key]); - print ''; - // print ''.img_picto($langs->trans("NewImport"),'filenew').''; - // print '
'.$langs->trans("NoImportableData").'
'; -print '
'; - -print '
'; -if (count($import->array_import_code)) -{ - //if ($user->rights->import->run) - //{ - print ''.$langs->trans("NewImport").''; - //} - //else - //{ - // print ''.$langs->trans("NewImport").''; - //} -} +// List of import set +print ''; +print ''; +print ''; +print ''; +//print ''; +print ''; +$val=true; +if (count($import->array_import_code)) +{ + foreach ($import->array_import_code as $key => $value) + { + $val=!$val; + print ''; + // print ''; + print ''; + + } +} +else +{ + print ''; +} +print '
'.$langs->trans("Module").''.$langs->trans("ImportableDatas").' 
'; + print img_object($import->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' '; + print $import->array_import_module[$key]->getName(); + print ''; + $string=$langs->trans($import->array_import_label[$key]); + print ($string!=$import->array_import_label[$key]?$string:$import->array_import_label[$key]); + print ''; + // print ''.img_picto($langs->trans("NewImport"),'filenew').''; + // print '
'.$langs->trans("NoImportableData").'
'; +print '
'; + +print '
'; +if (count($import->array_import_code)) +{ + //if ($user->rights->import->run) + //{ + print ''.$langs->trans("NewImport").''; + //} + //else + //{ + // print ''.$langs->trans("NewImport").''; + //} +} print '
'; print '
'; -// List of available import format -$var=true; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - -include_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php'; -$model=new ModeleImports(); -$liste=$model->liste_modeles($db); - -foreach($liste as $key) -{ - $var=!$var; - print ''; - print ''; - $text=$model->getDriverDesc($key); - print ''; - print ''; - print ''; - print ''; -} - -print '
'.$langs->trans("AvailableFormats").''.$langs->trans("LibraryShort").''.$langs->trans("LibraryVersion").'
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.$form->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'
'; +// List of available import format +$var=true; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +include_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php'; +$model=new ModeleImports(); +$liste=$model->liste_modeles($db); + +foreach($liste as $key) +{ + $var=!$var; + print ''; + print ''; + $text=$model->getDriverDesc($key); + print ''; + print ''; + print ''; + print ''; +} + +print '
'.$langs->trans("AvailableFormats").''.$langs->trans("LibraryShort").''.$langs->trans("LibraryVersion").'
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.$form->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'
'; print '