';
diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php
index b2f839e3c3c..627d96acf17 100644
--- a/htdocs/adherents/admin/adherent_type_extrafields.php
+++ b/htdocs/adherents/admin/adherent_type_extrafields.php
@@ -7,7 +7,7 @@
*
* 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
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -17,6 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
+ * or see http://www.gnu.org/
*/
/**
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index ca7706989e0..102f45496c6 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -723,7 +723,7 @@ else
{
/* ************************************************************************** */
/* */
- /* Fiche creation */
+ /* Creation card */
/* */
/* ************************************************************************** */
$object->canvas=$canvas;
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index a057e7cba93..cdbfabf4576 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -5,6 +5,7 @@
* Copyright (C) 2004 Sebastien Di Cintio
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2009-2012 Regis Houssin
+ * Copyright (C) 2014 Alexandre Spangaro
*
* 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
@@ -124,7 +125,7 @@ class Adherent extends CommonObject
/**
- * Fonction envoyant un email a l'adherent avec le texte fourni en parametre.
+ * Function sending an email has the adherent with the text supplied in parameter.
*
* @param string $text Content of message (not html entities encoded)
* @param string $subject Subject of message
@@ -247,9 +248,9 @@ class Adherent extends CommonObject
/**
- * Renvoie le libelle traduit de la nature d'un adherent (physique ou morale)
+ * Return translated label by the nature of a adherent (physical or moral)
*
- * @param string $morphy Nature physique ou morale de l'adherent
+ * @param string $morphy Nature of the adherent (physical or moral)
* @return string Label
*/
function getmorphylib($morphy='')
diff --git a/htdocs/compta/prelevement/bon.php b/htdocs/compta/prelevement/bon.php
deleted file mode 100644
index 20d60c3a55b..00000000000
--- a/htdocs/compta/prelevement/bon.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- * Copyright (C) 2005 Laurent Destailleur
- * Copyright (C) 2010-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
- * the Free Software Foundation; either version 3 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 .
- */
-
-/**
- * \file htdocs/compta/prelevement/bon.php
- * \ingroup prelevement
- * \brief Fiche apercu du bon de prelevement
- */
-
-require('../../main.inc.php');
-require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
-require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
-
-$langs->load("banks");
-$langs->load("categories");
-$langs->load("bills");
-$langs->load("categories");
-
-// Security check
-$socid=0;
-$id = GETPOST('id','int');
-$ref = GETPOST('ref','alpha');
-if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'prelevement', $id);
-
-
-llxHeader('','Bon de prelevement');
-
-$form = new Form($db);
-
-if ($id > 0 || ! empty($ref))
-{
- $object = new BonPrelevement($db,"");
-
- if ($object->fetch($id) == 0)
- {
- $head = prelevement_prepare_head($object);
- dol_fiche_head($head, 'preview', 'Prelevement : '. $object->ref);
-
- print '
\n";
+
print "\n";
$i++;
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index ad9149d48b0..a9c39fa790f 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -609,6 +609,8 @@ abstract class CommonObject
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0;
+ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
+
$thirdparty = new Societe($this->db);
$result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty));
$this->client = $thirdparty; // deprecated
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index db24d257aee..94898ec5452 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -157,7 +157,7 @@ class ExtraFields
{
$table=$elementtype.'_extrafields';
- if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
+ if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9_]*$/",$attrname) && ! is_numeric($attrname))
{
if ($type=='boolean') {
$typedb='int';
@@ -752,15 +752,17 @@ class ExtraFields
if (strpos($InfoFieldList[4], 'extra')!==false)
{
$sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra';
- $sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
+ $sqlwhere.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
}
else
{
- $sqlwhere.= ' AND '.$InfoFieldList[4];
+ $sqlwhere.= ' WHERE '.$InfoFieldList[4];
}
+ }else {
+ $sqlwhere.= ' WHERE 1';
}
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.
- $sql.=preg_replace('/^ AND /','',$sqlwhere);
+ //$sql.=preg_replace('/^ AND /','',$sqlwhere);
//print $sql;
dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
@@ -988,7 +990,10 @@ class ExtraFields
{
foreach ($fields_label as $field_toshow)
{
- $translabel=$langs->trans($obj->$field_toshow);
+ $translabel='';
+ if (!empty($obj->$field_toshow)) {
+ $translabel=$langs->trans($obj->$field_toshow);
+ }
if ($translabel!=$field_toshow) {
$value.=dol_trunc($translabel,18).' ';
}else {
@@ -998,7 +1003,10 @@ class ExtraFields
}
else
{
- $translabel=$langs->trans($obj->$InfoFieldList[1]);
+ $translabel='';
+ if (!empty($obj->$InfoFieldList[1])) {
+ $translabel=$langs->trans($obj->$InfoFieldList[1]);
+ }
if ($translabel!=$obj->$InfoFieldList[1]) {
$value=dol_trunc($translabel,18);
}else {
diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php
index bce8d9f041e..4de88a7bfc9 100644
--- a/htdocs/core/class/html.formcron.class.php
+++ b/htdocs/core/class/html.formcron.class.php
@@ -4,7 +4,7 @@
*
* 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
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -14,6 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
+ * or see http://www.gnu.org/
*/
/**
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index 26506360e66..db88671f7ff 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -1,6 +1,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2014 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
@@ -173,7 +174,7 @@ class Notify
// Check notification per third party
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,";
- $sql.= " a.rowid as adid, a.label, a.code, n.rowid";
+ $sql.= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
@@ -292,8 +293,8 @@ class Notify
if ($mailfile->sendfile())
{
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, objet_type, objet_id, email)";
- $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", ".$obj->cid.", '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)";
+ $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')";
if (! $this->db->query($sql))
{
dol_print_error($this->db);
@@ -421,8 +422,8 @@ class Notify
if ($mailfile->sendfile())
{
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, objet_type, objet_id, email)";
- $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", null, '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)";
+ $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", null, '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')";
if (! $this->db->query($sql))
{
dol_print_error($this->db);
diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php
index ccc115b5b1d..866cf004ca6 100644
--- a/htdocs/core/lib/invoice2.lib.php
+++ b/htdocs/core/lib/invoice2.lib.php
@@ -2,19 +2,20 @@
/*
* Copyright (C) 2009-2013 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
-* 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 .
-*/
+ * 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 3 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 .
+ * or see http://www.gnu.org/
+ */
/**
* \file htdocs/core/lib/invoice2.lib.php
diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php
index 257f13558ee..53f54d66f70 100644
--- a/htdocs/core/lib/prelevement.lib.php
+++ b/htdocs/core/lib/prelevement.lib.php
@@ -44,14 +44,6 @@ function prelevement_prepare_head($object)
$head[$h][2] = 'prelevement';
$h++;
- if (! empty($conf->global->MAIN_USE_PREVIEW_TABS))
- {
- $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$object->id;
- $head[$h][1] = $langs->trans("Preview");
- $head[$h][2] = 'preview';
- $h++;
- }
-
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$object->id;
$head[$h][1] = $langs->trans("Lines");
$head[$h][2] = 'lines';
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 6d9842a46a6..984bc809a75 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -961,7 +961,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->accounting->enabled))
{
$newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy", $langs->trans("Fiscalyear"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
- $newmenu->add("/accountancy/admin/account.php?mainmenu=home", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
+ $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->chartofaccount, '', $mainmenu, 'chartofaccount');
}
}
diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php
index 38996c7e6f0..464a01120ec 100644
--- a/htdocs/core/modules/action/rapport.pdf.php
+++ b/htdocs/core/modules/action/rapport.pdf.php
@@ -210,6 +210,7 @@ class CommActionRapport
$sql.= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid";
$sql.= " AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($this->year,$this->month,false))."'";
$sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'";
+ $sql.= " AND a.entity = ".$conf->entity;
$sql.= " ORDER BY a.datep DESC";
$eventstatic=new ActionComm($this->db);
diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php
index 9a544b1ece0..e074bfe82f1 100644
--- a/htdocs/core/modules/modAccounting.class.php
+++ b/htdocs/core/modules/modAccounting.class.php
@@ -229,6 +229,14 @@ class modAccounting extends DolibarrModules
$this->rights[$r][4] = 'fiscalyear';
$this->rights[$r][5] = '';
$r++;
+
+ $this->rights[$r][0] = 50440;
+ $this->rights[$r][1] = 'Manage chart of accounts';
+ $this->rights[$r][2] = 'r';
+ $this->rights[$r][3] = 1;
+ $this->rights[$r][4] = 'chartofaccount';
+ $this->rights[$r][5] = '';
+ $r++;
// Main menu entries
$this->menus = array();
diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
index aedc870560f..7440a357ea8 100644
--- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
+++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
@@ -90,11 +90,12 @@ class modGeneratePassPerso extends ModeleGenPassword
$this->NbRepeat = $tabConf[4];
$this->WithoutAmbi = $tabConf[5];
- if($this->WithoutAmbi){
- $this->Maj = str_replace($this->Ambi,"",$this->Maj );
- $this->Min = str_replace($this->Ambi,"",$this->Min );
- $this->Nb = str_replace($this->Ambi,"",$this->Nb );
- $this->Spe = str_replace($this->Ambi,"",$this->Spe );
+ if ($this->WithoutAmbi)
+ {
+ $this->Maj = str_replace($this->Ambi,"",$this->Maj);
+ $this->Min = str_replace($this->Ambi,"",$this->Min);
+ $this->Nb = str_replace($this->Ambi,"",$this->Nb);
+ $this->Spe = str_replace($this->Ambi,"",$this->Spe);
}
$this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe);
@@ -148,11 +149,13 @@ class modGeneratePassPerso extends ModeleGenPassword
$pass .= $this->All[rand(0,strlen($this->All) -1)];
}
- $pass = str_shuffle($pass) ;
+ $pass = str_shuffle($pass);
- if($this->validatePassword($pass)) {
+ if ($this->validatePassword($pass))
+ {
return $pass;
}
+
return $this->getNewGeneratedPassword();
}
diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php
index d344ef5eb82..ee2a8695f3a 100644
--- a/htdocs/core/tpl/extrafields_view.tpl.php
+++ b/htdocs/core/tpl/extrafields_view.tpl.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2014 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
@@ -48,7 +49,9 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print '