diff --git a/ChangeLog b/ChangeLog index b6ecd3577e11d05c7fd37488c63a0e33a9ae6ab4..b8e4affd67dc74758708c6fa0fcfad24dcefeb8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ English Dolibarr ChangeLog For users: - New: If field "signature" is filled into user table, text is added at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this - feautre is disabled. + feature is disabled. - New: Add link "Back to list" on all cards. - New: After first install, warning are visible onto mandatory setup not configured. Show also total number of activated modules. @@ -67,6 +67,7 @@ For developers: action/calendar, trips and expenses, dons, vat payment, contact/society, contract, product lines, expedition, order supplier and order invoice (lines included), intervention card, project, tasks. - New: Add ChromePHP output into syslog module. +- New: Add PRODUCT_PRICE_MODIFY trigger. For translators: - New: Update language files (de, tr, pt, ca, es, en, fr). diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 3f48539c8c55499023bc622fba884d9a38da0a3a..6107560d65672707b95108e48cf60bc971b5cd92 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -84,6 +84,7 @@ class modMyModule extends DolibarrModules // 'css' => array('/mymodule/css/mymodule.css.php'), // Set this to relative path of css file if module has its own css file // 'js' => array('/mymodule/js/mymodule.js'), // Set this to relative path of js file if module must load a js on all pages // 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module + // 'dir' => array('output' => 'othermodulename'), // To force the default directories names // 'workflow' => array('WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2'=>array('enabled'=>'! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)', 'picto'=>'yourpicto@mymodule')) // Set here all workflow context managed by module // ); $this->module_parts = array(); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 514d6e06cad822cd79a9137cccb793c8427aeea4..2485e26e15de957f189461637f6b157136341013 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -52,7 +52,7 @@ class Conf public $smart_menu; public $modules = array(); // List of activated modules - public $modules_parts = array('css'=>array(), 'js'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'hooks'=>array()); // List of modules parts + public $modules_parts = array('css'=>array(), 'js'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'hooks'=>array(),'dir'=>array()); // List of modules parts // TODO Remove thoose arrays with generic module_parts public $tabs_modules = array(); @@ -258,6 +258,7 @@ class Conf // Define default dir_output and dir_temp for directories of modules foreach($this->modules as $module) { + // For multicompany sharings $this->$module->multidir_output = array($this->entity => $rootfordata."/".$module); $this->$module->multidir_temp = array($this->entity => $rootfordata."/".$module."/temp"); // For backward compatibility @@ -265,6 +266,24 @@ class Conf $this->$module->dir_temp = $rootfordata."/".$module."/temp"; } + // External modules storage + if (! empty($this->modules_parts['dir'])) + { + foreach($this->modules_parts['dir'] as $module => $dirs) + { + foreach($dirs as $type => $name) + { + $subdir=($type=='temp'?'/temp':''); + // For multicompany sharings + $varname = 'multidir_'.$type; + $this->$module->$varname = array($this->entity => $rootfordata."/".$name.$subdir); + // For backward compatibility + $varname = 'dir_'.$type; + $this->$module->$varname = $rootfordata."/".$name.$subdir; + } + } + } + // For mycompany storage $this->mycompany->dir_output=$rootfordata."/mycompany"; $this->mycompany->dir_temp=$rootfordata."/mycompany/temp"; diff --git a/htdocs/document.php b/htdocs/document.php index 0fa3f3d4d8f63a8ef9fec4afb7965496fa1a59d0..910456aca7e9e774be55832ce2cf84604d389727 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -285,16 +285,6 @@ if ($modulepart) $original_file=$conf->contrat->dir_output.'/'.$original_file; } - // Wrapping pour les documents generaux - else if ($modulepart == 'ged') - { - if ($user->rights->document->lire) - { - $accessallowed=1; - } - $original_file= $conf->ged->dir_output.'/'.$original_file; - } - // Wrapping pour les dons else if ($modulepart == 'donation') { @@ -390,6 +380,12 @@ if ($modulepart) // Generic wrapping else { + // For dir temp + $dir_temp=false; + if (preg_match('/\_temp$/i', $modulepart)) { + $modulepart = str_replace('_temp', '', $modulepart); + $dir_temp=true; + } // Define $accessallowed if (($user->rights->$modulepart->lire) || ($user->rights->$modulepart->read) || ($user->rights->$modulepart->download)) $accessallowed=1; // No subpermission, we have checked on main permission elseif (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen @@ -407,7 +403,9 @@ if ($modulepart) } // Define $original_file - $original_file=$conf->$modulepart->dir_output.'/'.$original_file; + $dir = $conf->$modulepart->dir_output; + if ($dir_temp) $dir = $conf->$modulepart->dir_temp; + $original_file = $dir.'/'.$original_file; // Define $sqlprotectagainstexternals for modules who want to protect access using a SQL query. $sqlProtectConstName = strtoupper($modulepart).'_SQLPROTECTAGAINSTEXTERNALS_FOR_DOCUMENTS'; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 62365027f6df603cb79bd571c1399b8febe7cf38..0d80a5bbc7b92591df480db88fc9be0c12deb32d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1027,6 +1027,16 @@ class Product extends CommonObject $this->localtax2_tx = $localtax2; $this->_log_price($user,$level); + + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('PRODUCT_PRICE_MODIFY',$this,$user,$langs,$conf); + if ($result < 0) + { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers } else {