Prepare 3.1 beta

This commit is contained in:
Laurent Destailleur 2011-07-13 21:19:58 +00:00
parent 2c98e8a581
commit 8113a64483
4 changed files with 20 additions and 23 deletions

View File

@ -22,7 +22,7 @@
* \file htdocs/core/class/html.formmail.class.php
* \ingroup core
* \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire
* \version $Id: html.formmail.class.php,v 1.33 2011/07/13 22:18:12 eldy Exp $
* \version $Id: html.formmail.class.php,v 1.32 2011/07/13 16:55:25 eldy Exp $
*/
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
@ -505,7 +505,7 @@ class FormMail
$out.= '<tr>';
$out.= '<td width="180">'.$langs->trans("MailFile").'</td>';
$out.= '<td>';
// TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
// FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
$out.= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n";
$out.= '<script type="text/javascript" language="javascript">';
$out.= 'jQuery(document).ready(function () {';

View File

@ -20,7 +20,7 @@
/**
* \file htdocs/core/class/menubase.class.php
* \ingroup core
* \version $Id: menubase.class.php,v 1.25 2011/07/13 22:18:48 eldy Exp $
* \version $Id$
* \brief File of class to manage dynamic menu entries
* \remarks Initialy built by build_class_from_table on 2008-01-12 14:19
*/
@ -78,7 +78,7 @@ class Menubase
* @param user User that create
* @return int <0 if KO, Id of record if OK
*/
function create($user=0)
function create($user)
{
global $conf, $langs;

View File

@ -24,7 +24,7 @@
/**
* \file htdocs/includes/modules/DolibarrModules.class.php
* \brief Fichier de description et activation des modules Dolibarr
* \version $Id: DolibarrModules.class.php,v 1.161 2011/07/13 22:15:19 eldy Exp $
* \version $Id: DolibarrModules.class.php,v 1.159 2011/06/28 20:31:23 eldy Exp $
*/
@ -926,7 +926,7 @@ class DolibarrModules
/**
* Insert permissions definitions related to the module into llx_rights_def
* @param $reinitadminperms If 1, we also grant them to all admin users
* @param $reinitadminperms If 1, we also grant them to admin user
* @return int Number of error (0 if OK)
*/
function insert_permissions($reinitadminperms=0)
@ -955,7 +955,7 @@ class DolibarrModules
{
$r_id = $this->rights[$key][0];
$r_desc = $this->rights[$key][1];
$r_type = isset($this->rights[$key][2])?$this->rights[$key][2]:'';
$r_type = $this->rights[$key][2];
$r_def = $this->rights[$key][3];
$r_perms = $this->rights[$key][4];
$r_subperms = isset($this->rights[$key][5])?$this->rights[$key][5]:'';
@ -1004,15 +1004,12 @@ class DolibarrModules
}
// If we are into a logged session and we are an admin user, we take permission of new activated module
if ($reinitadminperms)
if ($reinitadminperms && ! empty($user->admin))
{
if (! empty($user->admin)) // FIXME. We must loop on each admin records and make grant on each fuser object. We must removed global $user.
{
$user->addrights($r_id);
// We reload permissions
$user->clearrights();
$user->getrights();
}
$user->addrights($r_id);
// We reload permissions
$user->clearrights();
$user->getrights();
}
}
}
@ -1059,6 +1056,8 @@ class DolibarrModules
*/
function insert_menus()
{
global $user;
require_once(DOL_DOCUMENT_ROOT."/core/class/menubase.class.php");
$err=0;
@ -1119,7 +1118,7 @@ class DolibarrModules
if (! $err)
{
$result=$menu->create();
$result=$menu->create($user);
if ($result > 0)
{
$this->menu[$key]['rowid']=$result;

View File

@ -20,7 +20,7 @@
/**
* \file htdocs/lib/files.lib.php
* \brief Library for file managing functions
* \version $Id: files.lib.php,v 1.69 2011/07/13 21:33:38 eldy Exp $
* \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $
*/
/**
@ -590,13 +590,12 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
* @param disableglob Disable usage of glob like *
* @param nophperrors Disable all PHP output errors
* @param notrigger Disable all triggers
* @param triggercode Code of trigger
* @param object Object for trigger
* @return boolean True if file is deleted, False if error
*/
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$triggercode='FILE_DELETE',$object=null)
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0)
{
global $db, $conf, $user, $langs;
global $conf, $user, $langs;
global $object;
//print "x".$file." ".$disableglob;
$ok=true;
@ -612,13 +611,12 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$trigg
dol_syslog("Removed file ".$filename,LOG_DEBUG);
if (! $notrigger)
{
if (! is_object($object)) $object=(object) 'dummy';
$object->src_file=$file;
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($db);
$result=$interface->run_triggers($triggercode,$object,$user,$langs,$conf);
$result=$interface->run_triggers('FILE_DELETE',$object,$user,$langs,$conf);
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
}