';
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..f8a36c4f71a 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -70,7 +70,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($rowid);
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
-$objcanvas='';
+$objcanvas=null;
if (! empty($canvas))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
@@ -79,7 +79,7 @@ if (! empty($canvas))
}
// Security check
-$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas);
+$result=restrictedArea($user, 'adherent', $rowid, '', '', 'fk_soc', 'rowid', $objcanvas);
if ($rowid > 0)
{
@@ -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..714fd2af3ca 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='')
@@ -464,8 +465,11 @@ class Adherent extends CommonObject
$nbrowsaffected+=$this->db->affected_rows($resql);
+ $action='update';
+
// Actions on extra fields (by external module)
- $hookmanager->initHooks(array('memberdao'));
+ // FIXME le hook fait double emploi avec le trigger !!
+ $hookmanager->initHooks(array('memberdao'));
$parameters=array('id'=>$this->id);
$action='';
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php
index c81366bc5e9..ac0fe715c99 100644
--- a/htdocs/admin/dons.php
+++ b/htdocs/admin/dons.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2005-2010 Laurent Destailleur
* Copyright (C) 2012-2013 Juanjo Menent
* Copyright (C) 2013 Philippe Grand
- * Copyright (C) 2014 Alexandre Spangaro
+ * 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
@@ -37,6 +37,8 @@ $typeconst=array('yesno','texte','chaine');
$action = GETPOST('action','alpha');
+$type='donation';
+
/*
* Action
@@ -135,7 +137,7 @@ else if ($action == 'setart200') {
$res = dolibarr_set_const($db, "DONATION_ART200", $setart200, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
-
+
if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
} else {
@@ -147,7 +149,7 @@ else if ($action == 'setart238') {
$res = dolibarr_set_const($db, "DONATION_ART238", $setart238, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
-
+
if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
} else {
@@ -159,7 +161,7 @@ else if ($action == 'setart885') {
$res = dolibarr_set_const($db, "DONATION_ART885", $setart885, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
-
+
if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
} else {
@@ -183,7 +185,7 @@ print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup');
* Params
*/
print_titre($langs->trans("Options"));
-
+
print '
'
);
diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index b69e8a4cacf..18de8bf6bfc 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -183,8 +183,9 @@ foreach ($syslogModules as $moduleName)
{
$module = new $moduleName;
- $moduleactive=$module->isActive();
- if ($moduleactive == -1 && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them)
+ $moduleactive=(int) $module->isActive();
+ //print $moduleName." = ".$moduleactive." - ".$module->getName()." ".($moduleactive == -1)." \n";
+ if (($moduleactive == -1) && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them)
$var=!$var;
print '
';
@@ -199,7 +200,7 @@ foreach ($syslogModules as $moduleName)
{
foreach ($setuparray as $option)
{
- if (isset($_POST[$option['constant']])) $value=$_POST[$option['constant']];
+ if (isset($_POST[$option['constant']])) $value=$_POST[$option['constant']];
else if (defined($option['constant'])) $value = constant($option['constant']);
else $value = (isset($option['default']) ? $option['default'] : '');
@@ -220,7 +221,7 @@ foreach ($syslogModules as $moduleName)
print "
\n";
print "\n";
-print ' ';
+print ' '."\n\n";
print_titre($langs->trans("SyslogLevel"));
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index f7de102d96d..de8d494f9fc 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -107,7 +107,7 @@ class Categorie extends CommonObject
$this->type = $res['type'];
$this->entity = $res['entity'];
- $this->fetch_optionals($this->id,$extralabels);
+ $this->fetch_optionals($this->id,null);
$this->db->free($resql);
@@ -198,6 +198,8 @@ class Categorie extends CommonObject
{
$this->id = $id;
+ $action='create';
+
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('HookModuleNamedao'));
@@ -289,11 +291,13 @@ class Categorie extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql))
{
+ $action='update';
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('HookCategorydao'));
$parameters=array();
+ $action='update';
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
@@ -408,6 +412,17 @@ class Categorie extends CommonObject
$error++;
}
}
+ if (! $error)
+ {
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";
+ $sql .= " WHERE fk_category = ".$this->id;
+ if (!$this->db->query($sql))
+ {
+ $this->error=$this->db->lasterror();
+ dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
+ $error++;
+ }
+ }
// Delete category
if (! $error)
@@ -430,7 +445,7 @@ class Categorie extends CommonObject
if ($result < 0)
{
$error++;
- dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
+ dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR);
}
}
}
@@ -788,7 +803,7 @@ class Categorie extends CommonObject
*/
function get_full_arbo($type,$markafterid=0)
{
- global $langs;
+ global $conf, $langs;
$this->cats = array();
@@ -798,11 +813,9 @@ class Categorie extends CommonObject
// Init $this->cats array
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates
- if (! empty($conf->global->MAIN_MULTILANGS))
- $sql.= ", t.label as label_trans, t.description as description_trans";
+ if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
- if (! empty($conf->global->MAIN_MULTILANGS))
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
+ if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
$sql.= " WHERE c.entity IN (".getEntity('category',1).")";
$sql.= " AND c.type = ".$type;
@@ -1263,7 +1276,7 @@ class Categorie extends CommonObject
$result='';
$lien = '';
- $label=$langs->trans("ShowCategory").': '.$this->label;
+ $label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label);
$lienfin='';
$picto='category';
@@ -1271,7 +1284,7 @@ class Categorie extends CommonObject
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
- if ($withpicto != 2) $result.=$lien.dol_trunc($this->ref,$maxlength).$lienfin;
+ if ($withpicto != 2) $result.=$lien.dol_trunc(($this->ref?$this->ref:$this->label),$maxlength).$lienfin;
return $result;
}
@@ -1369,7 +1382,7 @@ class Categorie extends CommonObject
// Objet
$obj=array();
$obj['photo']=$photo;
- if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']=$photo_vignette;
+ if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']='thumbs/' . $photo_vignette;
else $obj['photo_vignette']="";
$tabobj[$nbphoto-1]=$obj;
diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php
index 69a8bb97eab..c54d7d889b2 100644
--- a/htdocs/categories/photos.php
+++ b/htdocs/categories/photos.php
@@ -241,7 +241,7 @@ if ($object->id)
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
if ($obj['photo_vignette'])
{
- $filename='thumbs/'.$obj['photo_vignette'];
+ $filename=$obj['photo_vignette'];
}
else
{
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 96db3133cf9..e67111fad6c 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -710,9 +710,9 @@ if ($action == 'create')
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
//For external user force the company to user company
if (!empty($user->societe_id)) {
- print $form->select_company($user->societe_id,'socid','',1,1,0,$events);
+ print $form->select_thirdparty_list($user->societe_id,'socid','',1,1,0,$events);
} else {
- print $form->select_company('','socid','',1,1,0,$events);
+ print $form->select_thirdparty_list('','socid','',1,1,0,$events);
}
}
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index b4a5fdeed60..34e88dd893e 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -241,8 +241,11 @@ class ActionComm extends CommonObject
if (! $error)
{
+ $action='create';
+
// Actions on extra fields (by external module or standard code)
- $hookmanager->initHooks(array('actioncommdao'));
+ // FIXME le hook fait double emploi avec le trigger !!
+ $hookmanager->initHooks(array('actioncommdao'));
$parameters=array('actcomm'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
@@ -560,8 +563,10 @@ class ActionComm extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql))
{
+ $action='update';
// Actions on extra fields (by external module or standard code)
+ // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('actioncommdao'));
$parameters=array('actcomm'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php
index 065f01d2091..77dfea739e1 100644
--- a/htdocs/comm/action/class/cactioncomm.class.php
+++ b/htdocs/comm/action/class/cactioncomm.class.php
@@ -103,7 +103,7 @@ class CActionComm
* @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not
- * @return array Array of all event types if OK, <0 if KO
+ * @return mixed Array of all event types if OK, <0 if KO
*/
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
{
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 9bb3af6dcbd..82d88089684 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -277,20 +277,14 @@ if ($object->id > 0)
print '
';
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index e2a039cf2d8..26f9415e8a5 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -1145,7 +1145,7 @@ class AccountLine extends CommonObject
* @param User $user User object that delete
* @return int <0 if KO, >0 if OK
*/
- function delete($user=0)
+ function delete($user=null)
{
$nbko=0;
@@ -1194,7 +1194,7 @@ class AccountLine extends CommonObject
* @param User $user User object that delete
* @return int <0 if KO, >0 if OK
*/
- function delete_urls($user=0)
+ function delete_urls($user=null)
{
$nbko=0;
diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php
index a1bc0191175..8811ad7c878 100644
--- a/htdocs/compta/bank/class/bankcateg.class.php
+++ b/htdocs/compta/bank/class/bankcateg.class.php
@@ -172,7 +172,7 @@ class BankCateg // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php
index da0e3e21dcd..42a6713c1ce 100644
--- a/htdocs/compta/deplacement/list.php
+++ b/htdocs/compta/deplacement/list.php
@@ -115,7 +115,7 @@ if ($month > 0)
}
else if ($year > 0)
{
- $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
+ $sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
$sql.= $db->order($sortfield,$sortorder);
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 605d4920669..7c8dc7c6c59 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -464,6 +464,8 @@ class Facture extends CommonInvoice
$result=$this->update_price(1);
if ($result > 0)
{
+ $action='create';
+
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('invoicedao'));
@@ -1040,7 +1042,7 @@ class Facture extends CommonInvoice
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php
index cdc935cde01..b75bb056e03 100644
--- a/htdocs/compta/facture/class/paymentterm.class.php
+++ b/htdocs/compta/facture/class/paymentterm.class.php
@@ -261,7 +261,7 @@ class PaymentTerm // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 55ef0a5ef80..1fd4d2c80fc 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load('bills');
+$langs->load('compta');
// Security check
$id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'));
diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php
index 4174d693da3..e2c9c94595a 100644
--- a/htdocs/compta/localtax/class/localtax.class.php
+++ b/htdocs/compta/localtax/class/localtax.class.php
@@ -127,7 +127,7 @@ class Localtax extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php
index 27f2cf3e2e7..27782259333 100644
--- a/htdocs/compta/paiement/cheque/index.php
+++ b/htdocs/compta/paiement/cheque/index.php
@@ -90,6 +90,7 @@ else
//print '
';
print '
';
+$max=10;
$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.number as ref";
$sql.= ", bc.statut, bc.nbcheque";
@@ -98,8 +99,8 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " WHERE ba.rowid = bc.fk_bank_account";
$sql.= " AND bc.entity = ".$conf->entity;
-$sql.= " ORDER BY bc.rowid";
-$sql.= " DESC LIMIT 10";
+$sql.= " ORDER BY bc.date_bordereau DESC, rowid DESC";
+$sql.= $db->plimit($max);
$resql = $db->query($sql);
@@ -107,7 +108,7 @@ if ($resql)
{
print '
';
print '
';
- print '
'.$langs->trans("CheckReceiptShort").'
';
+ print '
'.$langs->trans("LastCheckReceiptShort",$max).'
';
print '
'.$langs->trans("Date")."
";
print '
'.$langs->trans("Account").'
';
print '
'.$langs->trans("NbOfCheques").'
';
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 '
';
diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php
index 5d0762d3e35..a86af28cace 100644
--- a/htdocs/compta/tva/class/tva.class.php
+++ b/htdocs/compta/tva/class/tva.class.php
@@ -143,7 +143,7 @@ class Tva extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
@@ -205,7 +205,7 @@ class Tva extends CommonObject
* @param User $user User that load
* @return int <0 if KO, >0 if OK
*/
- function fetch($id, $user=0)
+ function fetch($id, $user=null)
{
global $langs;
$sql = "SELECT";
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 3f81608c415..6a7776b27bd 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -220,7 +220,7 @@ class Contact extends CommonObject
* @param string $action Current action for hookmanager
* @return int <0 if KO, >0 if OK
*/
- function update($id, $user=0, $notrigger=0, $action='update')
+ function update($id, $user=null, $notrigger=0, $action='update')
{
global $conf, $langs, $hookmanager;
@@ -283,6 +283,8 @@ class Contact extends CommonObject
unset($this->state_code);
unset($this->state);
+ $action='update';
+
// Actions on extra fields (by external module or standard code)
$hookmanager->initHooks(array('contactdao'));
$parameters=array('socid'=>$this->id);
@@ -427,7 +429,7 @@ class Contact extends CommonObject
* @param User $user User asking to change alert or birthday
* @return int <0 if KO, >=0 if OK
*/
- function update_perso($id, $user=0)
+ function update_perso($id, $user=null)
{
$error=0;
$result=false;
@@ -492,7 +494,7 @@ class Contact extends CommonObject
* @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact
* @return int -1 if KO, 0 if OK but not found, 1 if OK
*/
- function fetch($id, $user=0)
+ function fetch($id, $user=null)
{
global $langs;
@@ -910,7 +912,7 @@ class Contact extends CommonObject
global $langs;
$langs->load("dict");
- $code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civility_id)?$this->civility_id:''));
+ $code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civilite_id)?$this->civilite_id:''));
if (empty($code)) return '';
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code);
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index a311c87cffc..2e28328085a 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -357,7 +357,6 @@ if ($result)
print '';
print '
';
print '';
- print ' ';
print '';
print '
';
print '';
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 836070f970b..3502736fca6 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -1290,7 +1290,8 @@ else
$productstatic->ref=$objp->label;
print $productstatic->getNomUrl(0,'',16);
}
- if ($objp->description) print ' '.dol_nl2br($objp->description);
+ if (! empty($conf->global->PRODUIT_DESC_IN_FORM) and $objp->description)
+ print ' '.dol_nl2br($objp->description);
print '';
}
else
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 5626719d96d..4abfb1f9c86 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -989,7 +989,7 @@ class Contrat extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php
index c3bc217e100..a16844dd715 100644
--- a/htdocs/core/antispamimage.php
+++ b/htdocs/core/antispamimage.php
@@ -51,8 +51,6 @@ for($i = 0; $i < $length; $i++)
$sessionkey='dol_antispam_value';
$_SESSION[$sessionkey]=$string;
-header("Content-type: image/png");
-
$img = imagecreate(80,32);
if (empty($img))
{
@@ -60,6 +58,8 @@ if (empty($img))
exit;
}
+header("Content-type: image/png");
+
$background_color = imagecolorallocate($img, 250, 250, 250);
$ecriture_color = imagecolorallocate($img, 0, 0, 0);
imagestring($img, 4, 24, 8, $string, $ecriture_color);
diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index 738582ad931..89d05b92b79 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -159,6 +159,7 @@ class box_actions extends ModeleBoxes
$actioncejour=false;
$contents=$this->info_box_contents;
$nblines=count($contents);
+ $bcx=array();
$bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"';
if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo"))
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index 275154cd80e..c2918ddf1ee 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -181,6 +181,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
global $langs,$conf;
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
+ $bcx=array();
$bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"';
$var = false;
diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php
index 088dfaf327b..59980cea7a9 100644
--- a/htdocs/core/class/ccountry.class.php
+++ b/htdocs/core/class/ccountry.class.php
@@ -191,7 +191,7 @@ class Ccountry // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
@@ -256,10 +256,10 @@ class Ccountry // extends CommonObject
/**
- * Delete object in database
+ * Delete object in database
*
- * @param User $user User that delete
- * @param int $notrigger 0=launch triggers after, 1=disable triggers
+ * @param User $user User that delete
+ * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
function delete($user, $notrigger=0)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index ad9149d48b0..12fee9deb8b 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -34,7 +34,7 @@
*/
abstract class CommonObject
{
- protected $db;
+ public $db;
public $error;
public $errors;
public $canvas; // Contains canvas name if it is
@@ -609,6 +609,10 @@ 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';
+
+ 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
@@ -1823,7 +1827,7 @@ abstract class CommonObject
if (empty($sourceid) && empty($targetid))
{
- dol_print_error('','Bad usage of function. No parameter defined and no id defined');
+ dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERROR);
return -1;
}
@@ -2523,14 +2527,14 @@ abstract class CommonObject
if (! empty($conf->margin->enabled) && empty($user->societe_id))
{
if ($conf->global->MARGIN_TYPE == "1")
- print '
'.$langs->trans('BuyingPrice').'
';
+ print '
'.$langs->trans('BuyingPrice').'
';
else
- print '
'.$langs->trans('CostPrice').'
';
+ print '
'.$langs->trans('CostPrice').'
';
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
- print '
'.$langs->trans('MarginRate').'
';
+ print '
'.$langs->trans('MarginRate').'
';
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
- print '
';
diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php
index eea64ed10ac..027dda53dd3 100644
--- a/htdocs/core/class/ctypent.class.php
+++ b/htdocs/core/class/ctypent.class.php
@@ -198,7 +198,7 @@ class Ctypent // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php
index e191773517b..299026a84bb 100644
--- a/htdocs/core/class/events.class.php
+++ b/htdocs/core/class/events.class.php
@@ -154,7 +154,7 @@ class Events // extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
@@ -191,7 +191,7 @@ class Events // extends CommonObject
* @param User $user User that load
* @return int <0 if KO, >0 if OK
*/
- function fetch($id, $user=0)
+ function fetch($id, $user=null)
{
global $langs;
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index db24d257aee..5448df14010 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -56,7 +56,7 @@ class ExtraFields
var $error;
var $errno;
- static $type2label=array(
+ public static $type2label=array(
'varchar'=>'String',
'text'=>'TextLong',
'int'=>'Int',
@@ -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.form.class.php b/htdocs/core/class/html.form.class.php
index 03defa19129..ba597dd4d57 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -746,7 +746,7 @@ class Form
* @param int $showempty Add an empty field
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box
- * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
+ * @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param int $limit Maximum number of elements
* @return string HTML string with
* @deprecated Use select_thirdparty instead
@@ -816,10 +816,67 @@ class Form
$resql=$this->db->query($sql);
if ($resql)
{
- if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
+ if (! empty($conf->use_javascript_ajax))
{
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
- $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
+ if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
+ {
+ include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
+ $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
+ }
+ else
+ {
+ if (count($events)) // Add management of event
+ {
+ print '';
+ }
+ }
}
// Construct $out and $outarray
@@ -4045,7 +4102,22 @@ class Form
if ($value_as_key) $array=array_combine($array, $array);
- $out='
';
}
-
+
// Ligne de la periode d'analyse du rapport
print '
';
print '
'.$langs->trans("ReportPeriod").'
';
diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php
index d1555678313..8e5a8b13ea9 100644
--- a/htdocs/core/login/functions_dolibarr.php
+++ b/htdocs/core/login/functions_dolibarr.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2007-2014 Laurent Destailleur
* Copyright (C) 2007-2009 Regis Houssin
* Copyright (C) 2010-2011 Juanjo Menent
*
@@ -20,7 +20,7 @@
/**
* \file htdocs/core/login/functions_dolibarr.php
* \ingroup core
- * \brief Authentication functions for Dolibarr mode
+ * \brief Authentication functions for Dolibarr mode (check user on login or email and check pass)
*/
@@ -50,13 +50,15 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
{
// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
$table = MAIN_DB_PREFIX."user";
- $usernamecol = 'login';
+ $usernamecol1 = 'login';
+ $usernamecol2 = 'email';
$entitycol = 'entity';
- $sql ='SELECT rowid, entity, pass, pass_crypted';
+ $sql ='SELECT rowid, login, entity, pass, pass_crypted';
$sql.=' FROM '.$table;
- $sql.=' WHERE '.$usernamecol." = '".$db->escape($usertotest)."'";
- $sql.=' AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")";
+ $sql.=' WHERE ('.$usernamecol1." = '".$db->escape($usertotest)."'";
+ if (preg_match('/@/',$usertotest)) $sql.=' OR '.$usernamecol2." = '".$db->escape($usertotest)."'";
+ $sql.=') AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")";
dol_syslog("functions_dolibarr::check_user_password_dolibarr", LOG_DEBUG);
$resql=$db->query($sql);
@@ -106,7 +108,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
// Password ok ?
if ($passok)
{
- $login=$usertotest;
+ $login=$obj->login;
}
else
{
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 1d6e12b1357..db8f216fd60 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -770,15 +770,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-3", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
}
-
+
// Supplier Orders
if (! empty($conf->fournisseur->enabled))
{
- $langs->load("supplier");
- $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
- // if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
+ if (! empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE))
+ {
+ $langs->load("supplier");
+ $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
+ // if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
+ }
}
-
+
// Donations
if (! empty($conf->don->enabled))
@@ -952,7 +955,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/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php
index bdced511867..56cca5af04f 100644
--- a/htdocs/core/tpl/admin_extrafields_add.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php
@@ -87,8 +87,8 @@
diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php
index d344ef5eb82..ad2fa068757 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
@@ -13,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
+ *
* Need to have following variables defined:
* $object (invoice, order, ...)
* $conf
@@ -48,18 +49,30 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print '
\n";
print "";
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 93ea02b0759..1f7f7fc079d 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -1,7 +1,7 @@
* Copyright (C) 2003 Eric Seigne
- * Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2004-2014 Laurent Destailleur
* Copyright (C) 2005-2010 Regis Houssin
* Copyright (C) 2010-2014 Juanjo Menent
* Copyright (C) 2014 Jean Heimburger
@@ -304,8 +304,8 @@ if ($object->fetch($id))
if ($user->rights->fournisseur->commande->lire)
{
-
-
+
+
// TODO move to DAO class
// Check if there are supplier orders billable
$sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_supplier,';
@@ -325,7 +325,7 @@ if ($object->fetch($id))
} else {
setEventMessage($db->lasterror(),'errors');
}
-
+
// TODO move to DAO class
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
@@ -394,7 +394,7 @@ if ($object->fetch($id))
if ($user->rights->fournisseur->facture->lire)
{
// TODO move to DAO class
- $sql = 'SELECT f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
+ $sql = 'SELECT f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
$sql.= ' SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
@@ -425,7 +425,13 @@ if ($object->fetch($id))
print '
';
@@ -455,11 +461,11 @@ if ($object->fetch($id))
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook
- if (empty($reshook))
+ if (empty($reshook))
{
print '
';
-
+
if ($user->rights->fournisseur->commande->creer)
{
$langs->load("orders");
@@ -471,7 +477,7 @@ if ($object->fetch($id))
$langs->load("bills");
print ''.$langs->trans("AddBill").'';
}
-
+
if ($user->rights->fournisseur->facture->creer)
{
if (! empty($orders2invoice) && $orders2invoice > 0) print '
';
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 853109fe195..b96e7f01c95 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -953,6 +953,8 @@ class CommandeFournisseur extends CommonOrder
if (! $error)
{
+ $action='create';
+
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('supplierorderdao'));
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index bd786cfdf4c..69c235fd831 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -146,7 +146,7 @@ class FactureFournisseur extends CommonInvoice
*/
function create($user)
{
- global $langs,$conf;
+ global $langs,$conf,$hookmanager;
$error=0;
$now=dol_now();
@@ -255,6 +255,25 @@ class FactureFournisseur extends CommonInvoice
$result=$this->update_price();
if ($result > 0)
{
+ $action='create';
+
+ // Actions on extra fields (by external module or standard code)
+ // FIXME le hook fait double emploi avec le trigger !!
+ $hookmanager->initHooks(array('supplierinvoicedao'));
+ $parameters=array('socid'=>$this->id);
+ $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ if (empty($reshook))
+ {
+ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ {
+ $result=$this->insertExtraFields();
+ if ($result < 0)
+ {
+ $error++;
+ }
+ }
+ }
+ else if ($reshook < 0) $error++;
// Call trigger
$result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user);
if ($result < 0) $error++;
@@ -522,7 +541,7 @@ class FactureFournisseur extends CommonInvoice
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 58abe457831..ab0fd08d3f0 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -39,12 +39,11 @@ $langs->load("sendings");
$search_ref=GETPOST('search_ref');
$search_refsupp=GETPOST('search_refsupp');
-$search_nom=GETPOST('search_nom');
+$search_company=GETPOST('search_company');
$search_user=GETPOST('search_user');
$search_ttc=GETPOST('search_ttc');
$sall=GETPOST('search_all');
$search_status=GETPOST('search_status','int');
-if ($search_status == '') $search_status=-1;
$page = GETPOST('page','int');
$socid = GETPOST('socid','int');
@@ -58,6 +57,18 @@ $orderid = GETPOST('orderid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande');
+// Purge search criteria
+if (GETPOST("button_removefilter"))
+{
+ $search_ref='';
+ $search_refsupp='';
+ $search_company='';
+ $search_user='';
+ $search_ttc='';
+ $search_status='';
+}
+
+if ($search_status == '') $search_status=-1;
/*
* View
@@ -102,9 +113,9 @@ if ($search_ref)
{
$sql .= natural_search('cf.ref', $search_ref);
}
-if ($search_nom)
+if ($search_company)
{
- $sql .= natural_search('s.nom', $search_nom);
+ $sql .= natural_search('s.nom', $search_company);
}
if ($search_user)
{
@@ -154,13 +165,14 @@ if ($resql)
$i = 0;
$param="";
- if ($search_ref) $param.="&search_ref=".$search_ref;
- if ($search_nom) $param.="&search_nom=".$search_nom;
- if ($search_user) $param.="&search_user=".$search_user;
- if ($search_ttc) $param.="&search_ttc=".$search_ttc;
- if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
- if ($socid) $param.="&socid=".$socid;
- if ($search_status >= 0) $param.="&search_status=".$search_status;
+ if ($search_ref) $param.="&search_ref=".$search_ref;
+ if ($search_company) $param.="&search_company=".$search_company;
+ if ($search_user) $param.="&search_user=".$search_user;
+ if ($search_ttc) $param.="&search_ttc=".$search_ttc;
+ if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
+ if ($socid) $param.="&socid=".$socid;
+ if ($search_status >= 0) $param.="&search_status=".$search_status;
+
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
print '
';
+dol_fiche_end();
/*
diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php
index b447be4574b..6725c776cd4 100644
--- a/htdocs/public/test/test_arrays.php
+++ b/htdocs/public/test/test_arrays.php
@@ -4,10 +4,9 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
require '../../main.inc.php';
-
-if (!empty($conf->global->MAIN_FEATURES_LEVEL))
+if ($_SERVER['HTTP_HOST'] != 'localhost')
{
- print "Page available onto dev environment only";
+ print "Page available only with url http://localhost/...";
exit;
}
$usedolheader=0; // 1 = Test inside a dolibarr page, 0 = Use hard coded header
@@ -30,16 +29,21 @@ if (empty($usedolheader))
+
-
+
+" />
-
+
+--
+
-
+
+
-
-
-This page is a sample of page using tables. To make test with
-- css (edit page to change)
-- jmobile (edit page to enable/disable)
+
+This page is a sample of page using tables. It is designed to make test with
+- css (edit page to change to test another css)
+- jmobile (add parameter dol_use_jmobile=1 to enable view with jmobile)
- dataTables
- tablednd
-
+
Example 0a : Table with div+div+div containg a select that should be overflowed and truncated => Use this to align text or form
-
+
-
+
@@ -84,7 +87,7 @@ This page is a sample of page using tables. To make test with
-
+
@@ -97,7 +100,7 @@ This page is a sample of page using tables. To make test with
-
+
@@ -111,9 +114,8 @@ This page is a sample of page using tables. To make test with
use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
+ if (! empty($conf->use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
?>
-
line3
@@ -302,7 +304,7 @@ $('xxxth').replaceWith(
-
+
Example 3 : Standard table => Use this if you need the drag and drop for lines
@@ -310,11 +312,10 @@ $('xxxth').replaceWith(
use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
+ if (! empty($conf->use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
?>
-
-
-This page is a sample of page using html methods.
+
+This page is a sample of page using html methods. It is designed to make test with
+- css (edit page to change to test another css)
+- jmobile (add parameter dol_use_jmobile=1 to enable view with jmobile)
+
-select_date using tzuser date
@@ -64,8 +47,22 @@ print '
'."\n";
print "Test 3: We must have here 1970-01-01 00:00:00 selected (fields are mandatory) \n";
$form->select_date(dol_get_first_day(1970,1,false), 'test3', 1, 1, 0);
-?>
+print '
'."\n";
-
-
-
\ No newline at end of file
+// Test4: a multiselect
+print "Test 4: a multiselect \n";
+$array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3');
+$arrayselected=array(1,3);
+print $form->multiselectarray('testmulti', $array, $arrayselected, '', 0, '', 0, 250);
+
+print '
'."\n";
+
+// Test5: a select
+print "Test 5: a select \n";
+$array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3');
+$selected=3;
+print $form->selectarray('testselect', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"');
+
+
+llxFooter();
+$db->close();
diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php
index 241d440cc0f..ca01963e30b 100644
--- a/htdocs/resource/class/html.formresource.class.php
+++ b/htdocs/resource/class/html.formresource.class.php
@@ -1,19 +1,20 @@
-*
-* 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 place/class/html.place.class.php
diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php
index e947b4e7ed9..a7be5d0d25a 100644
--- a/htdocs/resource/class/resource.class.php
+++ b/htdocs/resource/class/resource.class.php
@@ -23,8 +23,8 @@
*/
// Put here all includes required by your class file
-require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
-
+require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php";
/**
* DAO Resource object
@@ -205,7 +205,7 @@ class Resource extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user=0, $notrigger=0)
+ function update($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
@@ -329,7 +329,7 @@ class Resource extends CommonObject
function delete($rowid, $notrigger=0)
{
global $user,$langs,$conf;
-
+
$error=0;
if (! $notrigger)
@@ -339,10 +339,10 @@ class Resource extends CommonObject
if ($result < 0) return -1;
// End call triggers
}
-
+
$sql = "DELETE FROM ".MAIN_DB_PREFIX."resource";
$sql.= " WHERE rowid =".$rowid;
-
+
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if ($this->db->query($sql))
{
@@ -364,7 +364,7 @@ class Resource extends CommonObject
return -1;
}
}
-
+
/**
* Load resource objects into $this->lines
*
@@ -500,9 +500,9 @@ class Resource extends CommonObject
$line->fk_user_create = $obj->fk_user_create;
if($obj->resource_id && $obj->resource_type)
- $line->objresource = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type);
+ $line->objresource = fetchObjectByElement($obj->resource_id,$obj->resource_type);
if($obj->element_id && $obj->element_type)
- $line->objelement = $this->fetchObjectByElement($obj->element_id,$obj->element_type);
+ $line->objelement = fetchObjectByElement($obj->element_id,$obj->element_type);
$this->lines[$i] = $line;
$i++;
@@ -584,7 +584,7 @@ class Resource extends CommonObject
$line->mandatory = $obj->mandatory;
$line->fk_user_create = $obj->fk_user_create;
- $this->lines[$i] = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type);
+ $this->lines[$i] = fetchObjectByElement($obj->resource_id,$obj->resource_type);
$i++;
}
@@ -633,7 +633,7 @@ class Resource extends CommonObject
if (! $this->table_element)
{
- dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined", LOG_ERR);
+ dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined");
return -1;
}
@@ -695,7 +695,7 @@ class Resource extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update_element_resource($user=0, $notrigger=0)
+ function update_element_resource($user=null, $notrigger=0)
{
global $conf, $langs;
$error=0;
@@ -732,7 +732,7 @@ class Resource extends CommonObject
{
// Call trigger
$result=$this->call_trigger('RESOURCE_MODIFY',$user);
- if ($result < 0) $error++;
+ if ($result < 0) $error++;
// End call triggers
}
}
@@ -802,7 +802,7 @@ class Resource extends CommonObject
$i=0;
foreach($resources as $nb => $resource)
{
- $this->lines[$i] = $this->fetchObjectByElement($resource['resource_id'],$resource['resource_type']);
+ $this->lines[$i] = fetchObjectByElement($resource['resource_id'],$resource['resource_type']);
$i++;
}
return $i;
diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php
index f08a4a2455c..7b36423cb61 100644
--- a/htdocs/societe/class/address.class.php
+++ b/htdocs/societe/class/address.class.php
@@ -232,7 +232,7 @@ class Address
* @param User $user Objet de l'utilisateur
* @return int >0 si ok, <0 si ko
*/
- function fetch_lines($socid, $user=0)
+ function fetch_lines($socid, $user=null)
{
global $langs, $conf;
@@ -325,7 +325,7 @@ class Address
* @param User $user Objet de l'utilisateur
* @return int >0 si ok, <0 si ko
*/
- function fetch_address($id, $user=0)
+ function fetch_address($id, $user=null)
{
global $langs;
global $conf;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index e95ec86066c..fbdf42d86f5 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -878,6 +878,8 @@ class Societe extends CommonObject
}
}
+ $action='update';
+
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('thirdpartydao'));
@@ -2811,7 +2813,7 @@ class Societe extends CommonObject
}
else // For backward compatibility
{
- dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING);
+ dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_ERR);
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$country_code=getCountry($country_id,2,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore
$country_label=getCountry($country_id,0,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index 243b55f01ca..b76d8a7b9f0 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -176,7 +176,7 @@ print $total;
print '';
print '
';
-if (! empty($conf->categorie->enabled))
+if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES))
{
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$elementtype = 'societe';
diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php
index 542a2066e93..1845669dcfc 100644
--- a/htdocs/societe/notify/card.php
+++ b/htdocs/societe/notify/card.php
@@ -1,7 +1,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur
- * Copyright (C) 2010-2012 Juanjo Menent
+ * Copyright (C) 2010-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
@@ -376,7 +376,7 @@ if ($result > 0)
print '';
// List
- $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id as object_id, n.type,";
+ $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
$sql.= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,";
$sql.= " a.code, a.label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index 0a5a9303d90..62869daf366 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -65,7 +65,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($socid);
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
-$objcanvas='';
+$objcanvas=null;
if (! empty($canvas))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
diff --git a/htdocs/theme/.gitignore b/htdocs/theme/.gitignore
index fab0672d598..bad6db7e4d2 100644
--- a/htdocs/theme/.gitignore
+++ b/htdocs/theme/.gitignore
@@ -1 +1,2 @@
/bootstrap
+/oblyon
diff --git a/htdocs/theme/eldy/.gitignore b/htdocs/theme/eldy/.gitignore
new file mode 100644
index 00000000000..134509791a9
--- /dev/null
+++ b/htdocs/theme/eldy/.gitignore
@@ -0,0 +1 @@
+/*.new
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 0f5644dc406..9f4e6abe24c 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -424,6 +424,10 @@ th .button {
border-radius: 10px;
}
+.borderrightlight
+{
+ border-right: 1px solid #DDD;
+}
/* ============================================================================== */
/* Styles to hide objects */
@@ -862,7 +866,7 @@ form#login {
max-width: 540px;
background-color: #FFFFFF;
-
+
-moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
-webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
@@ -872,7 +876,7 @@ form#login {
border-radius: 8px;
border:solid 1px rgba(80,80,80,.4);
-
+
border-top:solid 1px f8f8f8;
/*
background-color: #f8f8f8;
@@ -893,6 +897,13 @@ div#login_left, div#login_right {
table.login_table tr td table.none tr td {
padding: 2px;
}
+table.login_table_securitycode {
+ border-spacing: 0px;
+}
+table.login_table_securitycode tr td {
+ padding-left: 0px;
+ padding-right: 4px;
+}
#securitycode {
min-width: 60px;
}
@@ -1839,13 +1850,13 @@ table.liste td {
.impair, .nohover .impair:hover, tr.impair td.nohover {
- background: linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
- background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
- background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
- background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
- background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
+ background: linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%);
- background: #eaeaea !important;
+ background: #eaeaea;
font-family: ;
border: 0px;
@@ -1856,22 +1867,22 @@ table.liste td {
td.nohover, .pair:hover {
- background: rgb() !important;
+ background: rgb();
- background: #fafafa !important;
+ background: #fafafa;
border: 0px;
}
.pair, .nohover .pair:hover, tr.pair td.nohover {
- background: linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
- background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
- background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
- background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
- background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%) !important;
+ background: linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%);
- background: #ffffff !important;
+ background: #ffffff;
font-family: ;
border: 0px;
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 4760f73f855..429bcc91130 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
-if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php');
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index b91356f7b88..15a5cf8b8ed 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -1265,7 +1265,10 @@ class User extends CommonObject
}
}
+ $action='update';
+
// Actions on extra fields (by external module or standard code)
+ // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('userdao'));
$parameters=array('socid'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index e096f8fc470..5ff1a928d1c 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -620,16 +620,10 @@ class UserGroup extends CommonObject
if ($this->update(1) < 0) return -2;
- if (! $notrigger)
- {
- // Call trigger
- $result=$this->call_trigger('GROUP_CREATE',$user);
- if ($result < 0) { $error++; $this->db->rollback(); return -1; }
- // End call triggers
- }
-
+ $action='create';
// Actions on extra fields (by external module or standard code)
+ // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('groupdao'));
$parameters=array();
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
@@ -646,6 +640,14 @@ class UserGroup extends CommonObject
}
else if ($reshook < 0) $error++;
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('GROUP_CREATE',$user);
+ if ($result < 0) { $error++; $this->db->rollback(); return -1; }
+ // End call triggers
+ }
+
if ($error > 0) { $error++; $this->db->rollback(); return -1; }
else $this->db->commit();
@@ -689,15 +691,10 @@ class UserGroup extends CommonObject
$resql = $this->db->query($sql);
if ($resql)
{
- if (! $notrigger)
- {
- // Call trigger
- $result=$this->call_trigger('GROUP_MODIFY',$user);
- if ($result < 0) { $error++; }
- // End call triggers
- }
+ $action='update';
// Actions on extra fields (by external module or standard code)
+ // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('groupdao'));
$parameters=array();
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
@@ -714,6 +711,14 @@ class UserGroup extends CommonObject
}
else if ($reshook < 0) $error++;
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('GROUP_MODIFY',$user);
+ if ($result < 0) { $error++; }
+ // End call triggers
+ }
+
if (! $error)
{
$this->db->commit();
diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php
index 2d104eb96a1..696723f7247 100644
--- a/htdocs/webservices/server_thirdparty.php
+++ b/htdocs/webservices/server_thirdparty.php
@@ -460,7 +460,7 @@ function createThirdParty($authentication,$thirdparty)
$result=$newobject->create($fuser);
if ($newobject->particulier && $result > 0) {
$newobject->firstname = $thirdparty['firstname'];
- $newobject->name_bis = $thirdparty['ref'];
+ $newobject->name_bis = $thirdparty['lastname'];
$result = $newobject->create_individual($fuser);
}
if ($result <= 0)