From f438097ecb6e15a007414790543613ebde145244 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 20 Jul 2017 14:59:24 +0200 Subject: [PATCH 1/9] Fix extrafield save on update --- htdocs/contrat/class/contrat.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e08e10a0966df..35a9e98b31f34 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1278,6 +1278,15 @@ function update($user=null, $notrigger=0) //// End call triggers } } + + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } // Commit or rollback if ($error) From 6830fe4f91163ec3c10b59d94428d085ce9dcd32 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jul 2017 13:38:49 +0200 Subject: [PATCH 2/9] Fix generic clone function --- htdocs/core/class/commonobject.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ddfb2780f3f83..f1ec086cd03a5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5023,7 +5023,7 @@ public function createCommon(User $user, $notrigger = false) */ public function createFromCloneCommon(User $user, $fromid) { - global $user; + global $user, $langs; $error = 0; @@ -5039,6 +5039,8 @@ public function createFromCloneCommon(User $user, $fromid) $object->id = 0; // Clear fields + $object->ref = "copy_of_".$object->ref; + $object->title = $langs->trans("CopyOf")." ".$object->title; // ... // Create clone @@ -5046,7 +5048,8 @@ public function createFromCloneCommon(User $user, $fromid) // Other options if ($result < 0) { - $error ++; + $error++; + $this->error = $object->error; $this->errors = $object->errors; dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); } From f64a9968a9d96a851de1109ccd60ab8e887c623f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jul 2017 01:00:43 +0200 Subject: [PATCH 3/9] Debug modulebuilder --- htdocs/core/lib/files.lib.php | 21 +++++++++- htdocs/core/lib/modulebuilder.lib.php | 2 + htdocs/langs/en_US/modulebuilder.lang | 2 +- htdocs/modulebuilder/index.php | 40 +++++++++++++++++++ .../template/class/myobject.class.php | 12 +++--- .../core/modules/modMyModule.class.php | 10 ++--- .../modulebuilder/template/myobject_list.php | 3 +- 7 files changed, 74 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 77502f1737ca7..6711ed2825f6b 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -448,12 +448,12 @@ function dol_filemtime($pathoffile) * Make replacement of strings into a file. * * @param string $srcfile Source file (can't be a directory) - * @param array $arrayreplacement Array with strings to replace + * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' * @param int $indexdatabase Index new file into database. * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK - * @see dolCopyr + * @see dolCopyr dolReplaceRegExInFile */ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, $indexdatabase=0) { @@ -514,6 +514,23 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, return 1; } +/** + * Make replacement of strings into a file. + * + * @param string $srcfile Source file (can't be a directory) + * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) + * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. + * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' + * @param int $indexdatabase Index new file into database. + * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK + * @see dolCopyr dolReplaceInFile + */ +function dolReplaceRegExInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, $indexdatabase=0) +{ + // TODO + +} + /** * Copy a file to another file. * diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index af9ab67d8fe16..0741dcef978c7 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -77,6 +77,8 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask) $i++; $typephp=''; $texttoinsert.= "\t\t'".$key."' => array('type'=>'".$val['type']."', 'label'=>'".$val['label']."',"; + $texttoinsert.= " 'visible'=>".$val['visible'].","; + $texttoinsert.= " 'enabled'=>".$val['enabled'].","; if ($val['position']) $texttoinsert.= " 'position'=>".$val['position'].","; if ($val['notnull']) $texttoinsert.= " 'notnull'=>".$val['notnull'].","; if ($val['index']) $texttoinsert.= " 'index'=>".$val['index'].","; diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 9a7fbb7b3bc9c..a3ba8a7455b09 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -13,7 +13,7 @@ FilesForObjectInitialized=Files for new object '%s' initialized FilesForObjectUpdated=Files for object '%s' updated (.sql files and .class.php file) ModuleBuilderDescdescription=Enter here all general information that describe your module ModuleBuilderDescspecifications=You can enter here a long text to describe the specifications of your module that is not already structured into other tabs. So you have within easy reach all the rules to develop. Also this text content will be included into the generated documentation (see last tab). You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown) -ModuleBuilderDescobjects=Define here the objects you want to manage with your module. A sql file, a page to list them, to create/edit/view a card and an API will be generated. +ModuleBuilderDescobjects=Define here the objects you want to manage with your module. A CRUD DAO class, SQL files, page to list record of objects, to create/edit/view a record and an API will be generated. ModuleBuilderDescmenus=This tab is dedicated to define menu entries provided by your module. ModuleBuilderDescpermissions=This tab is dedicated to define the new permissions you want to provide with your module. ModuleBuilderDesctriggers=This is the view of triggers provided by your module. To include code executed when a triggered business event is launched, just edit this file. diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4afaf136e199e..18d543c79330b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -217,6 +217,46 @@ else { // Copy is ok + if ($destfile == 'class/'.$objectname.'.txt') + { + // Regenerate left menu entry in descriptor + $stringtoadd=''; + // TODO Loop on each .txt file in class dir. + $stringtoadd.=" +\t\t\$this->menu[\$r++]=array( + 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'List MyObject', + 'mainmenu'=>'mymodule', + 'leftmenu'=>'mymodule_myobject', + 'url'=>'/mymodule/myobject_list.php', + 'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1100+\$r, + 'enabled'=>'\$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both +\t\t\$this->menu[\$r++]=array( + 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=mymodule_myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'New MyObject', + 'mainmenu'=>'mymodule', + 'leftmenu'=>'mymodule_myobject', + 'url'=>'/mymodule/myobject_card.php?action=create', + 'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1100+\$r, + 'enabled'=>'\$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + "; + $moduledescriptorfile=$dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; + // TODO Allow a replace with regex using dolReplaceRegexInFile + dolReplaceInFile($moduledescriptorfile, array('END MODULEBUILDER LEFTMENU MYOBJECT */' => '*/'."\n".$stringtoadd."\n\t\t/* END MODULEBUILDER LEFTMENU MYOBJECT */")); + + // Add module descriptor to list of files to replace "MyObject' string with real name of object. + $filetogenerate[]='core/modules/mod'.$module.'.class.php'; + } } } } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index f8882b68c563d..a68e0ff0da563 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -63,12 +63,12 @@ class MyObject extends CommonObject * @var array Array with all fields and their property */ public $fields=array( - 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'position'=>10, 'notnull'=>true, 'index'=>true, 'searchall'=>1, 'comment'=>'Reference of object'), - 'entity'=>array('type'=>'integer', 'label'=>'Entity', 'notnull'=>true, 'index'=>true), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'searchall'=>1), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'notnull'=>true, 'position'=>500), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'notnull'=>true, 'position'=>500), - 'status'=>array('type'=>'integer', 'label'=>'Status', 'index'=>true, 'position'=>1000), + 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>true, 'index'=>true, 'searchall'=>1, 'comment'=>'Reference of object'), + 'entity'=>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>true, 'index'=>true), + 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'searchall'=>1), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500), + 'status'=>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), ); // END MODULEBUILDER PROPERTIES diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 8c7da67b7ab76..3943e1b9314f4 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -226,7 +226,7 @@ public function __construct($db) // Example to declare a new Top Menu entry and its Left menu entry: /* BEGIN MODULEBUILDER TOPMENU */ - $this->menu[$r]=array( 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + $this->menu[$r++]=array('fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', // This is a Top menu entry 'titre'=>'MyModule', 'mainmenu'=>'mymodule', @@ -238,12 +238,12 @@ public function __construct($db) 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - // $r++; + /* END MODULEBUILDER TOPMENU */ // Example to declare a Left Menu entry into an existing Top menu entry: /* BEGIN MODULEBUILDER LEFTMENU MYOBJECT - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry 'titre'=>'List MyObject', 'mainmenu'=>'mymodule', @@ -255,8 +255,7 @@ public function __construct($db) 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=mymodule&fk_leftmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry 'titre'=>'New MyObject', 'mainmenu'=>'mymodule', @@ -268,7 +267,6 @@ public function __construct($db) 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; END MODULEBUILDER LEFTMENU MYOBJECT */ diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 9d1019affee4d..6430944bec735 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -123,7 +123,8 @@ $arrayfields=array(); foreach($object->fields as $key => $val) { - $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>1); + // If $val['visible']==0, then we never show the field + if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) From 7562412554d730b03659da48c7770477a338cc3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jul 2017 01:21:28 +0200 Subject: [PATCH 4/9] Minor fixes --- htdocs/langs/en_US/admin.lang | 2 +- htdocs/modulebuilder/index.php | 32 +++++++++++++------ .../template/class/myobject.class.php | 12 +++---- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a4de6f7470c03..9d897396036e7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1058,7 +1058,7 @@ RestoreDesc2=Restore archive file (zip file for example) of documents directory RestoreDesc3=Restore the data, from a backup dump file, into the database of the new Dolibarr installation or into the database of this current installation (%s). Warning, once restore is finished, you must use a login/password, that existed when backup was made, to connect again. To restore a backup database into this current installation, you can follow this assistant. RestoreMySQL=MySQL import ForcedToByAModule= This rule is forced to %s by an activated module -PreviousDumpFiles=Available database backup dump files +PreviousDumpFiles=Generated database backup files WeekStartOnDay=First day of week RunningUpdateProcessMayBeRequired=Running the upgrade process seems to be required (Programs version %s differs from database version %s) YouMustRunCommandFromCommandLineAfterLoginToUser=You must run this command from command line after login to a shell with user %s or you must add -W option at end of command line to provide %s password. diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 18d543c79330b..239126b061ecf 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1229,11 +1229,13 @@ print $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")); print ''; print ''.$langs->trans("Type").''; - print ''.$langs->trans("Position").''; print ''.$langs->trans("NotNull").''; - print ''.$langs->trans("SearchAll").''; //print ''.$langs->trans("DefaultValue").''; print ''.$langs->trans("DatabaseIndex").''; + print ''.$langs->trans("Enabled").''; + print ''.$langs->trans("Visible").''; + print ''.$langs->trans("Position").''; + print ''.$langs->trans("SearchAll").''; print ''.$langs->trans("Comment").''; print ''; print ''; @@ -1241,11 +1243,13 @@ print ''; print ''; print ''; - print ''; print ''; - print ''; //print ''; print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -1277,6 +1281,8 @@ $propsearchall=$propval['searchall']; //$propdefault=$propval['default']; $propindex=$propval['index']; + $propenabled=$propval['enabled']; + $propvisible=$propval['visible']; $propcomment=$propval['comment']; print ''; @@ -1290,21 +1296,27 @@ print ''; print $proptype; print ''; - print ''; - print $propposition; - print ''; print ''; print $propnotnull?'X':''; print ''; - print ''; - print $propsearchall?'X':''; - print ''; /*print ''; print $propdefault; print '';*/ print ''; print $propindex?'X':''; print ''; + print ''; + print $propenabled?$propenabled:''; + print ''; + print ''; + print $propvisible?$propvisible:''; + print ''; + print ''; + print $propposition; + print ''; + print ''; + print $propsearchall?'X':''; + print ''; print ''; print $propcomment; print ''; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index a68e0ff0da563..a371d5fad8a5d 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -63,12 +63,12 @@ class MyObject extends CommonObject * @var array Array with all fields and their property */ public $fields=array( - 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>true, 'index'=>true, 'searchall'=>1, 'comment'=>'Reference of object'), - 'entity'=>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>true, 'index'=>true), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'searchall'=>1), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500), - 'status'=>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), + 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>true, 'index'=>true, 'visible'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + 'entity'=>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>true, 'index'=>true, 'visible'=>0, 'position'=>20), + 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'visible'=>1, 'searchall'=>1), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'visible'=>-1, 'position'=>500), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'visible'=>-1, 'position'=>500), + 'status'=>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'visible'=>1, 'position'=>1000), ); // END MODULEBUILDER PROPERTIES From 5207b84e8b993200275705ad1e09b7b5cf34ddcb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jul 2017 01:56:38 +0200 Subject: [PATCH 5/9] Fix compatibility with indian IGST/CSGST/SGST --- htdocs/admin/dict.php | 6 +++--- htdocs/compta/facture/card.php | 2 +- htdocs/install/mysql/data/llx_c_tva.sql | 11 +++++++---- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 3 +++ htdocs/langs/en_IN/main.lang | 4 ++++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 72888a8deb303..ae26dce060d49 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -249,7 +249,7 @@ $tabfield[7] = "code,libelle,country,accountancy_code,deductible"; $tabfield[8] = "code,libelle,country_id,country".(! empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?',position':''); $tabfield[9] = "code,label,unicode"; -$tabfield[10]= "country_id,country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; +$tabfield[10]= "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11]= "element,source,code,libelle,position"; $tabfield[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder"; $tabfield[13]= "code,libelle,type,accountancy_code"; @@ -286,7 +286,7 @@ $tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible"; $tabfieldvalue[8] = "code,libelle,country".(! empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?',position':''); $tabfieldvalue[9] = "code,label,unicode"; -$tabfieldvalue[10]= "country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; +$tabfieldvalue[10]= "country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[11]= "element,source,code,libelle,position"; $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder"; $tabfieldvalue[13]= "code,libelle,type,accountancy_code"; @@ -323,7 +323,7 @@ $tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible"; $tabfieldinsert[8] = "code,libelle,fk_country".(! empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?',position':''); $tabfieldinsert[9] = "code_iso,label,unicode"; -$tabfieldinsert[10]= "fk_pays,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; +$tabfieldinsert[10]= "fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[11]= "element,source,code,libelle,position"; $tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder"; $tabfieldinsert[13]= "code,libelle,type,accountancy_code"; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 63b978a9e0462..d77f83cbb2eb2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1440,7 +1440,7 @@ { if (GETPOST('type') < 0 && ! GETPOST('search_idprod')) { - setEventMessages($langs->trans('ErrorChooseBetweenFreeAntryOrPredefinedProduct'), null, 'errors'); + setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors'); $error ++; } } diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 3b401abd37d82..7f9c5f97ea4e5 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -133,10 +133,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 3 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '0','0','VAT Rate 0',1); -- INDIA (id country=117) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',0); + +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST+CGST', 8, 8, '1', 0, '0', 0, 'IGST+CGST', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST', 0, 0, '0', 16, '1', 0, 'SGST', 1); -- IRELAND (id country=8) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1); diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 386ae96850506..43f4162e9cbcc 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -577,3 +577,6 @@ ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); + +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST-CGST', 8, 8, '1', 0, '0', 0, 'IGST-CGST', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST', 0, 0, '0', 16, '1', 0, 'SGST', 1); diff --git a/htdocs/langs/en_IN/main.lang b/htdocs/langs/en_IN/main.lang index 80f13de139f96..13a90b526c49e 100644 --- a/htdocs/langs/en_IN/main.lang +++ b/htdocs/langs/en_IN/main.lang @@ -24,3 +24,7 @@ LinkToProposal=Link to quotation LinkToSupplierProposal=Link to supplier quotation SearchIntoCustomerProposals=Customer quotations SearchIntoSupplierProposals=Supplier quotations + +AmountVAT=Amount tax IGST +AmountLT1=Amount tax CGST +AmountLT2=Amount tax SGST From e36911360b76052bc6c4714e87e2696dafd9ecfd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jul 2017 02:22:16 +0200 Subject: [PATCH 6/9] Update changelog --- ChangeLog | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9cd6f11d1b8b4..cdbd8ce4b9504 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,10 +4,126 @@ English Dolibarr ChangeLog ***** ChangeLog for 6.0.0 compared to 5.0.* ***** +NEW: Add experimental BlockeLog module (to log business events in a non reversible log file). +NEW: Add a payment module for Stripe. +NEW: Add module "Product variant" (like red, blue for the product shoes) +NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC) +NEW: Add a tracking id into mass emailing. +NEW: Add calculation function for Loan schedule +NEW: Add "depends on" and "required by" into module informations +NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO +NEW: Add key __USERID__ and __ENTITYID__ as key for dynamic filters. +NEW: Add last activation author and ip of modules +NEW: Add mass actions (pdf merge and delete) for interventions +NEW: Add module resources import/export +NEW: Add option PROJECT_THIRDPARTY_REQUIRED +NEW: Add page statistics for project tasks +NEW: add property to show warnings when activating modules +NEW: add rapport file for supplier paiement +NEW: Add statistics on supplier tab. +NEW: Add tooltip help on shipment weight and volume calculation +NEW: An external module can hook and add mass actions +NEW: Better reponsive design +NEW: Bookmarks are into a combo list. +NEW: Bulk actions available on supplier orders +NEW: Can add a background image on login page +NEW: Can change customer from POS +NEW: Can clone expense report on another user +NEW: Can control constants values into file integrity checker +NEW: Can define default values for create forms. +NEW: Can define default filters for list pages. +NEW: Can define default sort order for list pages. +NEW: Can deploy an external module from the module setup area. +NEW: Can disable all overwrote translations in one click. +NEW: Can edit background color for odd and even lines in tables +NEW: Can filter on code in dictionnaries +NEW: Can filter on year and product tags on the product statistic page +NEW: Can import users +NEW: Can read time spent of others (hierarchy only or all if granted) +NEW: Can send an email to a user from its card. +NEW: Can send email to multiple destinaries from the mailform combo list. +NEW: Can set margins of PDFs +NEW: Can set number of dump to keep with job "local database backup" +NEW: Can sort customer balance summary on date. +NEW: Can sort thumbs visible on product card. +NEW: Can use a credit note into a "down payment/deposit". +NEW: Can use dol_fiche_end without showing bottom border. +NEW: Can use translations into all substitutions (watermark, freetext...) +NEW: Change to allow a specific numbering rule for invoice with POS module. +NEW: convert exceiss received to reduc +NEW: custom dir is enabled dy default on first install. +NEW: Description of feature of a module visible into a dedicated popup. +NEW: Direct open of card after a search if one record only found. +NEW: download button +NEW: Enable bulk actions delete on supplier invoices. +NEW: Extrafields support formulas to be computed using PHP expressions. +NEW: Feature to crop/resize images available on user and expense reports. +NEW: Filechecker can include custom dir and report added files. +NEW: fix listview class and add a demo for product list +NEW: [FP17] Accountancy - Add select field in list of accounts +NEW: get amount base on hourly rate for ficheinter +NEW: hidden Easter egg to display commitstrip strip on login page +NEW: Include an hourglass icon when we click on online payment button +NEW: Index upload files into database. +NEW: Introduce mass action on product list ('delete' for the moment) +NEW: Introduce mass actions on contacts +NEW: Introduce option MAIN_HTTP_CONTENT_SECURITY_POLICY +NEW: It's easier to switch between sandbox and live for paypal +NEW: Mass action delete available on project and tasks +NEW: Move login information on home page into a widget +NEW: new demo entry page +NEW: No external check of version without explicit click in about page. +NEW: ODT docs for USER USERGROUP CONTRACT and PRODUCT class +NEW: odt usergroup +NEW: On invoices generated by template, we save if invoice come from a source template. +NEW: option to copy into attachement files of events, files send by mail (with auto event creation) +NEW: PDF with numbertoword +NEW: Permit multiple file upload in linked documents +NEW: PHP 7.1 compatibility +NEW: Reduce memory usage by removing deprecated constant loading. +NEW: Report page and menu for suppliers paiements +NEW: Show by default README.md file found into root dir of ext module. +NEW: Show company into combo list of projects +NEW: show files in the bank statement + download +NEW: Show local taxes in facture list +NEW: Show local taxes in supplier facture list +NEW: Small PDF template for products +NEW: Option SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT +NEW: The substitution keys available for emailing edition are now visible into a popup. +NEW: Uniformize behaviour: Action to make order is an action button. +NEW: Use autocompletion on the "Add widget list". +NEW: Use html5 type "number" on select field for year and duration. +NEW: Can use pdktk to concat mass pdf because tcpdf generate avoid to split large file into multiple smaller file (all have same size) encounter issue with mailer provider virtual delivery service +NEW: Default theme of v6 is cleaner. +NEW: When down payment is entered, discount to reuse into final invoice is automatically created. This save one click into invoice workflow. +NEW: Add UI to configure MEMBER_NEWFORM_FORCETYPE +NEW: #2763 Go to document block after clicking in Generate document button +NEW: #6280: Generate PDF after creating an invoice from a customer order +NEW: #6915 Simplest change. +NEW: Uniformize the look and feel with v6 new look. + For developers: NEW: Add a lot of API REST: dictionaryevents, memberstypes, ... NEW: Big refactorization of multicompany transverse mode. NEW: getEntity function use true $shared value by default. +NEW: Add font-awesome css. +NEW: Add function ajax_autoselect +NEW: Add function dolMd2Html +NEW: Add hook doUpgrade2 +NEW: Add hook "formatNotificationMessage" +NEW: Add index and constraints keys on supplier proposal detail table +NEW: Add phpunit to check the engine is defined into sql create files. +NEW: Add project and Hook to Loan +NEW: Add REST API to push a file. +NEW: Allow extrafields list select to be dependands on other standard list and not only other extrafields list +NEW: Architecture to manage search criteria persistance (using save_lastsearch_values=1 on exit links and restore_lastsearch_values=1 in entry links) +NEW: data files are now also parsed by phpunit for sql syntax +NEW: Hook to allow inserting custom product head #6001 +NEW: Introduce fields that can be computed during export in export profiles. +NEW: Introduce function dol_compress_dir +NEW: Removed commande_pdf_create, contract_pdf_create,expedition_pdf_create, facture_pdf_create, delivery_order_pdf_create, task_pdf_create, project_pdf_create, propale_pdf_create, supplier_invoice_pdf_create, supplier_order_pdf_create, supplier_proposal_pdf_create deprecated functions +NEW: tooltip can be on hover or on click with textwithpicto function. +NEW: Upgrade jquery to 3.3.1 and jquery-ui to 1.12 WARNING: From a0d9890c999574770e5a3443987b677831678693 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jul 2017 02:31:06 +0200 Subject: [PATCH 7/9] Fix packager --- build/makepack-dolibarr.pl | 4 +++- htdocs/modulebuilder/template/class/api_myobject.class.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c2d983653cb33..46eff3e8dc60b 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -972,9 +972,11 @@ $ret=`$cmd`; $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/actions_mymodule.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_myobject.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject_api_class.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindes.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`; $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/myobject.php`; diff --git a/htdocs/modulebuilder/template/class/api_myobject.class.php b/htdocs/modulebuilder/template/class/api_myobject.class.php index 44e2dd2fcc4ce..e3e38cefd3802 100644 --- a/htdocs/modulebuilder/template/class/api_myobject.class.php +++ b/htdocs/modulebuilder/template/class/api_myobject.class.php @@ -19,7 +19,7 @@ use Luracast\Restler\RestException; /** - * \file htdocs/modulebuilder/template/class/myobject_api_class.class.php + * \file htdocs/modulebuilder/template/class/api_myobject.class.php * \ingroup mymodule * \brief File for API management of myobject. */ From e0f07694050d0a338beeb0cb555b48f417d6ae86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jul 2017 02:31:33 +0200 Subject: [PATCH 8/9] Fix packager --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 46eff3e8dc60b..41b54022ee419 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -976,7 +976,7 @@ $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_myobject.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindes.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindex.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`; $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/myobject.php`; From 4803f2d29acc5a0afd4afa57de6889f6f15b5bd6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Jul 2017 11:26:25 +0200 Subject: [PATCH 9/9] Fix package v6 --- build/rpm/dolibarr_fedora.spec | 1 + build/rpm/dolibarr_generic.spec | 1 + build/rpm/dolibarr_mandriva.spec | 1 + build/rpm/dolibarr_opensuse.spec | 1 + 4 files changed, 4 insertions(+) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 33dc951309d81..55898481691eb 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -162,6 +162,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/api %_datadir/dolibarr/htdocs/asterisk %_datadir/dolibarr/htdocs/barcode +%_datadir/dolibarr/htdocs/blockedlog %_datadir/dolibarr/htdocs/bookmarks %_datadir/dolibarr/htdocs/cashdesk %_datadir/dolibarr/htdocs/categories diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 42a89675abf28..e5b346278ab5d 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -242,6 +242,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/api %_datadir/dolibarr/htdocs/asterisk %_datadir/dolibarr/htdocs/barcode +%_datadir/dolibarr/htdocs/blockedlog %_datadir/dolibarr/htdocs/bookmarks %_datadir/dolibarr/htdocs/cashdesk %_datadir/dolibarr/htdocs/categories diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 9dd2100b02c33..04a3138d9f921 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -159,6 +159,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/api %_datadir/dolibarr/htdocs/asterisk %_datadir/dolibarr/htdocs/barcode +%_datadir/dolibarr/htdocs/blockedlog %_datadir/dolibarr/htdocs/bookmarks %_datadir/dolibarr/htdocs/cashdesk %_datadir/dolibarr/htdocs/categories diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index d780c47da9962..c77661fe42035 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -170,6 +170,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/api %_datadir/dolibarr/htdocs/asterisk %_datadir/dolibarr/htdocs/barcode +%_datadir/dolibarr/htdocs/blockedlog %_datadir/dolibarr/htdocs/bookmarks %_datadir/dolibarr/htdocs/cashdesk %_datadir/dolibarr/htdocs/categories