diff --git a/ChangeLog b/ChangeLog
index 7f210c6fab1..0f2ed877a13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,19 +26,19 @@ Dolibarr better:
- The old driver of "mysql" has been removed. Dolibarr use the new one (mysqli) by default.
- Remove not used function calculate_byte(). Use dol_print_size() instead.
- Function pdf_getTotalQty is now deprecated. Not used by Dolibarr core.
+- Method commande->deleteline($lineid) has been replaced with commande->deleteline($user, $lineid).
- Method expensereport->delete(id, user) has been replaced with ->delete(user)
Method warehouse->delete(id) has been replace with ->delete(user)
This is to follow good practice to make a fetch on object before deleting it.
-- The form to add a product to a draft proposal/order/invoice from the product card is hidden by default.
+- The form to add a product to a draft proposal/order/invoice, from the product card, is hidden by default.
It was not commonly used and usage generates some problems (cost price for margin calculation not entered, vat setting).
Set constant PRODUCT_ADD_FORM_ADD_TO to retrieve it.
-- The javascript "datatables" library was used to be provided into Dolibarr sources, but it was not used by application.
+- The javascript "datatables" library was previously provided into Dolibarr sources, but it was not used by application.
So there is no reason to maintain its compatibility with other dolibarr components. If an external module need this
- library, this external module must embed hte library in his own sources/packages.
-- Trigger name SUPPLIER_PROPOSAL_CREATE has been renamed into PROPOSAL_SUPPLIER_CREATE
-- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters
- no more required were also removed. Use this new one if you ware using one of them.
-- Method commande->deleteline($lindeid) has been replaced with commande->deleteline($user, $lineid).
+ library, this external module must embed the library in his own sources/packages.
+- Trigger name SUPPLIER_PROPOSAL_CREATE has been renamed into PROPOSAL_SUPPLIER_CREATE.
+- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters,
+ no more required, were also removed. Use this new one if you were using one of them.
diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php
index 27515db3c68..c47a87a8033 100644
--- a/dev/skeletons/skeleton_list.php
+++ b/dev/skeletons/skeleton_list.php
@@ -58,6 +58,7 @@ $action = GETPOST('action','alpha');
$backtopage = GETPOST('backtopage');
$myparam = GETPOST('myparam','alpha');
+$search_all=trim(GETPOST("sall"));
$search_field1=GETPOST("search_field1");
$search_field2=GETPOST("search_field2");
$search_myfield=GETPOST('search_myfield');
@@ -141,22 +142,23 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
-include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
-
-// Purge search criteria
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
-{
- $search_field1='';
- $search_field2='';
- $search_date_creation='';
- $search_date_update='';
- $toselect='';
- $search_array_options=array();
-}
-
-
if (empty($reshook))
{
+ // Selection of new fields
+ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
+
+ // Purge search criteria
+ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+ {
+ $search_field1='';
+ $search_field2='';
+ $search_date_creation='';
+ $search_date_update='';
+ $toselect='';
+ $search_array_options=array();
+ }
+
+ // Mass actions
$objectclass='Skeleton';
$objectlabel='Skeleton';
$permtoread = $user->rights->skeleton->read;
@@ -180,7 +182,6 @@ $form=new Form($db);
//$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
$help_url='';
$title = $langs->trans('MyModuleListTitle');
-llxHeader('', $title, $help_url);
// Put here content of your page
@@ -247,301 +248,308 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= $db->plimit($limit+1, $offset);
-
dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql);
-if ($resql)
+if (! $resql)
{
- $num = $db->num_rows($resql);
-
- $arrayofselected=is_array($toselect)?$toselect:array();
-
- $param='';
- if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
- if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
- if ($search_field1 != '') $param.= '&search_field1='.urlencode($search_field1);
- if ($search_field2 != '') $param.= '&search_field2='.urlencode($search_field2);
- if ($optioncss != '') $param.='&optioncss='.$optioncss;
- // Add $param from extra fields
- foreach ($search_array_options as $key => $val)
+ dol_print_error($db);
+ exit;
+}
+
+$num = $db->num_rows($resql);
+
+// Direct jump if only one record found
+if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all)
+{
+ $obj = $db->fetch_object($resql);
+ $id = $obj->rowid;
+ header("Location: ".DOL_URL_ROOT.'/skeleton/card.php?id='.$id);
+ exit;
+}
+
+llxHeader('', $title, $help_url);
+
+$arrayofselected=is_array($toselect)?$toselect:array();
+
+$param='';
+if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+if ($search_field1 != '') $param.= '&search_field1='.urlencode($search_field1);
+if ($search_field2 != '') $param.= '&search_field2='.urlencode($search_field2);
+if ($optioncss != '') $param.='&optioncss='.$optioncss;
+// Add $param from extra fields
+foreach ($search_array_options as $key => $val)
+{
+ $crit=$val;
+ $tmpkey=preg_replace('/search_options_/','',$key);
+ if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
+}
+
+$arrayofmassactions = array(
+ 'presend'=>$langs->trans("SendByMail"),
+ 'builddoc'=>$langs->trans("PDFMerge"),
+);
+if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
+if ($massaction == 'presend') $arrayofmassactions=array();
+$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
+
+print '
'; // Do not force align=right, or it align also the content of the select box
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
print '
';
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
- // print '
' . $obj->accountancy_code_buy . '
';
- // TODO: replace by select
- // print '
' . $compta_prodbuy . '
';
- // TODO: we shoul set a user defined value to adjust user square / wide screen size
- // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
+ print length_accountg($obj->accountancy_code_buy);
+ if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
+ }
+ else
+ {
+ print length_accountg($obj->accountancy_code_sell);
+ if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
+ }
+ print '';
+
+ // Dedicated account
+ $defaultvalue='';
+ if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
+ // Accounting account buy
print '
';
- print $form->select_account($compta_prodbuy_id, 'codeventil_' . $product_static->id, 1);
+ //$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
+ if (empty($defaultvalue)) $defaultvalue=$compta_prodbuy;
+ $codesell=length_accountg($obj->accountancy_code_buy);
+ if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
+ print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1);
print '
';
- // TODO: replace by select
- // TODO: we shoul set a user defined value to adjust user square / wide screen size
- // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
print '
';
- print $form->select_account($compta_prodsell_id, 'codeventil_' . $product_static->id, 1);
+ //$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
+ if (empty($defaultvalue)) $defaultvalue=$compta_prodsell;
+ $codesell=length_accountg($obj->accountancy_code_sell);
+ //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
+ if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
+ print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1);
print '
';
diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php
index ac72df44e21..fab9e81031d 100644
--- a/htdocs/accountancy/class/html.formventilation.class.php
+++ b/htdocs/accountancy/class/html.formventilation.class.php
@@ -65,7 +65,7 @@ class FormVentilation extends Form
/**
* Return list of accounts with label by chart of accounts
*
- * @param string $selectid Preselected chart of accounts
+ * @param string $selectid Preselected id or code of accounting accounts (depends on $select_in)
* @param string $htmlname Name of field in html form
* @param int $showempty Add an empty field
* @param array $event Event options
@@ -99,26 +99,28 @@ class FormVentilation extends Form
$out = ajax_combobox($htmlname, $event);
+ // TODO Add $options in cache so next call will not execute the request
+ $selected = 0;
$options = array();
- $selected = null;
-
- while ($obj = $this->db->fetch_object($resql)) {
+ while ($obj = $this->db->fetch_object($resql))
+ {
$label = length_accountg($obj->account_number) . ' - ' . $obj->label;
$label = dol_trunc($label, $trunclength);
$select_value_in = $obj->rowid;
$select_value_out = $obj->rowid;
+ // Try to guess if we have found default value
if ($select_in == 1) {
$select_value_in = $obj->account_number;
}
if ($select_out == 1) {
$select_value_out = $obj->account_number;
}
-
// Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number
// Because same account_number can be share between different accounting_system and do have the same meaning
- if (($selectid != '') && $selectid == $select_value_in) {
+ if ($selectid != '' && $selectid == $select_value_in) {
+ //var_dump("Found ".$selectid." ".$select_value_in);
$selected = $select_value_out;
}
@@ -127,6 +129,7 @@ class FormVentilation extends Form
$out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1);
$this->db->free($resql);
+
return $out;
}
diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php
index d33fc82f3bc..b18923a1e1d 100644
--- a/htdocs/accountancy/customer/lines.php
+++ b/htdocs/accountancy/customer/lines.php
@@ -83,7 +83,7 @@ $formventilation = new FormVentilation($db);
*/
// Purge search criteria
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
{
$search_ref = '';
$search_invoice = '';
@@ -254,6 +254,7 @@ if ($result) {
print '
';
// TODO: we should set a user defined value to adjust user square / wide screen size
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
- print '
';
+ }
+ }
+}
+// Fields from hook
+$parameters=array('arrayfields'=>$arrayfields);
+$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+// Date creation
+if (! empty($arrayfields['d.datec']['checked']))
+{
+ print '
';
- }
- $parameters=array();
- $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
- if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
- else $moreforfilter = $hookmanager->resPrint;
- if (! empty($moreforfilter))
- {
- print '
';
- print $moreforfilter;
- print '
';
- }
-
- $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
- $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+ $var=!$var;
+ print "
";
- print '
'."\n";
- print '
';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
{
- print '
'.$langs->trans("NumberingShort").'
';
+ print '
'.($i+1).'
';
}
- if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'],$_SERVER["PHP_SELF"],'d.login','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.morphy']['checked'])) print_liste_field_titre($arrayfields['d.morphy']['label'],$_SERVER["PHP_SELF"],'d.morphy','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['t.libelle']['checked'])) print_liste_field_titre($arrayfields['t.libelle']['label'],$_SERVER["PHP_SELF"],'t.libelle','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.address']['checked'])) print_liste_field_titre($arrayfields['d.address']['label'],$_SERVER["PHP_SELF"],'d.address','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.zip']['checked'])) print_liste_field_titre($arrayfields['d.zip']['label'],$_SERVER["PHP_SELF"],'d.zip','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.town']['checked'])) print_liste_field_titre($arrayfields['d.town']['label'],$_SERVER["PHP_SELF"],'d.town','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($langs->trans("StateShort"),$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['d.phone']['checked'])) print_liste_field_titre($arrayfields['d.phone']['label'],$_SERVER["PHP_SELF"],'d.phone','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.phone_perso']['checked'])) print_liste_field_titre($arrayfields['d.phone_perso']['label'],$_SERVER["PHP_SELF"],'d.phone_perso','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['d.phone_mobile']['label'],$_SERVER["PHP_SELF"],'d.phone_mobile','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.email']['checked'])) print_liste_field_titre($arrayfields['d.email']['label'],$_SERVER["PHP_SELF"],'d.email','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['d.datefin']['checked'])) print_liste_field_titre($arrayfields['d.datefin']['label'],$_SERVER["PHP_SELF"],'d.datefin','',$param,'align="center"',$sortfield,$sortorder);
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
- }
- }
- }
- // Hook fields
- $parameters=array('arrayfields'=>$arrayfields);
- $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'],$_SERVER["PHP_SELF"],"d.statut","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print "
\n";
- // Line for filters fields
- print '
';
-
- // Line numbering
- if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
- {
- print '
';
+ if (! $i) $totalarray['nbfield']++;
}
// Phone pro
if (! empty($arrayfields['d.phone']['checked']))
{
- print '
';
- print '
';
+ print '
';
+ print $obj->phone;
+ print '
';
+ if (! $i) $totalarray['nbfield']++;
}
// Phone perso
if (! empty($arrayfields['d.phone_perso']['checked']))
{
- print '
';
- print '
';
+ print '
';
+ print $obj->phone_perso;
+ print '
';
+ if (! $i) $totalarray['nbfield']++;
}
// Phone mobile
if (! empty($arrayfields['d.phone_mobile']['checked']))
{
- print '
';
- print '
';
+ print '
';
+ print $obj->phone_mobile;
+ print '
';
+ if (! $i) $totalarray['nbfield']++;
}
- // Email
- if (! empty($arrayfields['d.email']['checked']))
+ // EMail
+ if (! empty($arrayfields['d.email']['checked']))
{
- print '
';
- print '
';
+ print "
".dol_print_email($obj->email,0,0,1)."
\n";
}
-
- if (! empty($arrayfields['d.datefin']['checked']))
+ // End of subscription date
+ $datefin=$db->jdate($obj->datefin);
+ if (! empty($arrayfields['d.datefin']['checked']))
{
- print '
';
+ if (! $i) $totalarray['nbfield']++;
}
}
}
// Fields from hook
- $parameters=array('arrayfields'=>$arrayfields);
- $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['d.datec']['checked']))
{
- print '
';
- if (! $i) $totalarray['nbfield']++;
- }
- // Phone mobile
- if (! empty($arrayfields['d.phone_mobile']['checked']))
- {
- print '
';
- print $obj->phone_mobile;
- print '
';
- if (! $i) $totalarray['nbfield']++;
- }
- // EMail
- if (! empty($arrayfields['d.email']['checked']))
- {
- print "
".dol_print_email($obj->email,0,0,1)."
\n";
- }
- // End of subscription date
- $datefin=$db->jdate($obj->datefin);
- if (! empty($arrayfields['d.datefin']['checked']))
- {
- if ($datefin)
- {
- print '
';
- if (! $i) $totalarray['nbfield']++;
- }
- }
- }
- // Fields from hook
- $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
- $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- // Date creation
- if (! empty($arrayfields['d.datec']['checked']))
- {
- print '
\n";
+ $i++;
}
+$db->free($resql);
+
+$parameters=array('sql' => $sql);
+$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+
+print "
\n";
+print '
';
+
+if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit, 1);
+
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php
index 9ea048c27fd..e6bb4a2914f 100644
--- a/htdocs/admin/agenda_other.php
+++ b/htdocs/admin/agenda_other.php
@@ -1,9 +1,9 @@
+/* Copyright (C) 2008-2016 Laurent Destailleur
* Copyright (C) 2011 Regis Houssin
- * Copyright (C) 2011-2013 Juanjo Menent
- * Copyright (C) 2015 Jean-François Ferry
- * Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2011-2013 Juanjo Menent
+ * Copyright (C) 2015 Jean-François Ferry
+ * Copyright (C) 2016 Charlie Benke
*
* 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
@@ -28,7 +28,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
if (!$user->admin)
accessforbidden();
@@ -370,6 +370,7 @@ print '
'.DOL_VERSION;
// If current version differs from last upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
{
@@ -72,30 +74,30 @@ print ' ';
// Session
$var=true;
print '
'."\n";
// Thousands
$var=!$var;
$thousand=$langs->transnoentitiesnoconv("SeparatorThousand");
if ($thousand == 'SeparatorThousand') $thousand=' '; // ' ' does not work on trans method
if ($thousand == 'None') $thousand='';
-print '
'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
$var=!$var;
$tmp=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
if (empty($tmp) && ! empty($_SERVER["WINDIR"])) $tmp='iso-8859-1'; // By default for windows
if (empty($tmp)) $tmp='utf-8'; // By default for other
if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_FILESYSTEM_ENCODING;
-print '
=> '.$langs->trans("File encoding").'
'.$tmp.'
'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
+print '
=> '.$langs->trans("File encoding").'
'.$tmp.'
'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
print '
+
\ No newline at end of file
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 1dd1c46299a..40e3b80a510 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -577,7 +577,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '
';
- print $moreforfilter;
- $parameters=array('type'=>$type);
- $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- print '
';
- }
-
- $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
- $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
-
- print '
';
-
- // Ligne des titres
- print '
';
- if (! empty($arrayfields['p.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.lastname", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.firstname']['checked'])) print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.zip']['checked'])) print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"p.zip", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.town']['checked'])) print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"p.town", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.poste']['checked'])) print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.phone']['checked'])) print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field_titre($langs->trans("PhonePerso"),$_SERVER["PHP_SELF"],"p.phone_perso", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.email']['checked'])) print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.skype']['checked'])) print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.thirdparty']['checked'])) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder);
- if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder);
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
- }
- }
}
- // Hook fields
- $parameters=array('arrayfields'=>$arrayfields);
- $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
+ if (empty($type) || $type == 'f')
+ {
+ $moreforfilter.='
';
+$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
+$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+
+print '
';
+}
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ print '
';
+ print '
';
+ }
+ }
+}
+// Fields from hook
+$parameters=array('arrayfields'=>$arrayfields);
+$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+// Date creation
+if (! empty($arrayfields['p.datec']['checked']))
+{
+ print '
';
}
}
}
// Fields from hook
- $parameters=array('arrayfields'=>$arrayfields);
- $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['p.datec']['checked']))
{
- print '
';
- }
- }
- }
- // Fields from hook
- $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
- $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- // Date creation
- if (! empty($arrayfields['p.datec']['checked']))
- {
- print '
';
}
// Convert date into timestamp format
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 9bed1ed9a82..8479bab7563 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -76,14 +76,15 @@ class ExtraFields
'price'=>'ExtrafieldPrice',
'phone'=>'ExtrafieldPhone',
'mail'=>'ExtrafieldMail',
+ 'url'=>'ExtrafieldUrl',
'select' => 'ExtrafieldSelect',
'sellist' => 'ExtrafieldSelectList',
'radio' => 'ExtrafieldRadio',
'checkbox' => 'ExtrafieldCheckBox',
'chkbxlst' => 'ExtrafieldCheckBoxFromList',
'link' => 'ExtrafieldLink',
- 'separate' => 'ExtrafieldSeparator',
'password' => 'ExtrafieldPassword',
+ 'separate' => 'ExtrafieldSeparator',
);
/**
@@ -195,6 +196,9 @@ class ExtraFields
} elseif($type=='mail') {
$typedb='varchar';
$lengthdb='128';
+ } elseif($type=='url') {
+ $typedb='varchar';
+ $lengthdb='255';
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox') ||($type=='chkbxlst')){
$typedb='text';
$lengthdb='';
@@ -425,6 +429,9 @@ class ExtraFields
} elseif($type=='mail') {
$typedb='varchar';
$lengthdb='128';
+ } elseif($type=='url') {
+ $typedb='varchar';
+ $lengthdb='255';
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') || ($type=='checkbox') || ($type=='chkbxlst')) {
$typedb='text';
$lengthdb='';
@@ -693,6 +700,10 @@ class ExtraFields
//$showsize=10;
$showsize = 'minwidth100imp';
}
+ elseif ($type == 'url')
+ {
+ $showsize='minwidth400imp';
+ }
else
{
if (round($size) < 12)
@@ -738,6 +749,10 @@ class ExtraFields
{
$out='';
}
+ elseif (in_array($type, array('mail', 'phone', 'url')))
+ {
+ $out='';
+ }
elseif ($type == 'text')
{
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -754,14 +769,6 @@ class ExtraFields
}
$out='';
}
- elseif ($type == 'mail')
- {
- $out='';
- }
- elseif ($type == 'phone')
- {
- $out='';
- }
elseif ($type == 'price')
{
$out=' '.$langs->getCurrencySymbol($conf->currency);
@@ -1236,11 +1243,15 @@ class ExtraFields
}
elseif ($type == 'mail')
{
- $value=dol_print_email($value);
+ $value=dol_print_email($value,0,0,0,64,1,1);
+ }
+ elseif ($type == 'url')
+ {
+ $value=dol_print_url($value,'_blank',32,1);
}
elseif ($type == 'phone')
{
- $value=dol_print_phone($value);
+ $value=dol_print_phone($value, '', 0, 0, '', ' ', 1);
}
elseif ($type == 'price')
{
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 48126c9afed..8a6c97e794c 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3910,15 +3910,16 @@ class Form
*
* @param string $page Page URL where form is shown
* @param int $selected Value pre-selected
- * @param string $htmlname Nom du formulaire select. Si 'none', non modifiable. Example 'remise_id'.
+ * @param string $htmlname Name of SELECT component. If 'none', not changeable. Example 'remise_id'.
* @param int $socid Third party id
* @param float $amount Total amount available
* @param string $filter SQL filter on discounts
* @param int $maxvalue Max value for lines that can be selected
* @param string $more More string to add
+ * @param int $hidelist 1=Hide list
* @return void
*/
- function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='')
+ function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0)
{
global $conf,$langs;
if ($htmlname != "none")
@@ -3929,25 +3930,30 @@ class Form
print '
';
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
{
- if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice
- else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
+ if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); // If we want deposit to be substracted to payments only and not to total of final invoice
+ else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency));
}
else
{
- if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
- else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
- }
- print '
';
- $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
- if ($filter) $newfilter.=' AND ('.$filter.')';
- $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue);
- if ($nbqualifiedlines > 0)
- {
- print ' ';
+ if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency));
+ else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency));
}
+ if (empty($hidelist)) print ': ';
print '
';
+ if (empty($hidelist))
+ {
+ print '
';
+ $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
+ if ($filter) $newfilter.=' AND ('.$filter.')';
+ $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue);
+ if ($nbqualifiedlines > 0)
+ {
+ print ' ';
+ }
+ print '
';
+ }
if ($more)
{
print '
';
@@ -5209,7 +5215,7 @@ class Form
if (empty($reshook))
{
- $num = count($object->linkedObjects);
+ $nbofdifferenttypes = count($object->linkedObjects);
print ' ';
print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, '');
@@ -5226,7 +5232,7 @@ class Form
print '
';
print '
';
- $numoutput=0;
+ $nboftypesoutput=0;
foreach($object->linkedObjects as $objecttype => $objects)
{
@@ -5286,23 +5292,28 @@ class Form
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/'.$tplpath.'/tpl'));
foreach($dirtpls as $reldir)
{
+ if ($nboftypesoutput == ($nbofdifferenttypes - 1)) // No more type to show after
+ {
+ global $noMoreLinkedObjectBlockAfter;
+ $noMoreLinkedObjectBlockAfter=1;
+ }
$res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
if ($res)
{
- $numoutput++;
+ $nboftypesoutput++;
break;
}
}
}
- if (! $numoutput)
+ if (! $nboftypesoutput)
{
print '
';
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 503c1fbb739..16b63c16601 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -180,7 +180,10 @@ class FormActions
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
else $title=$langs->trans("Actions");
- print load_fiche_titre($title,'','');
+ $buttontoaddnewevent = '';
+ $buttontoaddnewevent.= $langs->trans("AddEvent");
+ $buttontoaddnewevent.= '';
+ print load_fiche_titre($title, $buttontoaddnewevent, '');
$page=0; $param=''; $sortfield='a.datep';
@@ -250,13 +253,13 @@ class FormActions
* @param array|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too.
* @param string $htmlname Name of select field
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
- * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type
+ * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual"
* @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value
* @param int $multiselect 1=Allow multiselect of action type
* @param int $nooutput 1=No output
* @return string
*/
- function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0)
+ function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0)
{
global $langs,$user,$form,$conf;
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index ef9141dbc94..ac800d480fc 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -358,9 +358,10 @@ class FormCompany
*
* @param string $selected Title preselected
* @param string $htmlname Name of HTML select combo field
+ * @param string $morecss Add more css on SELECT element
* @return string String with HTML select
*/
- function select_civility($selected='',$htmlname='civility_id')
+ function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100')
{
global $conf,$langs,$user;
$langs->load("dict");
@@ -374,7 +375,7 @@ class FormCompany
$resql=$this->db->query($sql);
if ($resql)
{
- $out.= '
';
}
diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php
index 4b0ae91ee3f..3914b59b9f6 100644
--- a/htdocs/core/lib/ajax.lib.php
+++ b/htdocs/core/lib/ajax.lib.php
@@ -322,7 +322,8 @@ function ajax_dialog($title,$message,$w=350,$h=150)
{
global $langs;
- $msg= '
'."\n";
$msg.= '';
- }
- if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n";
+ // 3=???
+ // 4=all pages, not only menu
+ $tmp=basename($_SERVER["PHP_SELF"]);
+ if ($tmp == 'get_menudiv.php' || $conf->dol_use_jmobile == 4)
+ {
+ if (empty($conf->dol_use_jmobile) || ($conf->dol_use_jmobile != 2 && $conf->dol_use_jmobile != 3))
+ {
+ print '';
+ }
+ if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n";
+ }
}
}
@@ -1878,7 +1887,7 @@ if (! function_exists("llxFooter"))
print '
'.$msg.'
';
}
- define("MAIN_CORE_ERROR",0);
+ //define("MAIN_CORE_ERROR",0); // Constant was defined and we can't change value of a constant
}
print "\n\n";
@@ -1898,7 +1907,7 @@ if (! function_exists("llxFooter"))
if (! empty($delayedhtmlcontent)) print $delayedhtmlcontent;
// Wrapper to show tooltips
- if ($conf->use_javascript_ajax)
+ if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover))
{
print "\n\n";
print '
+
@@ -52,9 +54,26 @@ if (empty($usedolheader))
}
else
{
- $arraycss=array();
- $arrayjs=array();
-
+ $arraycss=array();
+ $arrayjs=array();
+ /*
+ $arraycss=array('/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css',
+ '/includes/jquery/plugins/datatables/extensions/Buttons/css/buttons.dataTables.min.css',
+ '/includes/jquery/plugins/datatables/extensions/ColReorder/css/colReorder.dataTables.min.css'
+ );
+ $arrayjs=array('/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js',
+ '/includes/jquery/plugins/datatables/extensions/Buttons/js/dataTables.buttons.js',
+ '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.colVis.min.js',
+ '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.html5.min.js',
+ '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.flash.min.js',
+ '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.print.min.js',
+ '/includes/jquery/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js',
+ '/includes/jszip/jszip.min.js',
+ '/includes/pdfmake/pdfmake.min.js',
+ '/includes/pdfmake/vfs_fonts.js'
+ );
+ */
+
llxHeader('','','','',0,0,$arrayjs,$arraycss);
}
@@ -66,9 +85,9 @@ else
This page is a sample of page using tables. It is designed to make test with
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
-- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 960 to enable view with jmobile)
+- jmobile (add parameter ">dol_use_jmobile=4&dol_optimize_smallscreen=1 and switch to small screen < 1000 to enable view with jmobile)
+- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
- no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
-- dataTables
- tablednd
@@ -79,10 +98,10 @@ This page is a sample of page using tables. It is designed to make test with
-
+
-
+
@@ -92,10 +111,10 @@ This page is a sample of page using tables. It is designed to make test with
-
+
-
+
@@ -105,10 +124,10 @@ This page is a sample of page using tables. It is designed to make test with
This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
-- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
+- jmobile (add parameter ">dol_use_jmobile=4&dol_optimize_smallscreen=1 and switch to small screen < 1000 to enable view with jmobile)
+- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
- no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 40ef1e6c896..6acae492c33 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -181,54 +181,58 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
+if (GETPOST('cancel')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
-include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
-
if (empty($reshook))
{
- if ($action == 'setstcomm')
- {
- $object = new Client($db);
- $result=$object->fetch(GETPOST('stcommsocid'));
- $object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm');
- $result=$object->update($object->id, $user);
- if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
+ // Selection of new fields
+ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
- $action='';
- }
-}
+ // Do we click on purge search criteria ?
+ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+ {
+ $search_nom='';
+ $search_categ=0;
+ $search_sale='';
+ $search_barcode="";
+ $search_customer_code='';
+ $search_supplier_code='';
+ $search_account_customer_code='';
+ $search_account_supplier_code='';
+ $search_town="";
+ $search_zip="";
+ $search_state="";
+ $search_country='';
+ $search_idprof1='';
+ $search_idprof2='';
+ $search_idprof3='';
+ $search_idprof4='';
+ $search_idprof5='';
+ $search_idprof6='';
+ $search_type='';
+ $search_type_thirdparty='';
+ $search_status='';
+ $search_stcomm='';
+ $search_level_from='';
+ $search_level_to='';
+ $search_array_options=array();
+ }
-// Do we click on purge search criteria ?
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
-{
- $search_nom='';
- $search_categ=0;
- $search_sale='';
- $search_barcode="";
- $search_customer_code='';
- $search_supplier_code='';
- $search_account_customer_code='';
- $search_account_supplier_code='';
- $search_town="";
- $search_zip="";
- $search_state="";
- $search_country='';
- $search_idprof1='';
- $search_idprof2='';
- $search_idprof3='';
- $search_idprof4='';
- $search_idprof5='';
- $search_idprof6='';
- $search_type='';
- $search_type_thirdparty='';
- $search_status='';
- $search_stcomm='';
- $search_level_from='';
- $search_level_to='';
- $search_array_options=array();
+ if ($action == 'setstcomm')
+ {
+ $object = new Client($db);
+ $result=$object->fetch(GETPOST('stcommsocid'));
+ $object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm');
+ $result=$object->update($object->id, $user);
+ if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
+
+ $action='';
+ }
}
if ($search_status=='') $search_status=1; // always display active thirdparty first
@@ -439,8 +443,8 @@ if (! $resql)
}
$num = $db->num_rows($resql);
-$i = 0;
-if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE))
+
+if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && $action != 'list')
{
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
@@ -848,7 +852,7 @@ print '';
print "\n";
$var=True;
-
+$i = 0;
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($resql);
diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php
index 1d8e9348f72..f6149690b7e 100644
--- a/htdocs/societe/rib.php
+++ b/htdocs/societe/rib.php
@@ -62,6 +62,10 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$hookmanager->initHooks(array('thirdpartybancard','globalcard'));
+// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
+$hookmanager->initHooks(array('thirdpartybancard'));
+
+
/*
* Actions
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index accff491427..0220f775d7b 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -994,10 +994,11 @@ else
if ($conf->use_javascript_ajax)
{
print '
';
+ }
+ }
+}
+// Fields from hook
+$parameters=array('arrayfields'=>$arrayfields);
+$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+if (! empty($arrayfields['u.datec']['checked']))
+{
+ // Date creation
+ print '
';
}
}
}
// Fields from hook
- $parameters=array('arrayfields'=>$arrayfields);
- $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
+ // Date creation
if (! empty($arrayfields['u.datec']['checked']))
{
- // Date creation
- print '
';
- }
- }
- }
- // Fields from hook
- $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
- $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- // Date creation
- if (! empty($arrayfields['u.datec']['checked']))
- {
- print '
';
- }
- // Status
- if (! empty($arrayfields['u.statut']['checked']))
- {
- $userstatic->statut=$obj->statut;
- print '
'.$userstatic->getLibStatut(3).'
';
- }
- // Action column
- print '
';
-
- print "
\n";
- $i++;
- }
-
- $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
- $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
-
- print "
";
- print "
\n";
- $db->free($result);
-}
-else
-{
- dol_print_error($db);
+ $i++;
}
+$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
+$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+
+print "
";
+print "
\n";
+$db->free($result);
+
+
llxFooter();
-
$db->close();
diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php
index e10d089c2a8..d60218fba22 100755
--- a/scripts/cron/cron_run_jobs.php
+++ b/scripts/cron/cron_run_jobs.php
@@ -82,7 +82,7 @@ if ($key != $conf->global->CRON_KEY)
// If param userlogin is reserved word 'firstadmin'
if ($userlogin == 'firstadmin')
{
- $sql='SELECT login from '.MAIN_DB_PREFIX.'user WHERE admin = 1 ORDER BY entity LIMIT 1';
+ $sql='SELECT login from '.MAIN_DB_PREFIX.'user WHERE admin = 1 and statut = 1 ORDER BY entity LIMIT 1';
$resql=$db->query($sql);
if ($resql)
{