Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2015-07-12 12:31:37 +02:00
commit 39a9b41c42
6 changed files with 80 additions and 62 deletions

View File

@ -89,7 +89,6 @@ class Skeleton_Class extends CommonObject
public function __construct(DoliDB $db) public function __construct(DoliDB $db)
{ {
$this->db = $db; $this->db = $db;
return 1; return 1;
} }

View File

@ -366,7 +366,7 @@ class CMailFile
*/ */
function sendfile() function sendfile()
{ {
global $conf; global $conf,$db;
$errorlevel=error_reporting(); $errorlevel=error_reporting();
error_reporting($errorlevel ^ E_WARNING); // Desactive warnings error_reporting($errorlevel ^ E_WARNING); // Desactive warnings
@ -375,6 +375,20 @@ class CMailFile
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) if (empty($conf->global->MAIN_DISABLE_ALL_MAILS))
{ {
dol_include_once('/core/class/hookmanager.class.php');
$hookmanager=new HookManager($db);
$hookmanager->initHooks(array('maildao'));
$reshook=$hookmanager->executeHooks('doactions',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (!empty($reshook))
{
$this->error="Error in hook maildao doactions ".$reshook;
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
return $reshook;
}
// Action according to choosed sending method // Action according to choosed sending method
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
{ {

View File

@ -3537,7 +3537,7 @@ class Form
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">'; $ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
$ret.='<tr><td>'; $ret.='<tr><td>';
$ret.=$this->select_date($selected,$htmlname,$displayhour,$displaymin,1,'form'.$htmlname); $ret.=$this->select_date($selected,$htmlname,$displayhour,$displaymin,1,'form'.$htmlname,1,0,1);
$ret.='</td>'; $ret.='</td>';
$ret.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; $ret.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
$ret.='</tr></table></form>'; $ret.='</tr></table></form>';

View File

@ -837,13 +837,13 @@ function unActivateModule($value, $requiredby=1)
} }
else else
{ {
// TODO Cannot instantiate abstract class // TODO Replace this afte DolibarrModules is moved as abstract class with a try catch to show module is bugged
//$genericMod = new DolibarrModul($db); $genericMod = new DolibarrModules($db);
//$genericMod->name=preg_replace('/^mod/i','',$modName); $genericMod->name=preg_replace('/^mod/i','',$modName);
//$genericMod->rights_class=strtolower(preg_replace('/^mod/i','',$modName)); $genericMod->rights_class=strtolower(preg_replace('/^mod/i','',$modName));
//$genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',$modName)); $genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',$modName));
dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName); dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName);
//$genericMod->_remove(); $genericMod->_remove();
} }
// Desactivation des modules qui dependent de lui // Desactivation des modules qui dependent de lui

View File

@ -257,6 +257,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
global $conf,$langs,$db; global $conf,$langs,$db;
global $bc; global $bc;
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
$formother = new FormOther($db); $formother = new FormOther($db);
//$dirthemes=array(empty($conf->global->MAIN_FORCETHEMEDIR)?'/theme':$conf->global->MAIN_FORCETHEMEDIR.'/theme'); //$dirthemes=array(empty($conf->global->MAIN_FORCETHEMEDIR)?'/theme':$conf->global->MAIN_FORCETHEMEDIR.'/theme');

View File

@ -199,7 +199,10 @@ abstract class DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
abstract public function __construct($db); //public function __construct($db);
// We should but can't set this as abstract because this will make dolibarr hang
// after migration due to old module not implementing. We must wait PHP is able to make
// a try catch on Fatal error to manage this correctly.
/** /**
* Enables a module. * Enables a module.