';
$max=10;
-$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref";
-$sql.= ", bc.statut, bc.nbcheque";
-$sql.= ", ba.label, ba.rowid as bid";
+$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,";
+$sql.= " bc.statut, bc.nbcheque,";
+$sql.= " ba.ref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.accountancy_journal,";
+$sql.= " aj.code";
$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc, ".MAIN_DB_PREFIX."bank_account as ba";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal";
$sql.= " WHERE ba.rowid = bc.fk_bank_account";
$sql.= " AND bc.entity = ".$conf->entity;
$sql.= " ORDER BY bc.date_bordereau DESC, rowid DESC";
@@ -122,8 +124,13 @@ if ($resql)
$checkdepositstatic->statut=$objp->statut;
$accountstatic->id=$objp->bid;
+ $accountstatic->ref=$objp->ref;
$accountstatic->label=$objp->label;
-
+ $accountstatic->number=$objp->number;
+ $accountstatic->currency_code=$objp->currency_code;
+ $accountstatic->account_number=$objp->account_number;
+ $accountstatic->accountancy_journal=$objp->code;
+
print '
'."\n";
print ''.$checkdepositstatic->getNomUrl(1).' ';
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 42106c1cb13..4d23637dfe7 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -209,9 +209,10 @@ class Paiement extends CommonObject
$total = $totalamount_converted; // Maybe use price2num with MT for the converted value
$mtotal = $totalamount;
}
+ $note = ($this->note_public?$this->note_public:$this->note);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, fk_user_creat)";
- $sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")";
+ $sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($note)."', ".$user->id.")";
dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG);
$resql = $this->db->query($sql);
diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/tovalidate.php
similarity index 96%
rename from htdocs/compta/paiement/avalider.php
rename to htdocs/compta/paiement/tovalidate.php
index beb2fb77ecd..7e16b525233 100644
--- a/htdocs/compta/paiement/avalider.php
+++ b/htdocs/compta/paiement/tovalidate.php
@@ -17,9 +17,9 @@
*/
/**
- * \file htdocs/compta/paiement/avalider.php
+ * \file htdocs/compta/paiement/tovalidate.php
* \ingroup compta
- * \brief Page liste des paiements a valider des factures clients
+ * \brief Page list payment to validate. Visible in menu when option BILL_ADD_PAYMENT_VALIDATION is on.
*/
require '../../main.inc.php';
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 4600baf56ed..a2d189c9790 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -1926,7 +1926,7 @@ else
print $langs->trans("DateEndReal").': ';
print dol_print_date($objp->date_fin_reelle, 'day');
}
- if (! empty($objp->comment)) print " ".$objp->comment;
+ if (! empty($objp->comment)) print " - ".$objp->comment;
print '';
print ' ';
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index 64050c3512d..1b81d9d13f6 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -49,8 +49,13 @@ $result=restrictedArea($user,'contrat',$id);
$object = new Contrat($db);
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('contractcard','globalcard'));
-// Add new contact
+
+/*
+ * Actions
+ */
if ($action == 'addcontact' && $user->rights->contrat->creer)
{
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index 32fcd5a64bd..4bc2747a829 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -77,10 +77,14 @@ if ($object->id > 0)
$upload_dir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart='contract';
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('contractcard','globalcard'));
+
/*
* Actions
*/
+
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php
index 10f31ac1612..b6c92eac27e 100644
--- a/htdocs/contrat/info.php
+++ b/htdocs/contrat/info.php
@@ -41,6 +41,17 @@ $ref = GETPOST('ref','alpha');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contrat', $id, '');
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('contractcard','globalcard'));
+
+
+/*
+ * Actions
+ */
+
+// None
+
+
/*
* View
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index babc31f7702..94118d415bf 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -487,13 +487,13 @@ if ($resql)
if (! empty($arrayfields['c.date_contrat']['checked']))
{
// Date contract
- print '';
+ print ' ';
//print $langs->trans('Month').': ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ' ';
print ' ';
//print ' '.$langs->trans('Year').': ';
$syear = $year;
- $formother->select_year($syear,'year',1, 20, 5);
+ print $formother->selectyear($syear,'year',1, 20, 5, 0, 0, '', 'widthauto');
print ' ';
}
// Extra fields
diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php
index 9a6d28dd4c9..ab76d9aaec3 100644
--- a/htdocs/contrat/note.php
+++ b/htdocs/contrat/note.php
@@ -49,6 +49,10 @@ $object->fetch($id,$ref);
$permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('contractcard','globalcard'));
+
+
/*
* Actions
diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php
index 8b5bfbc817d..d665d70da56 100644
--- a/htdocs/core/boxes/box_graph_invoices_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_permonth.php
@@ -91,6 +91,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
if ($user->rights->facture->lire)
{
+ $mesg = '';
+
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
$param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
$param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
@@ -246,13 +248,11 @@ class box_graph_invoices_permonth extends ModeleBoxes
$stringtoshow.='';
$stringtoshow.='';
}
- $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
- $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
- 'maxlength'=>500,
- 'text' => $mesg);
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"', 'maxlength'=>500, 'text' => $mesg);
}
}
diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
index 436343a56dc..efd7de41e5a 100644
--- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
@@ -245,11 +245,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$stringtoshow.='';
$stringtoshow.='';
}
- $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"','td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
- $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
}
diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php
index 7e60e00a2fc..699f2db902b 100644
--- a/htdocs/core/boxes/box_graph_orders_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_permonth.php
@@ -244,11 +244,11 @@ class box_graph_orders_permonth extends ModeleBoxes
$stringtoshow.='';
$stringtoshow.='';
}
- $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
- $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
}
diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
index 6f8ebf39001..f49f38c1228 100644
--- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
@@ -243,11 +243,11 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$stringtoshow.='';
$stringtoshow.='';
}
- $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
- $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
}
diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php
index bac56d8006b..69a09e8aad2 100644
--- a/htdocs/core/boxes/box_graph_product_distribution.php
+++ b/htdocs/core/boxes/box_graph_product_distribution.php
@@ -386,7 +386,7 @@ class box_graph_product_distribution extends ModeleBoxes
$stringtoshow.=$px3->show();
$stringtoshow.='';
}
- $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php
index 690df3d41fa..50e3cbe9bf8 100644
--- a/htdocs/core/boxes/box_graph_propales_permonth.php
+++ b/htdocs/core/boxes/box_graph_propales_permonth.php
@@ -245,11 +245,11 @@ class box_graph_propales_permonth extends ModeleBoxes
$stringtoshow.='';
$stringtoshow.='';
}
- $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
- $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
}
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index f5a16aa540b..a4ea3a70447 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -319,7 +319,7 @@ abstract class CommonDocGenerator
foreach($conf->global as $key => $val)
{
- if (preg_match('/(_pass|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****';
+ if (preg_match('/(_pass|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****';
else $newval = $val;
$array_other['__['.$key.']__'] = $newval;
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index d08d5df3f78..89647c4a9e6 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2739,7 +2739,7 @@ abstract class CommonObject
* @param string $targettype Object target type (if not defined, elemennt name of object)
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
* @param int $alsosametype 0=Return only links to object that differs from source. 1=Include also link to objects of same type.
- * @return void
+ * @return int <0 if KO, >0 if OK
* @see add_object_linked, updateObjectLinked, deleteObjectLinked
*/
function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR',$alsosametype=1)
@@ -2920,10 +2920,12 @@ abstract class CommonObject
}
}
}
+ return 1;
}
else
{
dol_print_error($this->db);
+ return -1;
}
}
@@ -3057,6 +3059,7 @@ abstract class CommonObject
$fieldstatus="fk_statut";
if ($elementTable == 'mailing') $fieldstatus="statut";
+ if ($elementTable == 'cronjob') $fieldstatus="status";
if ($elementTable == 'user') $fieldstatus="statut";
if ($elementTable == 'expensereport') $fieldstatus="fk_statut";
if ($elementTable == 'commande_fournisseur_dispatch') $fieldstatus="status";
@@ -3581,7 +3584,7 @@ abstract class CommonObject
* Return HTML table for object lines
* TODO Move this into an output class file (htmlline.class.php)
* If lines are into a template, title must also be into a template
- * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
+ * But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*
* @param string $action Action code
* @param string $seller Object of seller third party
@@ -4519,10 +4522,11 @@ abstract class CommonObject
{
$extrafields->fetch_name_optionals_label($this->table_element);
}
- $optionsArray = $extrafields->attributes[$this->table_element]['label'];
+ $optionsArray = (! empty($extrafields->attributes[$this->table_element]['label'])?$extrafields->attributes[$this->table_element]['label']:null);
}
else
{
+ global $extrafields;
dol_syslog("Warning: fetch_optionals was called with param optionsArray defined when you should pass null now", LOG_WARNING);
}
@@ -4696,7 +4700,8 @@ abstract class CommonObject
if ($this->array_options[$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']))
{
// If there is an encryption choice, we use it to crypt data before insert
- $algo=reset(array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']));
+ $tmparrays = array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']);
+ $algo=reset($tmparrays);
if ($algo != '')
{
//global $action; // $action may be 'create', 'update', 'update_extras'...
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index a1d051440c3..0705d2fd60d 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -310,7 +310,7 @@ class Conf
// For user storage
$this->user->multidir_output = array($this->entity => $rootfordata."/users");
- $this->user->multidir_temp = array($this->entity => $rootfordata."/users/temp");
+ $this->user->multidir_temp = array($this->entity => $rootfordata."/users/temp");
// For backward compatibility
$this->user->dir_output=$rootforuser."/users";
$this->user->dir_temp=$rootforuser."/users/temp";
@@ -320,6 +320,9 @@ class Conf
$this->usergroup->dir_temp=$rootforuser."/usergroups/temp";
// For propal storage
+ $this->propal->multidir_output = array($this->entity => $rootfordata."/propale");
+ $this->propal->multidir_temp = array($this->entity => $rootfordata."/propale/temp");
+ // For backward compatibility
$this->propal->dir_output=$rootfordata."/propale";
$this->propal->dir_temp=$rootfordata."/propale/temp";
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 08d6c3bfeaf..861848e6924 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -235,6 +235,7 @@ class ExtraFields
$lengthdb='11';
} elseif ($type=='html') {
$typedb='text';
+ $lengthdb=$length;
} elseif($type=='password') {
$typedb='varchar';
$lengthdb='128';
@@ -742,7 +743,7 @@ class ExtraFields
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,fielddefault,fieldcomputed";
- $sql .= ",entity";
+ $sql.= ",entity";
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
$sql.= " WHERE entity IN (0,".$conf->entity.")";
if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'";
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index a98729ac055..fdd1aaa5a76 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3426,7 +3426,8 @@ class Form
}
else
{
- print $langs->trans("NoActiveBankAccountDefined");
+ if ($statut == 0) print $langs->trans("NoActiveBankAccountDefined");
+ else print $langs->trans("NoBankAccountFound");
}
}
else {
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 2d66661c839..f254fe44b9d 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -194,6 +194,7 @@ class FormActions
$projectid = $object->fk_project;
if ($typeelement == 'project') $projectid = $object->id;
+ $buttontoaddnewevent='';
if (! empty($conf->agenda->enabled))
{
$buttontoaddnewevent = '';
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index b139483b610..077a29d4595 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -299,6 +299,9 @@ class FormFile
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
}
+ // Add entity in $param
+ $param.= 'entity='.(!empty($object->entity)?$object->entity:$conf->entity);
+
$printer=0;
if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements
{
@@ -699,7 +702,8 @@ class FormFile
$out.= ''."\n";
// Show title of array if not already shown
- if ((! empty($file_list) || ! empty($link_list) || preg_match('/^massfilesarea/', $modulepart)) && ! $headershown)
+ if ((! empty($file_list) || ! empty($link_list) || preg_match('/^massfilesarea/', $modulepart))
+ && ! $headershown)
{
$headershown=1;
$out.= ''.$titletoshow.'
'."\n";
@@ -744,7 +748,7 @@ class FormFile
if ($delallowed || $printer || $morepicto)
{
- $out.= ' ';
+ $out.= ' ';
if ($delallowed)
{
$out.= '';
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 4a04a04885a..8aa7f0ce54e 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -406,7 +406,7 @@ class FormMail extends Form
- $out.= '