global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")." ";
print '';
print "";
@@ -1020,7 +1020,7 @@ else
print "\n";
$var=true;
- $var=!$var;
+
print " global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)." ";
print '';
print "";
@@ -1048,7 +1048,7 @@ else
print "
";
print " \n";
- $var=!$var;
+
print " global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)." ";
print '';
print "";
@@ -1071,7 +1071,7 @@ else
print "\n";
$var=true;
- $var=!$var;
+
print " global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)." ";
print '';
print "";
@@ -1100,7 +1100,7 @@ else
print "
";
print " \n";
- $var=!$var;
+
print " global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)." ";
print '';
print "";
diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php
index abe5663084b..c097b9f39b1 100644
--- a/htdocs/admin/compta.php
+++ b/htdocs/admin/compta.php
@@ -148,7 +148,7 @@ print "\n";
foreach ($list as $key)
{
- $var=!$var;
+
print '';
diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php
index 859534d53fd..0059f337752 100644
--- a/htdocs/admin/confexped.php
+++ b/htdocs/admin/confexped.php
@@ -94,28 +94,23 @@ print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
print ' ';
$head = expedition_admin_prepare_head();
-dol_fiche_head($head, 'general', $langs->trans("Sendings"), 0, 'sending');
+dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending');
-/*
- * Formulaire parametres divers
- */
-
-$var=true;
+// Miscellaneous parameters
print '';
print '';
print ''.$langs->trans("Feature").' ';
-print ' ';
-print ''.$langs->trans("Status").' ';
+print ' ';
+print ''.$langs->trans("Status").' ';
print ' '."\n";
// expedition activation/desactivation
-$var=!$var;
-print "";
+print " ";
print ''.$langs->trans("SendingsAbility").' ';
-print '';
+print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("Required");
/*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
@@ -129,15 +124,14 @@ print " ";
print ' ';
// Bon de livraison activation/desactivation
-$var=!$var;
-print '';
+print ' ';
print '';
print $langs->trans("DeliveriesOrderAbility");
print ' '.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1);
print ' ';
-print '';
+print ' ';
print ' ';
-print '';
+print ' ';
if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
{
diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php
index 7fa47724c3d..7d7b8a8510c 100644
--- a/htdocs/admin/const.php
+++ b/htdocs/admin/const.php
@@ -197,7 +197,7 @@ print " \n";
$var=false;
print "\n";
-print ' '."\n";
+print ' '."\n";
print '';
print ' ';
print ' ';
@@ -247,11 +247,11 @@ if ($result)
while ($i < $num)
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
print "\n";
- print ' '.$obj->name.' '."\n";
+ print ''.$obj->name.' '."\n";
// Value
print '';
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index 487203c9f4d..bc3ea402704 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -266,8 +266,8 @@ foreach ($dirmodels as $reldir)
if ($module->isEnabled())
{
- $var=!$var;
- print ' '.$module->nom." \n";
+
+ print ' '.$module->nom." \n";
print $module->info();
print ' ';
@@ -406,7 +406,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
$var = !$var;
- print '';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -503,7 +503,7 @@ print " \n";
$var=true;
$var=! $var;
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnContracts").' '.img_info($langs->trans("AddCRIfTooLong")).' ';
$variablename='CONTRACT_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
@@ -519,8 +519,8 @@ else
print ' '."\n";
//Use draft Watermark
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("WatermarkOnDraftContractCards").' ';
print ' ';
print ' '."\n";
diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php
new file mode 100644
index 00000000000..0bc620c41bf
--- /dev/null
+++ b/htdocs/admin/defaultvalues.php
@@ -0,0 +1,309 @@
+
+ *
+ * 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/admin/defaultvalues.php
+ * \brief Page to set default values used used in a create form
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
+
+$langs->load("companies");
+$langs->load("products");
+$langs->load("admin");
+$langs->load("sms");
+$langs->load("other");
+$langs->load("errors");
+
+if (!$user->admin) accessforbidden();
+
+$id=GETPOST('rowid','int');
+$action=GETPOST('action','alpha');
+
+$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder'
+
+$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
+$sortfield = GETPOST("sortfield",'alpha');
+$sortorder = GETPOST("sortorder",'alpha');
+$page = GETPOST("page",'int');
+if ($page == -1) { $page = 0; }
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+if (! $sortfield) $sortfield='page,param';
+if (! $sortorder) $sortorder='ASC';
+
+$defaulturl = GETPOST('defaulturl');
+$defaultkey = GETPOST('defaultkey','alpha');
+$defaultvalue = GETPOST('defaultvalue');
+
+$defaulturl=preg_replace('/^\//', '', $defaulturl);
+
+
+/*
+ * Actions
+ */
+
+if (GETPOST('cancel')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
+
+$parameters=array('socid'=>$socid);
+$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 tests are required to be compatible with all browsers
+{
+ $defaulturl='';
+ $defaultkey='';
+ $defaultvalue='';
+ $toselect='';
+ $search_array_options=array();
+}
+
+
+if ($action == 'add' || (GETPOST('add') && $action != 'update'))
+{
+ $error=0;
+
+ if (empty($defaulturl))
+ {
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Url")), null, 'errors');
+ $error++;
+ }
+ if (empty($defaultkey))
+ {
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Key")), null, 'errors');
+ $error++;
+ }
+ if (! $error)
+ {
+ $db->begin();
+
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."default_values(type, user_id, page, param, value, entity) VALUES ('".$db->escape($mode)."', 0, '".$db->escape($defaulturl)."','".$db->escape($defaultkey)."','".$db->escape($defaultvalue)."', ".$db->escape($conf->entity).")";
+ $result = $db->query($sql);
+ if ($result > 0)
+ {
+ $db->commit();
+ setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
+ $action="";
+ $defaulturl='';
+ $defaultkey='';
+ $defaultvalue='';
+ }
+ else
+ {
+ $db->rollback();
+ setEventMessages($db->lasterror(), null, 'errors');
+ $action='';
+ }
+ }
+}
+
+// Delete line from delete picto
+if ($action == 'delete')
+{
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."default_values WHERE rowid = ".$db->escape($id);
+ // Delete const
+ $result = $db->query($sql);
+ if ($result >= 0)
+ {
+ setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+}
+
+
+
+
+
+
+/*
+ * View
+ */
+
+$form=new Form($db);
+$formadmin = new FormAdmin($db);
+
+$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración';
+llxHeader('',$langs->trans("Setup"),$wikihelp);
+
+print load_fiche_titre($langs->trans("DefaultValues"),'','title_setup');
+
+print $langs->trans("DefaultValuesDesc")." \n";
+print " \n";
+
+$param='&mode='.$mode;
+if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+if ($optioncss != '') $param.='&optioncss='.$optioncss;
+if (defaulturl) $param.='&defaulturl='.urlencode(defaulturl);
+if (defaultkey) $param.='&defaultkey='.urlencode(defaultkey);
+if (defaultvalue) $param.='&defaultvalue='.urlencode(defaultvalue);
+
+
+print '\n";
+
+
+llxFooter();
+
+$db->close();
diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php
index 597327c04ba..0280673906b 100644
--- a/htdocs/admin/delais.php
+++ b/htdocs/admin/delais.php
@@ -173,9 +173,9 @@ if ($action == 'edit')
{
foreach($delays as $delay)
{
- $var=!$var;
+
$value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0);
- print '';
+ print ' ';
print ''.img_object('',$delay['img']).' ';
print ''.$langs->trans('Delays_'.$delay['code']).' ';
print ' '.$langs->trans("days").' ';
@@ -192,7 +192,7 @@ if ($action == 'edit')
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
$var=false;
- print '';
+ print ' ';
print ''.$langs->trans("MAIN_DISABLE_METEO").' ' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . ' ';
print '
';
@@ -220,9 +220,9 @@ else
{
foreach($delays as $delay)
{
- $var=!$var;
+
$value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0);
- print ' ';
+ print ' ';
print ''.img_object('',$delay['img']).' ';
print ''.$langs->trans('Delays_'.$delay['code']).' ';
print ''.$value.' '.$langs->trans("days").' ';
@@ -239,7 +239,7 @@ else
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
$var=false;
- print '';
+ print ' ';
print ''.$langs->trans("MAIN_DISABLE_METEO").' ' . yn($conf->global->MAIN_DISABLE_METEO) . ' ';
print '
';
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 59225f2dc89..95692672523 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -78,6 +78,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
$search_country_id = GETPOST('search_country_id','int');
+$search_code = GETPOST('search_code','alpha');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('admin'));
@@ -569,6 +570,7 @@ if ($id == 10)
if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x'))
{
$search_country_id = '';
+ $search_code = '';
}
// Actions add or modify an entry into a dictionary
@@ -803,7 +805,7 @@ if ($action == $acts[0])
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'";
}
elseif ($_GET["code"]) {
- $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$_GET["code"]."'";
+ $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($_GET["code"])."'";
}
$result = $db->query($sql);
@@ -823,7 +825,7 @@ if ($action == $acts[1])
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'";
}
elseif ($_GET["code"]) {
- $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$_GET["code"]."'";
+ $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($_GET["code"])."'";
}
$result = $db->query($sql);
@@ -843,7 +845,7 @@ if ($action == 'activate_favorite')
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'";
}
elseif ($_GET["code"]) {
- $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".$_GET["code"]."'";
+ $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($_GET["code"])."'";
}
$result = $db->query($sql);
@@ -863,7 +865,7 @@ if ($action == 'disable_favorite')
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'";
}
elseif ($_GET["code"]) {
- $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".$_GET["code"]."'";
+ $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($_GET["code"])."'";
}
$result = $db->query($sql);
@@ -915,7 +917,7 @@ print " \n";
// Confirmation de la suppression de la ligne
if ($action == 'delete')
{
- print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
+ print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.urlencode($_GET["code"]).'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
}
//var_dump($elementList);
@@ -927,12 +929,9 @@ if ($id)
// Complete requete recherche valeurs avec critere de tri
$sql=$tabsql[$id];
- if ($search_country_id > 0)
- {
- if (preg_match('/ WHERE /',$sql)) $sql.= " AND ";
- else $sql.=" WHERE ";
- $sql.= " c.rowid = ".$search_country_id;
- }
+ if (! preg_match('/ WHERE /',$sql)) $sql.= " WHERE 1 = 1";
+ if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id;
+ if ($search_code != '') $sql.= natural_search("code", $search_code);
if ($sortfield)
{
@@ -961,16 +960,15 @@ if ($id)
print ' ';
print ' ';
- print '';
-
// Form to add a new line
if ($tabname[$id])
{
$alabelisused=0;
- $var=false;
-
+
$fieldlist=explode(',',$tabfield[$id]);
+ print '';
+
// Line for title
print '';
foreach ($fieldlist as $field => $value)
@@ -979,46 +977,48 @@ if ($id)
// dans les dictionnaires de donnees
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
$valuetoshow=$langs->trans($valuetoshow); // try to translate
- $align="left";
+ $class='';
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='taux') {
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
else $valuetoshow=$langs->trans("Amount");
- $align='center';
+ $class='center';
}
- if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $align="center"; $sortable=0; }
- if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $align="center"; }
- if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $align="center"; $sortable=0; }
- if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $align="center"; }
+ if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $class="center"; $sortable=0; }
+ if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $class="center"; }
+ if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $class="center"; $sortable=0; }
+ if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $class="center"; }
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
if ($fieldlist[$field]=='type') {
if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,''));
else $valuetoshow=$langs->trans("Type");
}
- if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
+ if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); $class='width100'; }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
{
- $valuetoshow=$langs->trans("Label");
- if ($id != 25) $valuetoshow.="*";
+ if ($id != 25) $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,''));
+ else $valuetoshow=$langs->trans("Label");
+ }
+ if ($fieldlist[$field]=='libelle_facture') {
+ $valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,''));
}
- if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
if ($fieldlist[$field]=='country') {
if (in_array('region_id',$fieldlist)) { print ' '; continue; } // For region page, we do not show the country input
$valuetoshow=$langs->trans("Country");
}
- if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
+ if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $class="center"; }
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
- if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $align="center"; }
+ if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $class="center"; }
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
- if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); }
- if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); }
+ if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); }
+ if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit' || $fieldlist[$field]=='metric') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; }
- if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
- if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); }
- if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
+ if ($fieldlist[$field]=='accountancy_code') { $valuetoshow=$langs->trans("AccountancyCode"); }
+ if ($fieldlist[$field]=='accountancy_code_sell') { $valuetoshow=$langs->trans("AccountancyCodeSell"); }
+ if ($fieldlist[$field]=='accountancy_code_buy') { $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountparent"); }
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
@@ -1039,7 +1039,7 @@ if ($id)
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
- if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
+ if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("WithCounter"); }
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
@@ -1051,7 +1051,7 @@ if ($id)
if ($valuetoshow != '')
{
- print '';
+ print ' ';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).' ';
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
else print $valuetoshow;
@@ -1069,7 +1069,7 @@ if ($id)
print ' ';
// Line to enter new values
- print "";
+ print ' ';
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.
@@ -1087,7 +1087,7 @@ if ($id)
$reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors;
- if ($id == 3) unset($fieldlist[2]); // Remove field ??? if ???
+ if ($id == 3) unset($fieldlist[2]); // Remove field ??? if dictionnary Regions
if (empty($reshook))
{
@@ -1106,15 +1106,22 @@ if ($id)
$colspan=count($fieldlist)+3;
if ($id == 4) $colspan++;
- if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of *
+ print '
';
+
+ /*if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of *
{
- print '* '.$langs->trans("LabelUsedByDefault").'. ';
- }
- print ' '; // Keep to have a line with enough height
+ print '* '.$langs->trans("LabelUsedByDefault").'. ';
+ }*/
}
+ print '';
-
+ print ' ';
+
+ print '
';
print '';
}
@@ -1552,7 +1573,6 @@ else
* Show list of dictionary to show
*/
- $var=true;
$lastlineisempty=false;
print '';
print '';
@@ -1570,14 +1590,14 @@ else
{
if ($showemptyline)
{
- $var=!$var;
- print ' ';
+
+ print ' ';
$showemptyline=0;
}
- $var=!$var;
+
$value=$tabname[$i];
- print '';
+ print ' ';
if (! empty($tabcond[$i]))
{
print ''.$langs->trans($tablib[$i]).' ';
@@ -1657,7 +1677,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate)
{
$country_id = (! empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0);
- print ' ';
+ print ' ';
print ' ';
print ' ';
}
@@ -1725,13 +1745,29 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
print '';
}
elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
- print ' ';
+ print '';
+ $transfound=0;
+ // Special case for labels
+ if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
+ $langs->load("bills");
+ $transkey="PaymentCondition".strtoupper($obj->code);
+ }
+ if ($langs->trans($transkey) != $transkey)
+ {
+ $transfound=1;
+ print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis"));
+ }
+ if (! $transfound)
+ {
+ print '';
+ }
+ print ' ';
}
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) {
print ' ';
}
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
- print ' ';
+ print ' ';
}
elseif ($fieldlist[$field]=='unit') {
print '';
@@ -1769,14 +1805,36 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
}
else
{
- print ' ';
- $size=''; $class='';
- if ($fieldlist[$field]=='code') $class='maxwidth100';
+ $classtd=''; $class='';
+ if ($fieldlist[$field]=='code') $classtd='width100';
+ if ($fieldlist[$field]=='affect') $class='maxwidth50';
+ if ($fieldlist[$field]=='delay') $class='maxwidth50';
if ($fieldlist[$field]=='position') $class='maxwidth50';
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent';
- if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" ';
- print ' ';
+ if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $class='maxwidth50';
+ print ' ';
+ $transfound=0;
+ if (in_array($fieldlist[$field], array('label','libelle')))
+ {
+ // Special case for labels
+ if ($tabname == MAIN_DB_PREFIX.'c_civility') {
+ $transkey="Civility".strtoupper($obj->code);
+ }
+ if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
+ $langs->load("bills");
+ $transkey="PaymentCondition".strtoupper($obj->code);
+ }
+ if ($langs->trans($transkey) != $transkey)
+ {
+ $transfound=1;
+ print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis"));
+ }
+ }
+ if (! $transfound)
+ {
+ print ' ';
+ }
print ' ';
}
}
diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php
index 41824fea4c6..7b7357ee9eb 100644
--- a/htdocs/admin/ecm.php
+++ b/htdocs/admin/ecm.php
@@ -84,8 +84,8 @@ $var=true;
$form = new Form($db);
// Mail required for members
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->trans("ECMAutoTree").' ';
print ' ';
diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php
index 6092a95d0b9..161b1aac45d 100644
--- a/htdocs/admin/events.php
+++ b/htdocs/admin/events.php
@@ -86,7 +86,7 @@ print ' ';
$head=security_prepare_head();
-dol_fiche_head($head, 'audit', $langs->trans("Security"));
+dol_fiche_head($head, 'audit', $langs->trans("Security"), -1);
$var=true;
@@ -99,8 +99,8 @@ foreach ($eventstolog as $key => $arr)
{
if ($arr['id'])
{
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.$arr['id'].' ';
print '';
$key='MAIN_LOGEVENTS_'.$arr['id'];
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index 34a561121b2..ef8b10c411f 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -72,26 +72,28 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'set_SHIPPING_FREE_TEXT')
+else if ($action == 'set_param')
{
$freetext=GETPOST('SHIPPING_FREE_TEXT'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
-
- if ($res > 0)
- setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- else
+ if ($res <= 0)
+ {
+ $error++;
setEventMessages($langs->trans("Error"), null, 'errors');
-}
-
-else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
-{
+ }
+
$draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
-
- if ($res > 0)
- setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- else
+ if ($res <= 0)
+ {
+ $error++;
setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
}
else if ($action == 'specimen')
@@ -222,11 +224,9 @@ print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
print ' ';
$head = expedition_admin_prepare_head();
-dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), 0, 'sending');
+dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending');
-/*
- * Expedition numbering model
- */
+// Shipment numbering model
print load_fiche_titre($langs->trans("SendingsNumberingModules"));
@@ -235,8 +235,8 @@ print ' ';
print ''.$langs->trans("Name").' ';
print ''.$langs->trans("Description").' ';
print ''.$langs->trans("Example").' ';
-print ''.$langs->trans("Status").' ';
-print ''.$langs->trans("ShortInfo").' ';
+print ''.$langs->trans("Status").' ';
+print ''.$langs->trans("ShortInfo").' ';
print " \n";
clearstatcache();
@@ -250,8 +250,6 @@ foreach ($dirmodels as $reldir)
$handle = opendir($dir);
if (is_resource($handle))
{
- $var=true;
-
while (($file = readdir($handle))!==false)
{
if (substr($file, 0, 15) == 'mod_expedition_' && substr($file, dol_strlen($file)-3, 3) == 'php')
@@ -268,8 +266,7 @@ foreach ($dirmodels as $reldir)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
- $var=!$var;
- print ''.$module->nom." \n";
+ print ''.$module->nom." \n";
print '';
print $module->info();
print ' ';
@@ -374,7 +371,6 @@ print " \n";
clearstatcache();
-$var=true;
foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
@@ -412,8 +408,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
- $var = !$var;
- print '';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -498,19 +493,16 @@ print ' ';
*/
print load_fiche_titre($langs->trans("OtherOptions"));
-$var=true;
+print '';
llxFooter();
$db->close();
diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php
index d682f73ce6d..8c24c49cb23 100644
--- a/htdocs/admin/expedition_extrafields.php
+++ b/htdocs/admin/expedition_extrafields.php
@@ -78,7 +78,7 @@ print " \n";
$head = expedition_admin_prepare_head();
-dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), 0, 'sending');
+dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'sending');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php
index c4d45f08ded..283eeab452a 100644
--- a/htdocs/admin/expeditiondet_extrafields.php
+++ b/htdocs/admin/expeditiondet_extrafields.php
@@ -78,7 +78,7 @@ print " \n";
$head = expedition_admin_prepare_head();
-dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), 0, 'sending');
+dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'sending');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index a26a21fbede..eda3c6bd6ae 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -275,8 +275,8 @@ foreach ($dirmodels as $reldir)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
- $var=!$var;
- print ' '.$module->nom." \n";
+
+ print ' '.$module->nom." \n";
print $module->info();
print ' ';
@@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
if (file_exists($dir.'/'.$file))
{
- $var=!$var;
+
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
@@ -412,7 +412,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
- print '';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -506,7 +506,7 @@ print " \n";
$var=true;
$var=! $var;
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnExpenseReports").' ('.$langs->trans("AddCRIfTooLong").') ';
$variablename='EXPENSEREPORT_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
@@ -522,8 +522,8 @@ else
print ' '."\n";
//Use draft Watermark
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("WatermarkOnDraftOrders").' ';
print ' ';
print ' '."\n";
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index 8e550f98c99..7f81a5d0fef 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -266,20 +266,20 @@ if ($resql)
print '';
print "";
- $var=!$var;
- print "";
+
+ print ' ';
print "".$langs->trans("Title")." ";
print " ";
print " ";
- $var=!$var;
- print "";
+
+ print ' ';
print "".$langs->trans("URL")." ";
print " ";
print " ";
- $var=!$var;
- print "";
+
+ print ' ';
print "".$langs->trans("Status")." ";
print "";
if ($result > 0 && empty($rss->error))
@@ -299,8 +299,8 @@ if ($resql)
// Logo
if ($result > 0 && empty($rss->error))
{
- $var=!$var;
- print " ";
+
+ print ' ';
print "".$langs->trans("Logo")." ";
print '';
$imageurl=$rssparser->getImageUrl();
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 42000e7176d..4e9b007ee14 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -339,7 +339,7 @@ foreach ($dirmodels as $reldir)
if ($module->isEnabled())
{
$var = !$var;
- print ' ';
+ print ' ';
echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file)));
print " \n";
@@ -530,7 +530,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
$var = !$var;
- print ' ';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -628,8 +628,8 @@ print ' ';
print $langs->trans("PaymentMode").' ';
print ' ';
print " \n";
-$var=!$var;
-print '';
+
+print ' ';
print "".$langs->trans("SuggestPaymentByRIBOnAccount")." ";
print "";
if (! empty($conf->banque->enabled))
@@ -638,7 +638,7 @@ if (! empty($conf->banque->enabled))
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE clos = 0";
$sql.= " AND courant = 1";
- $sql.= " AND entity IN (".getEntity('bank', 1).")";
+ $sql.= " AND entity IN (".getEntity('bank_account', 1).")";
$resql=$db->query($sql);
if ($resql)
{
@@ -671,8 +671,8 @@ else
print $langs->trans("BankModuleNotActive");
}
print " ";
-$var=!$var;
-print '';
+
+print ' ';
print "".$langs->trans("SuggestPaymentByChequeToAddress")." ";
print "";
print '';
@@ -683,7 +683,7 @@ $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE clos = 0";
$sql.= " AND courant = 1";
-$sql.= " AND entity IN (".getEntity('bank', 1).")";
+$sql.= " AND entity IN (".getEntity('bank_account', 1).")";
$var=True;
$resql=$db->query($sql);
if ($resql)
@@ -692,7 +692,7 @@ if ($resql)
$i = 0;
while ($i < $num)
{
- $var=!$var;
+
$row = $db->fetch_row($resql);
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("ForceInvoiceDate");
print ' ';
print $form->selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1);
@@ -737,7 +737,7 @@ $var=! $var;
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnInvoices").' '.img_info($langs->trans("AddCRIfTooLong")).' ';
$variablename='INVOICE_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
@@ -755,11 +755,11 @@ print ' \n";
print ' ';
-$var=!$var;
+
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("WatermarkOnDraftBill").' ';
print ' ';
print '';
@@ -800,7 +800,7 @@ print ' ';
print ' ';
print " \n";
-print '';
+print ' ';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").' ';
print ' ';
print " \n";
diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php
index 23ff67f92e7..9f1d3913630 100644
--- a/htdocs/admin/fckeditor.php
+++ b/htdocs/admin/fckeditor.php
@@ -159,8 +159,8 @@ else
// Si condition non remplie, on ne propose pas l'option
if (! $conditions[$const]) continue;
- $var=!$var;
- print "";
+
+ print ' ';
print ''.img_object("",$picto[$const]).' ';
print ''.$langs->trans($desc).' ';
print '';
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index 8d31db0d3af..6c73afcf8f5 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -310,8 +310,8 @@ foreach ($dirmodels as $reldir)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
- $var=!$var;
- print ' '.$module->nom." \n";
+
+ print ' '.$module->nom." \n";
print $module->info();
print ' ';
@@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir)
{
if (file_exists($dir.'/'.$file))
{
- $var=!$var;
+
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
@@ -447,7 +447,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
- print '';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -538,7 +538,7 @@ $var=! $var;
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnInterventions").' '.img_info($langs->trans("AddCRIfTooLong")).' ';
$variablename='FICHINTER_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
@@ -557,11 +557,11 @@ print " \n";
print ' ';
//Use draft Watermark
-$var=!$var;
+
print "";
print ' ';
print " ";
-print '';
+print ' ';
print $langs->trans("WatermarkOnDraftInterventionCards").' ';
print ' ';
print ' ';
@@ -573,7 +573,7 @@ $var=! $var;
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").') ';
print ' global->FICHINTER_PRINT_PRODUCTS)
diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php
index b4d379e15d1..5a69a356777 100644
--- a/htdocs/admin/geoipmaxmind.php
+++ b/htdocs/admin/geoipmaxmind.php
@@ -105,8 +105,8 @@ print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
print " \n";
-$var=!$var;
-print ''.$langs->trans("PathToGeoIPMaxmindCountryDataFile").' ';
+
+print ''.$langs->trans("PathToGeoIPMaxmindCountryDataFile").' ';
print '';
if ($geointernal) print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).' ';
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index eefa6a1fc24..193ee35a80f 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -26,6 +26,8 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
@@ -70,6 +72,26 @@ if (GETPOST('cancel'))
$action='';
}
+if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND))
+{
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+
+ $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND;
+ dol_delete_file($logofile);
+ dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND",$conf->entity);
+ $mysoc->logo='';
+
+ /*$logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small;
+ dol_delete_file($logosmallfile);
+ dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity);
+ $mysoc->logo_small='';
+
+ $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini;
+ dol_delete_file($logominifile);
+ dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity);
+ $mysoc->logo_mini='';*/
+}
+
if ($action == 'update')
{
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity);
@@ -97,7 +119,7 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())),'chaine',0,'',$conf->entity);
- if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity);
+ if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black)
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array()))));
@@ -120,9 +142,78 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
- // This one is not always defined
- if (isset($_POST["MAIN_USE_PREVIEW_TABS"])) dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["MAIN_USE_PREVIEW_TABS"],'chaine',0,'',$conf->entity);
-
+ $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
+ if ($_FILES[$varforimage]["tmp_name"])
+ {
+ if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg))
+ {
+ $original_file=$reg[1];
+
+ $isimage=image_format_supported($original_file);
+ if ($isimage >= 0)
+ {
+ dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file);
+ if (! is_dir($dirforimage))
+ {
+ dol_mkdir($dirforimage);
+ }
+ $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']);
+ if ($result > 0)
+ {
+ dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity);
+
+ // Create thumbs of logo (Note that PDF use original file and not thumbs)
+ /*
+ if ($isimage > 0)
+ {
+ // Create thumbs
+ //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
+
+ // Create small thumb, Used on logon for example
+ $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
+ if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
+ {
+ $imgThumbSmall = $reg[1]; // Save only basename
+ dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity);
+ }
+ else dol_syslog($imgThumbSmall);
+
+ // Create mini thumb, Used on menu or for setup page for example
+ $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality);
+ if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg))
+ {
+ $imgThumbMini = $reg[1]; // Save only basename
+ dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity);
+ }
+ else dol_syslog($imgThumbMini);
+ }
+ else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING);
+ */
+ }
+ else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
+ {
+ $error++;
+ $langs->load("errors");
+ $tmparray=explode(':',$result);
+ setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors');
+ }
+ else
+ {
+ $error++;
+ setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
+ }
+ }
+ else
+ {
+ $error++;
+ $langs->load("errors");
+ setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
+ }
+ }
+ }
+
+
+
$_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
@@ -152,30 +243,27 @@ if ($action == 'edit') // Edit
//WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- print '';
+ print ' ';
print ' ';
print ' ';
clearstatcache();
- $var=true;
-
+
print ' ';
print '';
- print ''.$langs->trans("Parameters").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("Language").' ';
print ' ';
print ' ';
// Default language
- $var=!$var;
- print ''.$langs->trans("DefaultLanguage").' ';
+ print ' '.$langs->trans("DefaultLanguage").' ';
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'main_lang_default', 1, 0, 0, 0, 0, 'minwidth300');
print ' ';
print ' ';
print ' ';
// Multilingual GUI
- $var=!$var;
- print ''.$langs->trans("EnableMultilangInterface").' ';
+ print ' '.$langs->trans("EnableMultilangInterface").' ';
print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
print ' ';
print ' ';
@@ -191,12 +279,10 @@ if ($action == 'edit') // Edit
if (! empty($searchform))
{
print '';
- print ''.$langs->trans("PermanentLeftSearchForm").' '.$langs->trans("Activated").' ';
- $var=True;
+ print ''.$langs->trans("PermanentLeftSearchForm").' '.$langs->trans("Activated").' ';
foreach ($searchform as $key => $value)
{
- $var=!$var;
- print ''.$searchformtitle[$key].' ';
+ print ' '.$searchformtitle[$key].' ';
print $form->selectyesno($searchform[$key],$searchformconst[$key],1);
print ' ';
}
@@ -206,76 +292,59 @@ if ($action == 'edit') // Edit
// Other
print '';
- print ''.$langs->trans("Parameters").' '.$langs->trans("Value").' ';
- print ' ';
- print ' ';
-
- // Show logo
- $var=!$var;
- print ''.$langs->trans("EnableShowLogo").' ';
- print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1);
- print ' ';
+ print ''.$langs->trans("Parameters").' '.$langs->trans("Value").' ';
print ' ';
print ' ';
// Max size of lists
- $var=!$var;
- print ''.$langs->trans("DefaultMaxSizeList").' ';
+ print ''.$langs->trans("DefaultMaxSizeList").' ';
print ' ';
print ' ';
// Max size of short lists on customer card
- $var=!$var;
- print ''.$langs->trans("DefaultMaxSizeShortList").' ';
+ print ''.$langs->trans("DefaultMaxSizeShortList").' ';
print ' ';
print ' ';
- // Disable javascript and ajax
- $var=!$var;
- print ''.$langs->trans("DisableJavascript").' ';
+ // show input border
+ /*
+ print ' '.$langs->trans("showInputBorder").' ';
+ print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
+ print ' ';
+ print ' ';
+ print ' ';
+ */
+
+ // Disable javascript and ajax
+ print ''.$langs->trans("DisableJavascript").' ';
print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1);
print ' ';
print ' ';
print ' ';
- // Activate preview tab on element card
- if (class_exists("Imagick"))
- {
- $var=!$var;
- print ''.$langs->trans("UsePreviewTabs").' ';
- print $form->selectyesno('MAIN_USE_PREVIEW_TABS',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
- print ' ';
- print ' ';
- print ' ';
- }
-
// First day for weeks
- $var=!$var;
- print ''.$langs->trans("WeekStartOnDay").' ';
+ print ' '.$langs->trans("WeekStartOnDay").' ';
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0);
print ' ';
print ' ';
print ' ';
// DefaultWorkingDays
- $var=!$var;
- print ''.$langs->trans("DefaultWorkingDays").' ';
+ print ' '.$langs->trans("DefaultWorkingDays").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// DefaultWorkingHours
- $var=!$var;
- print ''.$langs->trans("DefaultWorkingHours").' ';
+ print ' '.$langs->trans("DefaultWorkingHours").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// Firstname/Name
- $var=!$var;
- print ''.$langs->trans("FirstnameNamePosition").' ';
+ print ' '.$langs->trans("FirstnameNamePosition").' ';
$array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"),1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION',$array,(isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
print ' ';
@@ -283,49 +352,52 @@ if ($action == 'edit') // Edit
print ' ';
// Hide unauthorized button
- $var=!$var;
- print ''.$langs->trans("ButtonHideUnauthorized").' ';
+ print ' '.$langs->trans("ButtonHideUnauthorized").' ';
print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1);
print ' ';
print ' ';
print ' ';
- // Hide helpcenter link on login page
- $var=!$var;
- print ''.$langs->trans("DisableLinkToHelpCenter").' ';
- print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
- print ' ';
+ // Show logo
+ print ''.$langs->trans("EnableShowLogo").' ';
+ print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1);
+ print ' ';
print ' ';
print ' ';
-
- // Hide wiki link on login page
- $var=!$var;
- print ''.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).' ';
- print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
- print ' ';
+
+ // Hide version link
+ /*
+
+ print ''.$langs->trans("HideVersionLink").' ';
+ print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
+ print ' ';
print ' ';
print ' ';
-
+ */
+
// Show bugtrack link
- $var=!$var;
- print ''.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).' ';
+ print ' '.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).' ';
print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
print ' ';
print ' ';
print ' ';
- // Message on login page
- $var=!$var;
- print ''.$langs->trans("MessageLogin").' ';
-
- $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
- $doleditor->Create();
-
- print ' '."\n";
+ // Hide wiki link on login page
+ print ''.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).' ';
+ print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
+ print ' ';
+ print ' ';
+ print ' ';
+ // Hide helpcenter link on login page
+ print ''.$langs->trans("DisableLinkToHelpCenter").' ';
+ print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
+ print ' ';
+ print ' ';
+ print ' ';
+
// Message of the day on home page
- $var=!$var;
- print ''.$langs->trans("MessageOfDay").' ';
+ print ' '.$langs->trans("MessageOfDay").' ';
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
$doleditor->Create();
@@ -334,6 +406,39 @@ if ($action == 'edit') // Edit
print '
'."\n";
+ print ' ';
+
+ // Other
+ print '';
+ print ''.$langs->trans("LoginPage").' ';
+ print ' ';
+ print ' ';
+
+ // Message on login page
+ print ''.$langs->trans("MessageLogin").' ';
+ $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
+ $doleditor->Create();
+ print ' '."\n";
+
+ // Background
+
+ print ''.$langs->trans("BackgroundImageLogin").' (png,jpg) ';
+ print '';
+ print '
';
+ if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
+ print '
'.img_delete($langs->trans("Delete")).' ';
+ if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
+ print ' ';
+ print '
';
+ }
+ } else {
+ print '
';
+ }
+ print '
';
+ print ' ';
+
+ print '
'."\n";
+
print '';
print '
';
@@ -345,14 +450,11 @@ if ($action == 'edit') // Edit
}
else // Show
{
- $var=true;
-
// Language
print '
';
- print ''.$langs->trans("Parameters").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("Language").' ';
- $var=!$var;
- print ''.$langs->trans("DefaultLanguage").' ';
+ print ' '.$langs->trans("DefaultLanguage").' ';
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
print ($s?$s.' ':'');
print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
@@ -361,9 +463,8 @@ else // Show
if ($user->admin && $conf->global->MAIN_LANG_DEFAULT!='auto') print info_admin($langs->trans("SubmitTranslation".($conf->global->MAIN_LANG_DEFAULT=='en_US'?'ENUS':''),$conf->global->MAIN_LANG_DEFAULT),1);
print ' ';
print " ";
-
- $var=!$var;
- print ''.$langs->trans("EnableMultilangInterface").' ' . yn($conf->global->MAIN_MULTILANGS) . ' ';
+
+ print ''.$langs->trans("EnableMultilangInterface").' ' . yn($conf->global->MAIN_MULTILANGS) . ' ';
print ' ';
print " ";
@@ -379,12 +480,11 @@ else // Show
if (! empty($searchform))
{
print '';
- print ''.$langs->trans("PermanentLeftSearchForm").' '.$langs->trans("Activated").' ';
- $var=true;
+ print ''.$langs->trans("PermanentLeftSearchForm").' '.$langs->trans("Activated").' ';
foreach ($searchform as $key => $value)
{
- $var=!$var;
- print ''.$searchformtitle[$key].' '.yn($searchformconst[$key]).' ';
+
+ print ''.$searchformtitle[$key].' '.yn($searchformconst[$key]).' ';
print '';
if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key]));
print ' ';
@@ -394,69 +494,53 @@ else // Show
}
// Other
- $var=true;
print '';
- print ''.$langs->trans("Parameters").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("Parameters").' '.$langs->trans("Value").' ';
- $var=!$var;
- print ''.$langs->trans("EnableShowLogo").' ' . yn($conf->global->MAIN_SHOW_LOGO) . ' ';
- print ' ';
- print " ";
-
- $var=!$var;
- print ''.$langs->trans("DefaultMaxSizeList").' ' . $conf->global->MAIN_SIZE_LISTE_LIMIT . ' ';
+ print ''.$langs->trans("DefaultMaxSizeList").' ' . $conf->global->MAIN_SIZE_LISTE_LIMIT . ' ';
print ' ';
print " ";
- $var=!$var;
- print ''.$langs->trans("DefaultMaxSizeShortList").' ' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . ' ';
+ print ''.$langs->trans("DefaultMaxSizeShortList").' ' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . ' ';
print ' ';
print " ";
+ /*
+ print ''.$langs->trans("showInputBorder").' ';
+ print yn($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)." ";
+ print ' ';
+ print " ";
+ */
+
// Disable javascript/ajax
- $var=!$var;
- print ''.$langs->trans("DisableJavascript").' ';
+ print ' '.$langs->trans("DisableJavascript").' ';
print yn($conf->global->MAIN_DISABLE_JAVASCRIPT)." ";
- print ' ';
- print " ";
-
- // Activate preview tab on element card
- if (class_exists("Imagick"))
- {
- $var=!$var;
- print ''.$langs->trans("UsePreviewTabs").' ';
- print yn(isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0)." ";
- print ' ';
- print " ";
- }
+ print ' ';
+ print "";
// First day for weeks
- $var=!$var;
- print ''.$langs->trans("WeekStartOnDay").' ';
+ print ' '.$langs->trans("WeekStartOnDay").' ';
print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'));
print ' ';
print ' ';
print ' ';
// DefaultWorkingDays
- $var=!$var;
- print ''.$langs->trans("DefaultWorkingDays").' ';
+ print ' '.$langs->trans("DefaultWorkingDays").' ';
print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5';
print ' ';
print ' ';
print ' ';
// DefaultWorkingHours
- $var=!$var;
- print ''.$langs->trans("DefaultWorkingHours").' ';
+ print ' '.$langs->trans("DefaultWorkingHours").' ';
print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18';
print ' ';
print ' ';
print ' ';
// Firstname / Name position
- $var=!$var;
- print ''.$langs->trans("FirstnameNamePosition").' ';
+ print ' '.$langs->trans("FirstnameNamePosition").' ';
if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Lastname"); }
else { print $langs->trans("Lastname").' '.$langs->trans("Firstname"); }
print ' ';
@@ -464,46 +548,78 @@ else // Show
print ' ';
// Hide unauthorized button
- $var=!$var;
- print ''.$langs->trans("ButtonHideUnauthorized").' ';
+ print ' '.$langs->trans("ButtonHideUnauthorized").' ';
print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1);
print ' ';
- // Link to help center
- $var=!$var;
- print ''.$langs->trans("DisableLinkToHelpCenter").' ';
- print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1);
- print ' ';
+ // Show logo
+ print ''.$langs->trans("EnableShowLogo").' ' . yn($conf->global->MAIN_SHOW_LOGO) . ' ';
+ print ' ';
+ print " ";
- // Link to wiki help
- $var=!$var;
- print ''.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).' ';
- print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1);
- print ' ';
-
- // Show bugtrack link
- $var=!$var;
- print ''.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).' ';
+ // Hide version link
+ /*
+ print ' '.$langs->trans("HideVersionLink").' ';
+ print yn($conf->global->MAIN_HIDE_VERSION);
+ print ' ';
+ print ' ';
+ print ' ';
+ */
+
+ // Show bugtrack link
+ print ''.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).' ';
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)." ";
print ' ';
print " ";
- // Message login
- $var=!$var;
- print ''.$langs->trans("MessageLogin").' ';
- if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
- else print ' ';
- print ' '."\n";
+ // Link to wiki help
+ print ''.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).' ';
+ print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1);
+ print ' ';
+
+ // Link to help center
+ print ''.$langs->trans("DisableLinkToHelpCenter").' ';
+ print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1);
+ print ' ';
// Message of the day
- $var=!$var;
- print ''.$langs->trans("MessageOfDay").' ';
+ print ' '.$langs->trans("MessageOfDay").' ';
if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD);
else print ' ';
print ' '."\n";
print '
'."\n";
+ print ' ';
+
+ // Login page
+ print '';
+ print ''.$langs->trans("LoginPage").' ';
+
+ // Message login
+ print ''.$langs->trans("MessageLogin").' ';
+ if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
+ else print ' ';
+ print ' '."\n";
+
+ // Background login
+
+ print ''.$langs->trans("BackgroundImageLogin").' ';
+ print '';
+ print $conf->global->MAIN_LOGIN_BACKGROUND;
+ if ($conf->global->MAIN_LOGIN_BACKGROUND && is_file($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND))
+ {
+ print '
';
+ }
+ else
+ {
+ print '
';
+ }
+ print '
';
+ print ' ';
+
+ print '
'."\n";
+
print '';
diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php
index 6778f618265..e9d38ad3776 100644
--- a/htdocs/admin/index.php
+++ b/htdocs/admin/index.php
@@ -1,7 +1,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur
- * Copyright (C) 2015 Jean-François Ferry
+ * Copyright (C) 2015 Jean-François Ferry
*
* 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
diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php
index 5c1b0fcad11..770d91d1d11 100644
--- a/htdocs/admin/ldap.php
+++ b/htdocs/admin/ldap.php
@@ -110,8 +110,8 @@ print ''.$langs->trans("LDAPSynchronization").' ';
print "\n";
// Synchro utilisateurs/groupes active
-$var=!$var;
-print ''.$langs->trans("LDAPDnSynchroActive").' ';
+
+print ' '.$langs->trans("LDAPDnSynchroActive").' ';
$arraylist=array();
$arraylist['0']=$langs->trans("No");
$arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr");
@@ -127,8 +127,8 @@ print ' ';
// Synchro contact active
if (! empty($conf->societe->enabled))
{
- $var=!$var;
- print ''.$langs->trans("LDAPDnContactActive").' ';
+
+ print ' '.$langs->trans("LDAPDnContactActive").' ';
$arraylist=array();
$arraylist['0']=$langs->trans("No");
$arraylist['1']=$langs->trans("DolibarrToLDAP");
@@ -139,8 +139,8 @@ if (! empty($conf->societe->enabled))
// Synchro member active
if (! empty($conf->adherent->enabled))
{
- $var=!$var;
- print ' '.$langs->trans("LDAPDnMemberActive").' ';
+
+ print ' '.$langs->trans("LDAPDnMemberActive").' ';
$arraylist=array();
$arraylist['0']=$langs->trans("No");
$arraylist['1']=$langs->trans("DolibarrToLDAP");
@@ -156,8 +156,8 @@ print ' '.$langs->trans("Example").' ';
print " \n";
// Type
-$var=!$var;
-print ''.$langs->trans("Type").' ';
+
+print ' '.$langs->trans("Type").' ';
$arraylist=array();
$arraylist['activedirectory']='Active Directory';
$arraylist['openldap']='OpenLdap';
@@ -166,8 +166,8 @@ print $form->selectarray('type',$arraylist,$conf->global->LDAP_SERVER_TYPE);
print ' ';
// Version
-$var=!$var;
-print ''.$langs->trans("Version").' ';
+
+print ' '.$langs->trans("Version").' ';
$arraylist=array();
$arraylist['3']='Version 3';
$arraylist['2']='Version 2';
@@ -175,22 +175,22 @@ print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION',$arraylist,$conf->global-
print ' '.$langs->trans("LDAPServerProtocolVersion").' ';
// Serveur primaire
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("LDAPPrimaryServer").' ';
print ' ';
print ' '.$langs->trans("LDAPServerExample").' ';
// Serveur secondaire
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("LDAPSecondaryServer").' ';
print ' ';
print ' '.$langs->trans("LDAPServerExample").' ';
// Port
-$var=!$var;
-print ''.$langs->trans("LDAPServerPort").' ';
+
+print ' '.$langs->trans("LDAPServerPort").' ';
if (! empty($conf->global->LDAP_SERVER_PORT))
{
print ' ';
@@ -202,14 +202,14 @@ else
print ' '.$langs->trans("LDAPServerPortExample").' ';
// DNserver
-$var=!$var;
-print ''.$langs->trans("LDAPServerDn").' ';
+
+print ' '.$langs->trans("LDAPServerDn").' ';
print ' ';
print ' '.$langs->trans("LDAPServerDnExample").' ';
// Utiliser TLS
-$var=!$var;
-print ''.$langs->trans("LDAPServerUseTLS").' ';
+
+print ' '.$langs->trans("LDAPServerUseTLS").' ';
$arraylist=array();
$arraylist['0']=$langs->trans("No");
$arraylist['1']=$langs->trans("Yes");
@@ -221,14 +221,14 @@ print ' '.$langs->trans("ForANonAnonymousAccess").' ';
print " \n";
// DNAdmin
-$var=!$var;
-print ''.$langs->trans("LDAPAdminDn").' ';
+
+print ' '.$langs->trans("LDAPAdminDn").' ';
print ' ';
print ' '.$langs->trans("LDAPAdminDnExample").' ';
// Pass
-$var=!$var;
-print ''.$langs->trans("LDAPPassword").' ';
+
+print ' '.$langs->trans("LDAPPassword").' ';
if (! empty($conf->global->LDAP_ADMIN_PASS))
{
print ' ';// je le met en visible pour test
diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php
index 4901c127e8b..27e32f8cd7c 100644
--- a/htdocs/admin/ldap_contacts.php
+++ b/htdocs/admin/ldap_contacts.php
@@ -125,16 +125,16 @@ print " \n";
// DN Pour les contacts
-$var=!$var;
-print ''.$langs->trans("LDAPContactDn").' ';
+
+print ' '.$langs->trans("LDAPContactDn").' ';
print ' ';
print ' '.$langs->trans("LDAPContactDnExample").' ';
print ' ';
print ' ';
// List of object class used to define attributes in structure
-$var=!$var;
-print ''.$langs->trans("LDAPContactObjectClassList").' ';
+
+print ' '.$langs->trans("LDAPContactObjectClassList").' ';
print ' ';
print ' '.$langs->trans("LDAPContactObjectClassListExample").' ';
print ' ';
@@ -152,112 +152,112 @@ print ''.$langs->trans("LDAPNamingAttribute").' ';
print " \n";
// Common name
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFullname").' ';
+
+print ' '.$langs->trans("LDAPFieldFullname").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFullnameExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FULLNAME?' checked':'')."> ";
print ' ';
// Name
-$var=!$var;
-print ''.$langs->trans("LDAPFieldName").' ';
+
+print ' '.$langs->trans("LDAPFieldName").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldNameExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_NAME?' checked':'')."> ";
print ' ';
// Firstname
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFirstName").' ';
+
+print ' '.$langs->trans("LDAPFieldFirstName").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFirstNameExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME?' checked':'')."> ";
print ' ';
// Company
-$var=!$var;
-print ''.$langs->trans("LDAPFieldCompany").' ';
+
+print ' '.$langs->trans("LDAPFieldCompany").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldCompanyExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COMPANY?' checked':'')."> ";
print ' ';
// Mail
-$var=!$var;
-print ''.$langs->trans("LDAPFieldMail").' ';
+
+print ' '.$langs->trans("LDAPFieldMail").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldMailExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MAIL?' checked':'')."> ";
print ' ';
// Phone pro
-$var=!$var;
-print ''.$langs->trans("LDAPFieldPhone").' ';
+
+print ' '.$langs->trans("LDAPFieldPhone").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldPhoneExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_PHONE?' checked':'')."> ";
print ' ';
// Phone home
-$var=!$var;
-print ''.$langs->trans("LDAPFieldHomePhone").' ';
+
+print ' '.$langs->trans("LDAPFieldHomePhone").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldHomePhoneExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE?' checked':'')."> ";
print ' ';
// Mobile
-$var=!$var;
-print ''.$langs->trans("LDAPFieldMobile").' ';
+
+print ' '.$langs->trans("LDAPFieldMobile").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldMobileExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked':'')."> ";
print ' ';
// Skype
-$var=!$var;
-print ''.$langs->trans("LDAPFieldSkype").' ';
+
+print ' '.$langs->trans("LDAPFieldSkype").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldSkypeExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_SKYPE?' checked':'')."> ";
print ' ';
// Fax
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFax").' ';
+
+print ' '.$langs->trans("LDAPFieldFax").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFaxExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FAX?' checked':'')."> ";
print ' ';
// Address
-$var=!$var;
-print ''.$langs->trans("LDAPFieldAddress").' ';
+
+print ' '.$langs->trans("LDAPFieldAddress").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldAddressExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ADDRESS?' checked':'')."> ";
print ' ';
// ZIP
-$var=!$var;
-print ''.$langs->trans("LDAPFieldZip").' ';
+
+print ' '.$langs->trans("LDAPFieldZip").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldZipExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ZIP?' checked':'')."> ";
print ' ';
// TOWN
-$var=!$var;
-print ''.$langs->trans("LDAPFieldTown").' ';
+
+print ' '.$langs->trans("LDAPFieldTown").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldTownExample").' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_TOWN?' checked':'')."> ";
print ' ';
// COUNTRY
-$var=!$var;
-print ''.$langs->trans("LDAPFieldCountry").' ';
+
+print ' '.$langs->trans("LDAPFieldCountry").' ';
print ' ';
print ' ';
print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COUNTRY?' checked':'')."> ";
diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php
index 90946f5ea44..192b11bfd8d 100644
--- a/htdocs/admin/ldap_groups.php
+++ b/htdocs/admin/ldap_groups.php
@@ -116,16 +116,16 @@ print ''.$langs->trans("LDAPSynchronizeGroups").' ';
print " \n";
// DN pour les groupes
-$var=!$var;
-print ''.$langs->trans("LDAPGroupDn").' ';
+
+print ' '.$langs->trans("LDAPGroupDn").' ';
print ' ';
print ' '.$langs->trans("LDAPGroupDnExample").' ';
print ' ';
print ' ';
// List of object class used to define attributes in structure
-$var=!$var;
-print ''.$langs->trans("LDAPGroupObjectClassList").' ';
+
+print ' '.$langs->trans("LDAPGroupObjectClassList").' ';
print ' ';
print ' '.$langs->trans("LDAPGroupObjectClassListExample").' ';
print ' ';
@@ -145,16 +145,16 @@ print " \n";
// Filtre
// Common name
-$var=!$var;
-print ''.$langs->trans("LDAPFieldName").' ';
+
+print ' '.$langs->trans("LDAPFieldName").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldCommonNameExample").' ';
print ' global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_FULLNAME)?' checked':'')."> ";
print ' ';
// Name
-/*$var=!$var;
-print ''.$langs->trans("LDAPFieldName").' ';
+/*
+print ' '.$langs->trans("LDAPFieldName").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldNameExample").' ';
print ' global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_NAME?' checked':'')."> ";
@@ -162,16 +162,16 @@ print ' ';
*/
// Description
-$var=!$var;
-print ''.$langs->trans("LDAPFieldDescription").' ';
+
+print ' '.$langs->trans("LDAPFieldDescription").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldDescriptionExample").' ';
print ' global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_DESCRIPTION)?' checked':'')."> ";
print ' ';
// User group
-$var=!$var;
-print ''.$langs->trans("LDAPFieldGroupMembers").' ';
+
+print ' '.$langs->trans("LDAPFieldGroupMembers").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldGroupMembersExample").' ';
print ' global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)?' checked':'')."> ";
diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php
index 52117961b54..8c7291c3dc4 100644
--- a/htdocs/admin/ldap_members.php
+++ b/htdocs/admin/ldap_members.php
@@ -142,24 +142,24 @@ print ''.$langs->trans("LDAPSynchronizeMembers").' ';
print " \n";
// DN Pour les adherents
-$var=!$var;
-print ''.$langs->trans("LDAPMemberDn").' ';
+
+print ' '.$langs->trans("LDAPMemberDn").' ';
print ' ';
print ' '.$langs->trans("LDAPMemberDnExample").' ';
print ' ';
print ' ';
// List of object class used to define attributes in structure
-$var=!$var;
-print ''.$langs->trans("LDAPMemberObjectClassList").' ';
+
+print ' '.$langs->trans("LDAPMemberObjectClassList").' ';
print ' ';
print ' '.$langs->trans("LDAPMemberObjectClassListExample").' ';
print ' ';
print ' ';
// Filter, used to filter search
-$var=!$var;
-print ''.$langs->trans("LDAPFilterConnection").' ';
+
+print ' '.$langs->trans("LDAPFilterConnection").' ';
print ' ';
print ' '.$langs->trans("LDAPFilterConnectionExample").' ';
print ' ';
@@ -179,208 +179,208 @@ print " \n";
// Filtre
// Common name
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFullname").' ';
+
+print ' '.$langs->trans("LDAPFieldFullname").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFullnameExample").' ';
print ' global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_FULLNAME)?' checked':'')."> ";
print ' ';
// Name
-$var=!$var;
-print ''.$langs->trans("LDAPFieldName").' ';
+
+print ' '.$langs->trans("LDAPFieldName").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldNameExample").' ';
print ' global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_NAME)?' checked':'')."> ";
print ' ';
// Firstname
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFirstName").' ';
+
+print ' '.$langs->trans("LDAPFieldFirstName").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFirstNameExample").' ';
print ' ';
print ' ';
// Login unix
-$var=!$var;
-print ''.$langs->trans("LDAPFieldLoginUnix").' ';
+
+print ' '.$langs->trans("LDAPFieldLoginUnix").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldLoginExample").' ';
print ' global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN)?' checked':'')."> ";
print ' ';
// Login samba
-$var=!$var;
-print ''.$langs->trans("LDAPFieldLoginSamba").' ';
+
+print ' '.$langs->trans("LDAPFieldLoginSamba").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldLoginSambaExample").' ';
print ' global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN_SAMBA)?' checked':'')."> ";
print ' ';
// Password not crypted
-$var=!$var;
-print ''.$langs->trans("LDAPFieldPasswordNotCrypted").' ';
+
+print ' '.$langs->trans("LDAPFieldPasswordNotCrypted").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldPasswordExample").' ';
print ' ';
print ' ';
// Password crypted
-$var=!$var;
-print ''.$langs->trans("LDAPFieldPasswordCrypted").' ';
+
+print ' '.$langs->trans("LDAPFieldPasswordCrypted").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldPasswordExample").' ';
print ' ';
print ' ';
// Mail
-$var=!$var;
-print ''.$langs->trans("LDAPFieldMail").' ';
+
+print ' '.$langs->trans("LDAPFieldMail").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldMailExample").' ';
print ' global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_MAIL)?' checked':'')."> ";
print ' ';
// Phone pro
-$var=!$var;
-print ''.$langs->trans("LDAPFieldPhone").' ';
+
+print ' '.$langs->trans("LDAPFieldPhone").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldPhoneExample").' ';
print ' ';
print ' ';
// Phone perso
-$var=!$var;
-print ''.$langs->trans("LDAPFieldHomePhone").' ';
+
+print ' '.$langs->trans("LDAPFieldHomePhone").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldHomePhoneExample").' ';
print ' ';
print ' ';
// Mobile
-$var=!$var;
-print ''.$langs->trans("LDAPFieldMobile").' ';
+
+print ' '.$langs->trans("LDAPFieldMobile").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldMobileExample").' ';
print ' ';
print ' ';
// Skype
-$var=!$var;
-print ''.$langs->trans("LDAPFieldSkype").' ';
+
+print ' '.$langs->trans("LDAPFieldSkype").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldSkypeExample").' ';
print ' ';
print ' ';
// Fax
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFax").' ';
+
+print ' '.$langs->trans("LDAPFieldFax").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFaxExample").' ';
print ' ';
print ' ';
// Address
-$var=!$var;
-print ''.$langs->trans("LDAPFieldAddress").' ';
+
+print ' '.$langs->trans("LDAPFieldAddress").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldAddressExample").' ';
print ' ';
print ' ';
// ZIP
-$var=!$var;
-print ''.$langs->trans("LDAPFieldZip").' ';
+
+print ' '.$langs->trans("LDAPFieldZip").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldZipExample").' ';
print ' ';
print ' ';
// TOWN
-$var=!$var;
-print ''.$langs->trans("LDAPFieldTown").' ';
+
+print ' '.$langs->trans("LDAPFieldTown").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldTownExample").' ';
print ' ';
print ' ';
// COUNTRY
-$var=!$var;
-print ''.$langs->trans("LDAPFieldCountry").' ';
+
+print ' '.$langs->trans("LDAPFieldCountry").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// Description
-$var=!$var;
-print ''.$langs->trans("LDAPFieldDescription").' ';
+
+print ' '.$langs->trans("LDAPFieldDescription").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldDescriptionExample").' ';
print ' ';
print ' ';
// Public Note
-$var=!$var;
-print ''.$langs->trans("LDAPFieldNotePublic").' ';
+
+print ' '.$langs->trans("LDAPFieldNotePublic").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldNotePublicExample").' ';
print ' ';
print ' ';
// Birthday
-$var=!$var;
-print ''.$langs->trans("LDAPFieldBirthdate").' ';
+
+print ' '.$langs->trans("LDAPFieldBirthdate").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// Status
-$var=!$var;
-print ''.$langs->trans("LDAPFieldStatus").' ';
+
+print ' '.$langs->trans("LDAPFieldStatus").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// First subscription date
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFirstSubscriptionDate").' ';
+
+print ' '.$langs->trans("LDAPFieldFirstSubscriptionDate").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// First subscription amount
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFirstSubscriptionAmount").' ';
+
+print ' '.$langs->trans("LDAPFieldFirstSubscriptionAmount").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// Last subscription date
-$var=!$var;
-print ''.$langs->trans("LDAPFieldLastSubscriptionDate").' ';
+
+print ' '.$langs->trans("LDAPFieldLastSubscriptionDate").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// Last subscription amount
-$var=!$var;
-print ''.$langs->trans("LDAPFieldLastSubscriptionAmount").' ';
+
+print ' '.$langs->trans("LDAPFieldLastSubscriptionAmount").' ';
print ' ';
print ' ';
print ' ';
print ' ';
// End last subscriptions
-$var=!$var;
-print ''.$langs->trans("LDAPFieldEndLastSubscription").' ';
+
+print ' '.$langs->trans("LDAPFieldEndLastSubscription").' ';
print ' ';
print ' ';
print ' ';
diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php
index 45043b8a52b..79f34001a63 100644
--- a/htdocs/admin/ldap_users.php
+++ b/htdocs/admin/ldap_users.php
@@ -129,24 +129,24 @@ print ''.$langs->trans("LDAPSynchronizeUsers").' ';
print " \n";
// DN Pour les utilisateurs
-$var=!$var;
-print ''.$langs->trans("LDAPUserDn").' ';
+
+print ' '.$langs->trans("LDAPUserDn").' ';
print ' ';
print ' '.$langs->trans("LDAPUserDnExample").' ';
print ' ';
print ' ';
// List of object class used to define attributes in structure
-$var=!$var;
-print ''.$langs->trans("LDAPUserObjectClassList").' ';
+
+print ' '.$langs->trans("LDAPUserObjectClassList").' ';
print ' ';
print ' '.$langs->trans("LDAPUserObjectClassListExample").' ';
print ' ';
print ' ';
// Filter, used to filter search
-$var=!$var;
-print ''.$langs->trans("LDAPFilterConnection").' ';
+
+print ' '.$langs->trans("LDAPFilterConnection").' ';
print ' ';
print ' '.$langs->trans("LDAPFilterConnectionExample").' ';
print ' ';
@@ -164,120 +164,120 @@ print ''.$langs->trans("LDAPNamingAttribute").' ';
print " \n";
// Common name
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFullname").' ';
+
+print ' '.$langs->trans("LDAPFieldFullname").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFullnameExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FULLNAME)?' checked':'')."> ";
print ' ';
// Name
-$var=!$var;
-print ''.$langs->trans("LDAPFieldName").' ';
+
+print ' '.$langs->trans("LDAPFieldName").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldNameExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_NAME)?' checked':'')."> ";
print ' ';
// Firstname
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFirstName").' ';
+
+print ' '.$langs->trans("LDAPFieldFirstName").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFirstNameExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FIRSTNAME)?' checked':'')."> ";
print ' ';
// Login unix
-$var=!$var;
-print ''.$langs->trans("LDAPFieldLoginUnix").' ';
+
+print ' '.$langs->trans("LDAPFieldLoginUnix").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldLoginExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN)?' checked':'')."> ";
print ' ';
// Login samba
-$var=!$var;
-print ''.$langs->trans("LDAPFieldLoginSamba").' ';
+
+print ' '.$langs->trans("LDAPFieldLoginSamba").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldLoginSambaExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN_SAMBA)?' checked':'')."> ";
print ' ';
// Password not crypted
-$var=!$var;
-print ''.$langs->trans("LDAPFieldPasswordNotCrypted").' ';
+
+print ' '.$langs->trans("LDAPFieldPasswordNotCrypted").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldPasswordExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PASSWORD)?' checked':'')."> ";
print ' ';
// Password crypted
-$var=!$var;
-print ''.$langs->trans("LDAPFieldPasswordCrypted").' ';
+
+print ' '.$langs->trans("LDAPFieldPasswordCrypted").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldPasswordExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PASSWORD_CRYPTED)?' checked':'')."> ";
print ' ';
// Mail
-$var=!$var;
-print ''.$langs->trans("LDAPFieldMail").' ';
+
+print ' '.$langs->trans("LDAPFieldMail").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldMailExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MAIL)?' checked':'')."> ";
print ' ';
// Phone
-$var=!$var;
-print ''.$langs->trans("LDAPFieldPhone").' ';
+
+print ' '.$langs->trans("LDAPFieldPhone").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldPhoneExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PHONE)?' checked':'')."> ";
print ' ';
// Mobile
-$var=!$var;
-print ''.$langs->trans("LDAPFieldMobile").' ';
+
+print ' '.$langs->trans("LDAPFieldMobile").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldMobileExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked':'')."> ";
print ' ';
// Skype
-$var=!$var;
-print ''.$langs->trans("LDAPFieldSkype").' ';
+
+print ' '.$langs->trans("LDAPFieldSkype").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldSkypeExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SKYPE)?' checked':'')."> ";
print ' ';
// Fax
-$var=!$var;
-print ''.$langs->trans("LDAPFieldFax").' ';
+
+print ' '.$langs->trans("LDAPFieldFax").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldFaxExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FAX)?' checked':'')."> ";
print ' ';
// Title
-$var=!$var;
-print ''.$langs->trans("LDAPFieldTitle").' ';
+
+print ' '.$langs->trans("LDAPFieldTitle").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldTitleExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_TITLE)?' checked':'')."> ";
print ' ';
// Note
-$var=!$var;
-print ''.$langs->trans("Note").' ';
+
+print ' '.$langs->trans("Note").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldDescriptionExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_DESCRIPTION)?' checked':'')."> ";
print ' ';
// Sid
-$var=!$var;
-print ''.$langs->trans("LDAPFieldSid").' ';
+
+print ' '.$langs->trans("LDAPFieldSid").' ';
print ' ';
print ' '.$langs->trans("LDAPFieldSidExample").' ';
print ' global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SID)?' checked':'')."> ";
diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php
index 3806258d246..1d4b5cee8d4 100644
--- a/htdocs/admin/limits.php
+++ b/htdocs/admin/limits.php
@@ -106,21 +106,21 @@ if ($action == 'edit')
print '';
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
- $var=!$var;
- print '';
+
+ print ' ';
print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly"));
print ' ';
- $var=!$var;
- print '';
+
+ print ' ';
print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly"));
print ' ';
- $var=!$var;
- print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").' ';
+
+ print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").' ';
- $var=!$var;
- print '';
+
+ print ' ';
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly"));
print ' ';
@@ -140,21 +140,21 @@ else
print '';
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
- $var=!$var;
- print '';
+
+ print ' ';
print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly"));
print ' '.$conf->global->MAIN_MAX_DECIMALS_UNIT.' ';
- $var=!$var;
- print '';
+
+ print ' ';
print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly"));
print ' '.$conf->global->MAIN_MAX_DECIMALS_TOT.' ';
- $var=!$var;
- print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").' '.$conf->global->MAIN_MAX_DECIMALS_SHOWN.' ';
+
+ print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").' '.$conf->global->MAIN_MAX_DECIMALS_SHOWN.' ';
- $var=!$var;
- print '';
+
+ print ' ';
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly"));
print ' '.$conf->global->MAIN_ROUNDING_RULE_TOT.' ';
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index 42d7fa69ac8..281f1934296 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -214,12 +214,10 @@ print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
print ' ';
$head = expedition_admin_prepare_head();
-dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), 0, 'sending');
+dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending');
-/*
- * Livraison numbering model
- */
+// Delivery numbering model
print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"),'','');
@@ -260,8 +258,8 @@ foreach ($dirmodels as $reldir)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
- $var=!$var;
- print ''.$module->nom." \n";
+
+ print ' '.$module->nom." \n";
print $module->info();
print ' ';
@@ -387,7 +385,7 @@ foreach ($dirmodels as $reldir)
{
if (file_exists($dir.'/'.$file))
{
- $var=!$var;
+
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
@@ -401,7 +399,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
- print '';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -485,7 +483,7 @@ $var=! $var;
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnDeliveryReceipts").' ('.$langs->trans("AddCRIfTooLong").') ';
$variablename='DELIVERY_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php
index 71a34039084..84037ae9b80 100644
--- a/htdocs/admin/livraison_extrafields.php
+++ b/htdocs/admin/livraison_extrafields.php
@@ -78,7 +78,7 @@ print " \n";
$head = expedition_admin_prepare_head();
-dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), 0, 'sending');
+dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'sending');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/livraisondet_extrafields.php
index 4679123352a..22a7e89d724 100644
--- a/htdocs/admin/livraisondet_extrafields.php
+++ b/htdocs/admin/livraisondet_extrafields.php
@@ -78,7 +78,7 @@ print " \n";
$head = expedition_admin_prepare_head();
-dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), 0, 'sending');
+dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'sending');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php
index 3213503835d..ee6b9ef74ee 100644
--- a/htdocs/admin/loan.php
+++ b/htdocs/admin/loan.php
@@ -96,7 +96,7 @@ print " \n";
foreach ($list as $key)
{
- $var=!$var;
+
print '';
diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php
index 541c8aa1b2d..972b7ee73a6 100644
--- a/htdocs/admin/mailing.php
+++ b/htdocs/admin/mailing.php
@@ -113,30 +113,30 @@ print ''.$langs->trans("Parameter").' ';
print ''.$langs->trans("Value").' ';
print " \n";
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("MailingEMailFrom").' ';
print ' ';
if (!empty($conf->global->MAILING_EMAIL_FROM) && ! isValidEmail($conf->global->MAILING_EMAIL_FROM)) print ' '.img_warning($langs->trans("BadEMail"));
print ' ';
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("MailingEMailError").' ';
print ' ';
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail"));
print ' ';
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("MailingDelay").' ';
print ' ';
print ' ';
// Constant to add salt into the unsubscribe and check read tag.
// It is also used as a security key parameter.
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("ActivateCheckReadKey").' ';
print ' ';
if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index e0e23f75d18..219cd85c2fe 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -228,7 +228,7 @@ if ($action == 'edit')
print ' ';
print ' ';
- dol_fiche_head($head, 'common', '');
+ dol_fiche_head($head, 'common', '', -1);
print $langs->trans("EMailsDesc")." \n";
print " \n";
@@ -241,18 +241,18 @@ if ($action == 'edit')
print ' '.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
// Disable
- $var=!$var;
- print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").' ';
+
+ print ' '.$langs->trans("MAIN_DISABLE_ALL_MAILS").' ';
print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1);
print ' ';
// Separator
- $var=!$var;
- print ' ';
+
+ print ' ';
// Method
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_SENDMODE").' ';
+
+ print ' '.$langs->trans("MAIN_MAIL_SENDMODE").' ';
// SuperAdministrator access only
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity))
@@ -270,8 +270,8 @@ if ($action == 'edit')
print ' ';
// Host server
- $var=!$var;
- print '';
+
+ print ' ';
if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
@@ -303,8 +303,8 @@ if ($action == 'edit')
print ' ';
// Port
- $var=!$var;
- print '';
+
+ print ' ';
if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
@@ -338,7 +338,7 @@ if ($action == 'edit')
// ID
if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))))
{
- $var=!$var;
+
$mainstmpid=(! empty($conf->global->MAIN_MAIL_SMTPS_ID)?$conf->global->MAIN_MAIL_SMTPS_ID:'');
print ' '.$langs->trans("MAIN_MAIL_SMTPS_ID").' ';
// SuperAdministrator access only
@@ -358,7 +358,7 @@ if ($action == 'edit')
// PW
if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))))
{
- $var=!$var;
+
$mainsmtppw=(! empty($conf->global->MAIN_MAIL_SMTPS_PW)?$conf->global->MAIN_MAIL_SMTPS_PW:'');
print ' '.$langs->trans("MAIN_MAIL_SMTPS_PW").' ';
// SuperAdministrator access only
@@ -376,8 +376,8 @@ if ($action == 'edit')
}
// TLS
- $var=!$var;
- print ' '.$langs->trans("MAIN_MAIL_EMAIL_TLS").' ';
+
+ print ' '.$langs->trans("MAIN_MAIL_EMAIL_TLS").' ';
if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))))
{
if (function_exists('openssl_open'))
@@ -390,8 +390,8 @@ if ($action == 'edit')
print ' ';
// STARTTLS
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").' ';
+
+ print ' '.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").' ';
if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))))
{
if (function_exists('openssl_open'))
@@ -404,17 +404,17 @@ if ($action == 'edit')
print ' ';
// Separator
- $var=!$var;
- print ' ';
+
+ print ' ';
// From
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).' ';
+
+ print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).' ';
print ' ';
// Default from type
- $var=!$var;
+
$liste = array();
$liste['user'] = $langs->trans('UserEmail');
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')';
@@ -424,18 +424,18 @@ if ($action == 'edit')
print ' ';
// Separator
- $var=!$var;
- print ' ';
+
+ print ' ';
// From
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").' ';
+
+ print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").' ';
print ' ';
// Autocopy to
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' ';
+
+ print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' ';
print ' ';
@@ -453,7 +453,7 @@ if ($action == 'edit')
}
else
{
- dol_fiche_head($head, 'common', '');
+ dol_fiche_head($head, 'common', '', -1);
print $langs->trans("EMailsDesc")." \n";
print " \n";
@@ -465,60 +465,60 @@ else
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
// Disable
- $var=!$var;
- print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").' '.yn($conf->global->MAIN_DISABLE_ALL_MAILS).' ';
+
+ print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").' '.yn($conf->global->MAIN_DISABLE_ALL_MAILS).' ';
// Separator
- $var=!$var;
- print ' ';
+
+ print ' ';
// Method
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_SENDMODE").' ';
+
+ print ' '.$langs->trans("MAIN_MAIL_SENDMODE").' ';
$text=$listofmethods[$conf->global->MAIN_MAIL_SENDMODE];
if (empty($text)) $text=$langs->trans("Undefined").img_warning();
print $text;
print ' ';
// Host server
- $var=!$var;
+
if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail'))
{
- print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").' '.$langs->trans("SeeLocalSendMailSetup").' ';
+ print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").' '.$langs->trans("SeeLocalSendMailSetup").' ';
}
else
{
- print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).' '.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').' ';
+ print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).' '.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').' ';
}
// Port
- $var=!$var;
+
if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail'))
{
- print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").' '.$langs->trans("SeeLocalSendMailSetup").' ';
+ print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").' '.$langs->trans("SeeLocalSendMailSetup").' ';
}
else
{
- print ''.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).' '.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').' ';
+ print ''.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).' '.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').' ';
}
// SMTPS ID
- $var=!$var;
+
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
- print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").' '.$conf->global->MAIN_MAIL_SMTPS_ID.' ';
+ print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").' '.$conf->global->MAIN_MAIL_SMTPS_ID.' ';
}
// SMTPS PW
- $var=!$var;
+
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
- print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").' '.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).' ';
+ print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").' '.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).' ';
}
// TLS
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").' ';
+
+ print ' '.$langs->trans("MAIN_MAIL_EMAIL_TLS").' ';
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
if (function_exists('openssl_open'))
@@ -531,8 +531,8 @@ else
print ' ';
// STARTTLS
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").' ';
+
+ print ' '.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").' ';
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
if (function_exists('openssl_open'))
@@ -545,18 +545,18 @@ else
print ' ';
// Separator
- $var=!$var;
- print ' ';
+
+ print ' ';
// From
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).' ';
+
+ print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).' ';
print ''.$conf->global->MAIN_MAIL_EMAIL_FROM;
if (! empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail"));
print ' ';
// Default from type
- $var=!$var;
+
print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').' ';
print '';
if($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user'){
@@ -567,19 +567,19 @@ else
print ' ';
// Separator
- $var=!$var;
- print ' ';
+
+ print ' ';
// Errors To
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").' ';
+
+ print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").' ';
print ''.$conf->global->MAIN_MAIL_ERRORS_TO;
if (! empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail"));
print ' ';
// Autocopy to
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' ';
+
+ print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' ';
print '';
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO))
{
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 150f288e45d..90949c7980d 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -405,7 +405,7 @@ $head[$h][2] = 'templates';
$h++;
-dol_fiche_head($head, 'templates', '');
+dol_fiche_head($head, 'templates', '', -1);
// Confirmation de la suppression de la ligne
if ($action == 'delete')
diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php
index f8b89c515aa..ddfb4d0cd62 100644
--- a/htdocs/admin/menus.php
+++ b/htdocs/admin/menus.php
@@ -155,7 +155,7 @@ print '';
print ' ';
print ' ';
-dol_fiche_head($head, 'handler', $langs->trans("Menus"));
+dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1);
print $langs->trans("MenusDesc")." \n";
print " \n";
@@ -179,8 +179,8 @@ if ($action == 'edit')
print ' ';
// Menu top
- $var=!$var;
- print ''.$langs->trans("DefaultMenuManager").' ';
+
+ print ''.$langs->trans("DefaultMenuManager").' ';
print '';
$formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled');
print ' ';
@@ -190,8 +190,8 @@ if ($action == 'edit')
print ' ';
// Menu smartphone
- $var=!$var;
- print ''.$langs->trans("DefaultMenuSmartphoneManager").' ';
+
+ print ''.$langs->trans("DefaultMenuSmartphoneManager").' ';
print '';
$formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled');
print ' ';
@@ -217,8 +217,8 @@ else
print '';
print ' ';
- $var=!$var;
- print ''.$langs->trans("DefaultMenuManager").' ';
+
+ print ''.$langs->trans("DefaultMenuManager").' ';
print '';
$filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED));
print $filelib;
@@ -229,8 +229,8 @@ else
print ' ';
print ' ';
- $var=!$var;
- print '';
+
+ print ' ';
print ''.$langs->trans("DefaultMenuSmartphoneManager").' ';
print '';
$filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED));
diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php
index acfa9d2dccd..ed5f56954c0 100644
--- a/htdocs/admin/menus/index.php
+++ b/htdocs/admin/menus/index.php
@@ -234,7 +234,7 @@ $head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'misc';
$h++;
-dol_fiche_head($head, 'editor', $langs->trans("Menus"));
+dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1);
print $langs->trans("MenusEditorDesc")." \n";
print " \n";
diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php
index 471edf58e79..82457a27bdf 100644
--- a/htdocs/admin/menus/other.php
+++ b/htdocs/admin/menus/other.php
@@ -77,7 +77,7 @@ $head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'misc';
$h++;
-dol_fiche_head($head, 'misc', $langs->trans("Menus"));
+dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1);
// Other Options
@@ -90,8 +90,8 @@ print ' '.$langs->trans("Status").' ';
print ' ';
// Hide unauthorized menu
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("HideUnauthorizedMenu").' ';
print '';
if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php
index 9ff7a4478ff..94bfa8e05bb 100644
--- a/htdocs/admin/modulehelp.php
+++ b/htdocs/admin/modulehelp.php
@@ -1,12 +1,5 @@
- * Copyright (C) 2003 Jean-Louis Bergamo
- * Copyright (C) 2004-2017 Laurent Destailleur
- * Copyright (C) 2004 Eric Seigne
- * Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2011 Juanjo Menent
- * Copyright (C) 2015 Jean-François Ferry
- * Copyright (C) 2015 Raphaël Doursenaud
+/* Copyright (C) 2017 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -239,7 +232,7 @@ $head[$h][2] = 'desc';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=feature';
-$head[$h][1] = $langs->trans("Features");
+$head[$h][1] = $langs->trans("TechnicalServicesProvided");
$head[$h][2] = 'feature';
$h++;
@@ -251,45 +244,38 @@ foreach($orders as $tmpkey => $tmpvalue)
if ($objMod->numero == $id)
{
$key = $i;
+ $modName = $filename[$tmpkey];
+ $dirofmodule = $dirmod[$tmpkey];
break;
}
$i++;
}
$value = $orders[$key];
+$special = $objMod->special;
+$tab=explode('_',$value);
+$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
+
+// Check filters
+$modulename=$objMod->getName();
+$moduledesc=$objMod->getDesc();
+$moduleauthor=$objMod->getPublisher();
+
print '';
-
-print load_fiche_titre($objMod->getDesc(),$moreinfo,'object_'.$objMod->picto);
+print load_fiche_titre(($modulename?$modulename:$moduledesc), $moreinfo, 'object_'.$objMod->picto);
print '
';
-dol_fiche_head($head, $mode, $title);
+dol_fiche_head($head, $mode, $title, -1);
-
-
-$tab=explode('_',$value);
-$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
-
-$modName = $filename[$key];
-$objMod = $modules[$key];
-$dirofmodule = $dirmod[$key];
-
-$special = $objMod->special;
-
-if (! $objMod->getName())
+if (! $modulename)
{
dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING);
}
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
-// Check filters
-$modulename=$objMod->getName();
-$moduledesc=$objMod->getDesc();
-$moduledesclong=$objMod->getDescLong();
-$moduleauthor=$objMod->getPublisher();
-
// Load all lang files of module
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
{
@@ -299,7 +285,7 @@ if (isset($objMod->langfiles) && is_array($objMod->langfiles))
}
}
-$var=!$var;
+
// Version (with picto warning or not)
@@ -322,6 +308,8 @@ $text='';
if ($mode == 'desc')
{
+ if ($moduledesc) $text.=$moduledesc.'
';
+
$text.='
'.$langs->trans("Version").': '.$version;
$textexternal='';
@@ -329,7 +317,7 @@ if ($mode == 'desc')
{
$textexternal.='
'.$langs->trans("Origin").': '.$langs->trans("ExternalModule",$dirofmodule);
if ($objMod->editor_name != 'dolibarr') $textexternal.='
'.$langs->trans("Publisher").': '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name);
- if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='
'.$langs->trans("Url").': '.$objMod->editor_url;
+ if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='
'.$langs->trans("Url").': '.$objMod->editor_url.' ';
$text.=$textexternal;
$text.='
';
}
@@ -342,11 +330,21 @@ if ($mode == 'desc')
else $text.=$langs->trans("Disabled");
$text.='
';
- if ($objMod->getDescLong()) $text.=$objMod->getDesc().'
';
+ $moduledesclong=$objMod->getDescLong();
+ if ($moduledesclong) $text.='
'.$moduledesclong.'
';
}
if ($mode == 'feature')
{
+ $text.='
'.$langs->trans("DependsOn").': ';
+ if (count($objMod->requiredby)) $text.=join(',', $objMod->depends);
+ else $text.=$langs->trans("None");
+ $text.='
'.$langs->trans("RequiredBy").': ';
+ if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby);
+ else $text.=$langs->trans("None");
+
+ $text.='
';
+
$text.='
'.$langs->trans("AddRemoveTabs").': ';
if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs))
{
@@ -360,6 +358,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddDictionaries").': ';
if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib']))
{
@@ -372,6 +372,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddBoxes").': ';
if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes))
{
@@ -384,6 +386,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddModels").': ';
if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models'])
{
@@ -391,6 +395,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddSubstitutions").': ';
if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions'])
{
@@ -398,6 +404,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddSheduledJobs").': ';
if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs))
{
@@ -410,6 +418,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddTriggers").': ';
if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers'])
{
@@ -417,6 +427,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddHooks").': ';
if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks']))
{
@@ -429,6 +441,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddPermissions").': ';
if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights))
{
@@ -441,6 +455,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddMenus").': ';
if (isset($objMod->menu) && ! empty($objMod->menu)) // objMod can be an array or just an int 1
{
@@ -448,6 +464,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddExportProfiles").': ';
if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label))
{
@@ -460,6 +478,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddImportProfiles").': ';
if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label))
{
@@ -472,6 +492,8 @@ if ($mode == 'feature')
}
else $text.=$langs->trans("No");
+ $text.='
';
+
$text.='
'.$langs->trans("AddOtherPagesOrServices").': ';
$text.=$langs->trans("DetectionNotPossible");
}
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 596aefa803e..4eb82e6183c 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -235,6 +235,8 @@ $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'
llxHeader('',$langs->trans("Setup"),$help_url);
$arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers"));
+$arrayofwarnings=array(); // Array of warning each module want to show when activated
+$arrayofwarningsext=array(); // Array of warning each module want to show when we activate an external module
// Search modules dirs
$modulesdir = dolGetModulesDirs();
@@ -266,7 +268,7 @@ foreach ($modulesdir as $dir)
if ($modName)
{
- if (! empty($modNameLoaded[$modName]))
+ if (! empty($modNameLoaded[$modName])) // In cache of already loaded modules ?
{
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.
";
setEventMessages($mesg, null, 'warnings');
@@ -276,13 +278,12 @@ foreach ($modulesdir as $dir)
try
{
- $res=include_once $dir.$file;
+ $res=include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error.
if (class_exists($modName))
{
try {
$objMod = new $modName($db);
$modNameLoaded[$modName]=$dir;
-
if (! $objMod->numero > 0 && $modName != 'modUser')
{
dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR);
@@ -297,7 +298,7 @@ foreach ($modulesdir as $dir)
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0;
- // We discard modules according to property disabled
+ // We discard modules according to property ->hidden
if (! empty($objMod->hidden)) $modulequalified=0;
if ($modulequalified > 0)
@@ -321,8 +322,8 @@ foreach ($modulesdir as $dir)
// Define array $categ with categ with at least one qualified module
if ($modulequalified > 0)
{
- $modules[$i] = $objMod;
$filename[$i]= $modName;
+ $modules[$modName] = $objMod;
$special = $objMod->special;
@@ -342,6 +343,16 @@ foreach ($modulesdir as $dir)
if ($special == 1) $familykey='interface';
+ // Add list of warnings to show into arrayofwarnings and arrayofwarningsext
+ if (! empty($objMod->warnings_activation))
+ {
+ $arrayofwarnings[$modName]=$objMod->warnings_activation;
+ }
+ if (! empty($objMod->warnings_activation_ext))
+ {
+ $arrayofwarningsext[$modName]=$objMod->warnings_activation_ext;
+ }
+
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
$dirmod[$i] = $dir;
//print $i.'-'.$dirmod[$i].'
';
@@ -428,7 +439,7 @@ if ($mode == 'common')
print '
';
print '
';
- dol_fiche_head($head, $mode, '');
+ dol_fiche_head($head, $mode, '', -1);
$moreforfilter = '';
$moreforfilter.='
';
@@ -459,12 +470,10 @@ if ($mode == 'common')
if (! empty($moreforfilter))
{
- //print '
';
print $moreforfilter;
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- //print '
';
}
@@ -473,8 +482,6 @@ if ($mode == 'common')
$moreforfilter='';
// Show list of modules
- print '
';
- print '
'."\n";
$oldfamily='';
@@ -484,7 +491,7 @@ if ($mode == 'common')
$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
$modName = $filename[$key];
- $objMod = $modules[$key];
+ $objMod = $modules[$modName];
$dirofmodule = $dirmod[$key];
$special = $objMod->special;
@@ -504,6 +511,7 @@ if ($mode == 'common')
// Check filters
$modulename=$objMod->getName();
+ $moduletechnicalname=$objMod->name;
$moduledesc=$objMod->getDesc();
$moduledesclong=$objMod->getDescLong();
$moduleauthor=$objMod->getPublisher();
@@ -513,6 +521,7 @@ if ($mode == 'common')
{
$qualified=0;
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
+ || preg_match('/'.preg_quote($search_keyword).'/i', $moduletechnicalname)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
@@ -556,14 +565,15 @@ if ($mode == 'common')
// Print a separator if we change family
if ($familykey!=$oldfamily)
{
- print ''."\n";
- print '';
+ if ($oldfamily) print '
';
+
$familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
- print $familytext;
- print "
\n";
- print ''.$langs->trans("SetupShort").' '."\n";
- print " \n";
- $atleastoneforfamily=0;
+ print_fiche_titre($familytext, '', '');
+
+ print '';
+ print '
'."\n";
+
+ $atleastoneforfamily=0;
}
$atleastoneforfamily++;
@@ -574,7 +584,7 @@ if ($mode == 'common')
$oldfamily=$familykey;
}
- $var=!$var;
+
// Version (with picto warning or not)
@@ -592,53 +602,52 @@ if ($mode == 'common')
$imginfo="info_black";
}
- print '\n";
+ print ' '."\n";
- // Picto
- print ' ';
+ // Picto + Name of module
+ print ' ';
$alttext='';
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
if (! empty($objMod->picto))
{
if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1);
- else print img_object($alttext,$objMod->picto,' width="14px"');
+ else print img_object($alttext, $objMod->picto, 'class="valignmiddle" width="14px"');
}
else
{
- print img_object($alttext,'generic');
+ print img_object($alttext, 'generic', 'class="valignmiddle"');
}
- print ' ';
-
- // Name
- print ''.$objMod->getName();
+ print ' '.$objMod->getName().' ';
print " \n";
// Desc
- print '';
+ print ' ';
print nl2br($objMod->getDesc());
print " \n";
// Help
- print '';
-
+ print ' ';
//print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).' ';
-
print ' ';
// Version
- print '';
+ print ' ';
print $versiontrans;
print " \n";
// Activate/Disable and Setup (2 columns)
- if (! empty($conf->global->$const_name)) // If module is activated
+ if (! empty($conf->global->$const_name)) // If module is already activated
{
$disableSetup = 0;
- print '';
- if (! empty($objMod->disabled))
+ print ' ';
+ if (! empty($arrayofwarnings[$modName]))
+ {
+ print ''."\n";
+ }
+ if (! empty($objMod->disabled))
{
print $langs->trans("Disabled");
}
@@ -660,7 +669,7 @@ if ($mode == 'common')
{
if (is_array($objMod->config_page_url))
{
- print ' ';
+ print ' ';
$i=0;
foreach ($objMod->config_page_url as $page)
{
@@ -686,25 +695,25 @@ if ($mode == 'common')
}
else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
{
- print ' '.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').' ';
+ print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').' ';
}
else
{
- print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').' ';
+ print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').' ';
}
}
else
{
- print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').' ';
+ print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').' ';
}
}
- else // Module not activated
+ else // Module not yet activated
{
- print '';
+ print ' ';
if (! empty($objMod->always_enabled))
{
- // Ne devrait pas arriver.
+ // Should never happened
}
else if (! empty($objMod->disabled))
{
@@ -712,18 +721,48 @@ if ($mode == 'common')
}
else
{
- // Module non actif
- print '';
+ // Module qualified for activation
+ $warningmessage='';
+ if (! empty($arrayofwarnings[$modName]))
+ {
+ print ''."\n";
+ foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
+ {
+ $warningmessage .= ($warningmessage?"\n":"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
+ }
+ }
+ if ($objMod->isCoreOrExternalModule() == 'external' && ! empty($arrayofwarningsext))
+ {
+ print ''."\n";
+ foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
+ {
+ if (! empty($modules[$keymodule]->const_name)) // If module that request warning is on
+ {
+ foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
+ {
+ if ($keycountry == 'always' || $keycountry == $mysoc->country_code)
+ {
+ $warningmessage .= ($warningmessage?"\n":"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
+ }
+ }
+ }
+ }
+ }
+ print ''."\n";
+ print ' ';
print img_picto($langs->trans("Disabled"),'switch_off');
print " \n";
}
print " \n";
- print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').' ';
+ print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').' ';
}
print " \n";
}
+
print "
\n";
print '
';
@@ -732,7 +771,7 @@ if ($mode == 'common')
if ($mode == 'marketplace')
{
- dol_fiche_head($head, $mode, '');
+ dol_fiche_head($head, $mode, '', -1);
// Marketplace
print "\n";
@@ -742,7 +781,7 @@ if ($mode == 'marketplace')
print ''.$langs->trans("URL").' ';
print '';
- $var=!$var;
+
print "\n";
$url='https://www.dolistore.com';
print ' ';
@@ -750,7 +789,7 @@ if ($mode == 'marketplace')
print ''.$url.' ';
print ' ';
- $var=!$var;
+
print "\n";
$url='https://partners.dolibarr.org';
print ' ';
@@ -768,7 +807,7 @@ if ($mode == 'marketplace')
if ($mode == 'deploy')
{
- dol_fiche_head($head, $mode, '');
+ dol_fiche_head($head, $mode, '', -1);
$allowonlineinstall=true;
diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php
index 5b86bcdc1c3..3aa6ad5dc26 100644
--- a/htdocs/admin/multicurrency.php
+++ b/htdocs/admin/multicurrency.php
@@ -183,8 +183,8 @@ print ''.$langs->trans("Parameters").' '."\n";
print ' ';
print ''.$langs->trans("Value").' '."\n";
-$var=!$var;
-print ' ';
+
+print ' ';
print ''.$langs->transnoentitiesnoconv("multicurrency_useRateOnDocumentDate").' ';
print ' ';
print '';
@@ -197,8 +197,8 @@ print '';
print ' ';
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->transnoentitiesnoconv("multicurrency_useOriginTx").' ';
print ' ';
print '';
@@ -211,8 +211,8 @@ print '';
print ' ';
/* TODO uncomment when the functionality will integrated
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->transnoentitiesnoconv("multicurrency_buyPriceInCurrency").' ';
print ' ';
print '';
@@ -226,8 +226,8 @@ print ' ';
*/
/* TODO uncomment when the functionality will integrated
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").' ';
print ' ';
print '';
@@ -260,8 +260,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print ' ';
- $var=!$var;
- print '';
+
+ print ' ';
print ''.$langs->transnoentitiesnoconv("multicurrency_appId").' ';
print ' ';
print '';
@@ -273,8 +273,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print '';
print ' ';
- $var=!$var;
- print '';
+
+ print ' ';
print ''.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").' ';
print ' ';
print '';
@@ -286,8 +286,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print '';
print ' ';
- $var=!$var;
- print '';
+
+ print ' ';
print ''.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").' ';
print ' ';
print '';
@@ -311,8 +311,8 @@ print ' '.$form->textwithpicto($langs->trans("CurrenciesUsed"), $langs->trans
print ' ';
print ''.$langs->trans("Rate").' '."\n";
-$var=!$var;
-print ' ';
+
+print ' ';
print '';
print ' ';
print ' ';
@@ -323,8 +323,8 @@ print ' ';
print ' ';
-$var=!$var;
-print '';
+
+print ' ';
print ''.$conf->currency.$form->textwithpicto(' ', $langs->trans("BaseCurrency")).' ';
print ' ';
print '1';
@@ -334,8 +334,8 @@ foreach ($TCurrency as &$currency)
{
if($currency->code == $conf->currency) continue;
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.$currency->code.' - '.$currency->name.' ';
print ' ';
print '';
diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php
index a3b3eb50df6..c82e64d48ea 100644
--- a/htdocs/admin/notification.php
+++ b/htdocs/admin/notification.php
@@ -135,8 +135,8 @@ print ' ';
print ''.$langs->trans("Parameter").' ';
print ''.$langs->trans("Value").' ';
print " \n";
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("NotificationEMailFrom").' ';
print '';
print ' ';
@@ -165,14 +165,14 @@ print " \n";
$notificationtrigger=new InterfaceNotification($db);
$listofnotifiedevents=$notificationtrigger->getListOfManagedEvents();
-print '';
+print ' ';
print '';
$var=true;
$i=0;
foreach($listofnotifiedevents as $notifiedevent)
{
- $var=!$var;
+
$label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
@@ -213,7 +213,7 @@ $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents();
$var=true;
foreach($listofnotifiedevents as $notifiedevent)
{
- $var=!$var;
+
$label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
@@ -222,7 +222,7 @@ foreach($listofnotifiedevents as $notifiedevent)
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention');
- print ' ';
+ print ' ';
print ''.$elementLabel.' ';
print ''.$notifiedevent['code'].' ';
print ''.$label.' ';
diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php
index 2433575e553..06315222825 100644
--- a/htdocs/admin/oauthlogintokens.php
+++ b/htdocs/admin/oauthlogintokens.php
@@ -211,7 +211,7 @@ if ($mode == 'setup' && $user->admin)
print ' ';
print " \n";
- print '';
+ print ' ';
print '';
//var_dump($key);
print $langs->trans("OAuthIDSecret").' ';
@@ -223,7 +223,7 @@ if ($mode == 'setup' && $user->admin)
print ' '."\n";
$var = ! $var;
- print '';
+ print ' ';
print '';
//var_dump($key);
print $langs->trans("IsTokenGenerated");
@@ -250,7 +250,7 @@ if ($mode == 'setup' && $user->admin)
print ' ';
$var = ! $var;
- print '';
+ print ' ';
print '';
//var_dump($key);
print $langs->trans("Token").' ';
@@ -273,7 +273,7 @@ if ($mode == 'setup' && $user->admin)
{
// Token refresh
$var = ! $var;
- print ' ';
+ print ' ';
print '';
//var_dump($key);
print $langs->trans("TOKEN_REFRESH").' ';
@@ -284,7 +284,7 @@ if ($mode == 'setup' && $user->admin)
// Token expired
$var = ! $var;
- print ' ';
+ print ' ';
print '';
//var_dump($key);
print $langs->trans("TOKEN_EXPIRED").' ';
@@ -295,7 +295,7 @@ if ($mode == 'setup' && $user->admin)
// Token expired at
$var = ! $var;
- print ' ';
+ print ' ';
print '';
//var_dump($key);
print $langs->trans("TOKEN_EXPIRE_AT").' ';
@@ -368,8 +368,8 @@ if ($mode == 'userconf' && $user->admin)
$sql = 'SELECT p.rowid, p.printer_name, p.printer_location, p.printer_id, p.copy, p.module, p.driver, p.userid, u.login FROM '.MAIN_DB_PREFIX.'printing as p, '.MAIN_DB_PREFIX.'user as u WHERE p.userid=u.rowid';
$resql = $db->query($sql);
while ($row=$db->fetch_array($resql)) {
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.$row['login'].' ';
print ''.$row['module'].' ';
print ''.$row['driver'].' ';
diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php
index 93f7c301519..a5166ec69f2 100644
--- a/htdocs/admin/payment.php
+++ b/htdocs/admin/payment.php
@@ -177,7 +177,7 @@ foreach ($dirmodels as $reldir)
if ($module->isEnabled())
{
$var = !$var;
- print ' ';
+ print ' ';
echo preg_replace('/\-.*$/','',preg_replace('/mod_payment_/','',preg_replace('/\.php$/','',$file)));
print " \n";
@@ -263,7 +263,7 @@ print " \n";
// Allow payments on different thirdparties bills but same parent company
$var=! $var;
-print '';
+print ' ';
print $langs->trans("PaymentOnDifferentThirdBills");
print ' ';
print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS,1);
@@ -273,7 +273,7 @@ print " \n";
// Add js auto fill amount on paiement form
/* always on now
$var=! $var;
-print '';
+print ' ';
print $langs->trans("JSOnPaimentBill");
print ' ';
print $form->selectyesno("INVOICE_AUTO_FILLJS",$conf->global->INVOICE_AUTO_FILLJS,1);
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index 74684c823e7..b0c32a344ff 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -98,7 +98,7 @@ $formadmin=new FormAdmin($db);
$arraydetailsforpdffoot = array(
0 => $langs->trans('NoDetails'),
1 => $langs->trans('DisplayCompanyInfo'),
- 2 => $langs->trans('DisplayManagersInfo'),
+ 2 => $langs->trans('DisplayCompanyManagers'),
3 => $langs->trans('DisplayCompanyInfoAndManagers')
);
@@ -128,8 +128,8 @@ if ($action == 'edit') // Edit
if (empty($selected)) $selected=dol_getDefaultFormat();
// Show pdf format
- $var=!$var;
- print ' '.$langs->trans("DictionaryPaperFormat").' ';
+
+ print ' '.$langs->trans("DictionaryPaperFormat").' ';
print $formadmin->select_paper_format($selected,'MAIN_PDF_FORMAT');
print ' ';
@@ -145,13 +145,13 @@ if ($action == 'edit') // Edit
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
// Hide VAT Intra on address
- $var=!$var;
- print ''.$langs->trans("ShowVATIntaInAddress").' ';
+
+ print ' '.$langs->trans("ShowVATIntaInAddress").' ';
print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
print ' ';
// Show prof id 1 in address into pdf
- $var=!$var;
+
if (! $noCountryCode)
{
$pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
@@ -163,13 +163,13 @@ if ($action == 'edit') // Edit
}
if ($pid1)
{
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.' ';
+ print ' '.$langs->trans("ShowProfIdInAddress").' - '.$pid1.' ';
print $form->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1,$noCountryCode);
print ' ';
}
// Show prof id 2 in address into pdf
- $var=!$var;
+
if (! $noCountryCode)
{
$pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
@@ -181,13 +181,13 @@ if ($action == 'edit') // Edit
}
if ($pid2)
{
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.' ';
+ print ' '.$langs->trans("ShowProfIdInAddress").' - '.$pid2.' ';
print $form->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1,$noCountryCode);
print ' ';
}
// Show prof id 3 in address into pdf
- $var=!$var;
+
if (! $noCountryCode)
{
$pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
@@ -199,13 +199,13 @@ if ($action == 'edit') // Edit
}
if ($pid3)
{
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.' ';
+ print ' '.$langs->trans("ShowProfIdInAddress").' - '.$pid3.' ';
print $form->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1,$noCountryCode);
print ' ';
}
// Show prof id 4 in address into pdf
- $var=!$var;
+
if (! $noCountryCode)
{
$pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
@@ -217,7 +217,7 @@ if ($action == 'edit') // Edit
}
if ($pid4)
{
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.' ';
+ print ' '.$langs->trans("ShowProfIdInAddress").' - '.$pid4.' ';
print $form->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1,$noCountryCode);
print ' ';
}
@@ -233,37 +233,37 @@ if ($action == 'edit') // Edit
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
// Hide any PDF informations
- $var=!$var;
- print ''.$langs->trans("HideAnyVATInformationOnPDF").' ';
+
+ print ' '.$langs->trans("HideAnyVATInformationOnPDF").' ';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
print ' ';
//Desc
- $var=!$var;
- print ''.$langs->trans("HideDescOnPDF").' ';
+
+ print ' '.$langs->trans("HideDescOnPDF").' ';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
print ' ';
//Ref
- $var=!$var;
- print ''.$langs->trans("HideRefOnPDF").' ';
+
+ print ' '.$langs->trans("HideRefOnPDF").' ';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
print ' ';
//Details
- $var=!$var;
- print ''.$langs->trans("HideDetailsOnPDF").' ';
+
+ print ' '.$langs->trans("HideDetailsOnPDF").' ';
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
print ' ';
// Place customer adress to the ISO location
- $var=!$var;
- print ''.$langs->trans("PlaceCustomerAddressToIsoLocation").' ';
+
+ print ' '.$langs->trans("PlaceCustomerAddressToIsoLocation").' ';
print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1);
print ' ';
- $var=!$var;
- print ''.$langs->trans("ShowDetailsInPDFPageFoot").' ';
+
+ print ' '.$langs->trans("ShowDetailsInPDFPageFoot").' ';
print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS);
print ' ';
@@ -287,8 +287,8 @@ else // Show
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
// Show pdf format
- $var=!$var;
- print ''.$langs->trans("DictionaryPaperFormat").' ';
+
+ print ' '.$langs->trans("DictionaryPaperFormat").' ';
$pdfformatlabel='';
if (empty($conf->global->MAIN_PDF_FORMAT))
@@ -323,13 +323,13 @@ else // Show
print ' '.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
// Hide Intra VAT on address
- $var=!$var;
- print ''.$langs->trans("ShowVATIntaInAddress").' ';
+
+ print ' '.$langs->trans("ShowVATIntaInAddress").' ';
print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
print ' ';
// Show prof id 1 in address into pdf
- $var=!$var;
+
if (! $noCountryCode)
{
$pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
@@ -341,13 +341,13 @@ else // Show
}
if ($pid1)
{
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.' ';
+ print ' '.$langs->trans("ShowProfIdInAddress").' - '.$pid1.' ';
print yn($conf->global->MAIN_PROFID1_IN_ADDRESS,1);
print ' ';
}
// Show prof id 2 in address into pdf
- $var=!$var;
+
if (! $noCountryCode)
{
$pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
@@ -359,13 +359,13 @@ else // Show
}
if ($pid2)
{
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.' ';
+ print ' '.$langs->trans("ShowProfIdInAddress").' - '.$pid2.' ';
print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1);
print ' ';
}
// Show prof id 3 in address into pdf
- $var=!$var;
+
if (! $noCountryCode)
{
$pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
@@ -377,13 +377,13 @@ else // Show
}
if ($pid3)
{
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.' ';
+ print ' '.$langs->trans("ShowProfIdInAddress").' - '.$pid3.' ';
print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1);
print ' ';
}
// Show prof id 4 in address into pdf
- $var=!$var;
+
if (! $noCountryCode)
{
$pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
@@ -395,7 +395,7 @@ else // Show
}
if ($pid4)
{
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.' ';
+ print ' '.$langs->trans("ShowProfIdInAddress").' - '.$pid4.' ';
print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1);
print ' ';
}
@@ -412,8 +412,8 @@ else // Show
// Encrypt and protect PDF
- $var=!$var;
- print "";
+
+ print ' ';
print '';
$text = $langs->trans("ProtectAndEncryptPdfFiles");
$desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1);
@@ -440,36 +440,36 @@ else // Show
print ' ';
// Hide any PDF informations
- $var=!$var;
- print ''.$langs->trans("HideAnyVATInformationOnPDF").' ';
+
+ print ' '.$langs->trans("HideAnyVATInformationOnPDF").' ';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1);
print ' ';
//Desc
- $var=!$var;
- print ''.$langs->trans("HideDescOnPDF").' ';
+
+ print ' '.$langs->trans("HideDescOnPDF").' ';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1);
print ' ';
//Ref
- $var=!$var;
- print ''.$langs->trans("HideRefOnPDF").' ';
+
+ print ' '.$langs->trans("HideRefOnPDF").' ';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1);
print ' ';
//Details
- $var=!$var;
- print ''.$langs->trans("HideDetailsOnPDF").' ';
+
+ print ' '.$langs->trans("HideDetailsOnPDF").' ';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
print ' ';
- $var=!$var;
- print ''.$langs->trans("PlaceCustomerAddressToIsoLocation").' ';
+
+ print ' '.$langs->trans("PlaceCustomerAddressToIsoLocation").' ';
print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION,1);
print ' ';
- $var=!$var;
- print ''.$langs->trans("ShowDetailsInPDFPageFoot").' ';
+
+ print ' '.$langs->trans("ShowDetailsInPDFPageFoot").' ';
print $arraydetailsforpdffoot[$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS];
print ' ';
@@ -492,8 +492,8 @@ else // Show
$var=false;
if (! empty($dolibarr_pdf_force_fpdf))
{
- $var=!$var;
- print ''."\n";
+
+ print ' '."\n";
print 'dolibarr_pdf_force_fpdf '."\n";
print '';
print $dolibarr_pdf_force_fpdf;
@@ -501,8 +501,8 @@ else // Show
print ' ';
}
- $var=!$var;
- print ''."\n";
+
+ print ' '."\n";
print ''.$langs->trans("LibraryToBuildPDF").' '."\n";
print '';
$i=0;
diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php
index 4302222630c..daafab71053 100644
--- a/htdocs/admin/perms.php
+++ b/htdocs/admin/perms.php
@@ -118,7 +118,7 @@ $db->commit();
$head=security_prepare_head();
-dol_fiche_head($head, 'default', $langs->trans("Security"));
+dol_fiche_head($head, 'default', $langs->trans("Security"), -1);
// Show warning about external users
@@ -186,7 +186,7 @@ if ($result)
print " \n";
}
- $var=!$var;
+
print '';
print ''.img_object('',$picto).' '.$objMod->getName();
diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php
index 6d5c915dae2..86108be0136 100644
--- a/htdocs/admin/prelevement.php
+++ b/htdocs/admin/prelevement.php
@@ -313,7 +313,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
$var = !$var;
- print ' ';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -422,7 +422,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
if (!$obj->fk_soc)
{
$username=dolGetFirstLastname($obj->firstname,$obj->lastname);
@@ -495,9 +495,9 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print " ";
+ print ' ';
print ''.dolGetFirstLastname($obj->firstname,$obj->lastname).' ';
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
print ''.$label.' ';
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index c6ccb4f639c..bff56b4f776 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -310,8 +310,8 @@ foreach ($dirmodels as $reldir)
if ($module->isEnabled())
{
- $var=!$var;
- print ' '.$module->nom." \n";
+
+ print ' '.$module->nom." \n";
print $module->info();
print ' ';
@@ -450,7 +450,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
$var = !$var;
- print '';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -546,11 +546,11 @@ print ' '.$langs->trans("Value")." \n";
print " \n";
print " ";
-$var=!$var;
+
print "";
print ' ';
print " ";
-print "";
+print ' ';
print ''.$langs->trans("DefaultProposalDurationValidity").' ';
print ''." global->PROPALE_VALIDITY_DURATION."\"> ";
print ' ';
@@ -562,7 +562,7 @@ $var=! $var;
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("UseCustomerContactAsPropalRecipientIfExist");
print ' ';
print $form->selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1);
@@ -576,7 +576,7 @@ $var=! $var;
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnProposal").' '.img_info($langs->trans("AddCRIfTooLong")).' ';
$variablename='PROPOSAL_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
@@ -594,11 +594,11 @@ print ' '
print " \n";
print ' ';
-$var=!$var;
+
print "";
print ' ';
print " ";
-print '';
+print ' ';
print $langs->trans("WatermarkOnDraftProposal").' ';
print ' ';
print ' ';
@@ -609,8 +609,8 @@ print '';
/* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation.
if ($conf->banque->enabled)
{
- $var=!$var;
- print ' ';
+
+ print ' ';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'   ';
if (! empty($conf->use_javascript_ajax))
{
@@ -631,8 +631,8 @@ if ($conf->banque->enabled)
}
else
{
- $var=!$var;
- print ' ';
+
+ print ' ';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '.$langs->trans('NotAvailable').' ';
}
*/
@@ -668,7 +668,7 @@ print ' ';
print ' ';
print " \n";
-print '';
+print ' ';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").' ';
print ' ';
print " \n";
diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php
index 1f6e45223b4..224fac14ce7 100644
--- a/htdocs/admin/proxy.php
+++ b/htdocs/admin/proxy.php
@@ -96,7 +96,7 @@ print ' ';
$head=security_prepare_head();
-dol_fiche_head($head, 'proxy', $langs->trans("Security"));
+dol_fiche_head($head, 'proxy', $langs->trans("Security"), -1);
if ($conf->use_javascript_ajax)
@@ -133,8 +133,8 @@ print ''.$langs->trans("Parameters").' ';
print ''.$langs->trans("Value").' ';
print " \n";
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->trans("ConnectionTimeout").' ';
print ' ';
print '';
@@ -143,8 +143,8 @@ print ' '.strtolower($langs->trans("Seconds"));
print ' ';
print ' ';
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->trans("ResponseTimeout").' ';
print ' ';
print '';
@@ -153,8 +153,8 @@ print ' '.strtolower($langs->trans("Seconds"));
print ' ';
print ' ';
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->trans("MAIN_PROXY_USE").' ';
print ' ';
print '';
@@ -162,7 +162,7 @@ print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1);
print ' ';
print ' ';
-$var=!$var;
+
print '';
print ''.$langs->trans("MAIN_PROXY_HOST").' ';
print ' ';
@@ -171,7 +171,7 @@ print '';
print ' ';
@@ -180,7 +180,7 @@ print '';
print ' ';
@@ -189,7 +189,7 @@ print '';
print ' ';
diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php
index b86023aa49a..1bac9d80bee 100644
--- a/htdocs/admin/receiptprinter.php
+++ b/htdocs/admin/receiptprinter.php
@@ -250,7 +250,7 @@ if ($mode == 'config' && $user->admin)
} else {
for ($line=0; $line < $nbofprinters; $line++) {
$var = !$var;
- print ' ';
+ print ' ';
if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) {
print ' ';
print ' ';
@@ -381,7 +381,7 @@ if ($mode == 'template' && $user->admin)
$max = count($printer->listprinterstemplates);
for ($line=0; $line < $max; $line++) {
$var = !$var;
- print ' ';
+ print ' ';
if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) {
print ' ';
print ' ';
@@ -427,7 +427,7 @@ if ($mode == 'template' && $user->admin)
$max = count($printer->tags);
for ($tag=0; $tag < $max; $tag++) {
$var = !$var;
- print ' ';
+ print ' ';
print '<'.$printer->tags[$tag].'> '.$langs->trans(strtoupper($printer->tags[$tag])).' ';
print ' ';
}
diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php
index d8fdddd2bb5..3f057bbdbb9 100644
--- a/htdocs/admin/resource.php
+++ b/htdocs/admin/resource.php
@@ -85,8 +85,8 @@ print ' ';
// Utilisation formulaire Ajax sur choix produit
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->trans("UseSearchToSelectResource").' ';
if (empty($conf->use_javascript_ajax))
{
@@ -111,8 +111,8 @@ else
}
print ' ';
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->trans('DisabledResourceLinkUser').' ';
print '';
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER');
@@ -120,8 +120,8 @@ print ' ';
print ' ';
print ' ';
-$var=!$var;
-print '';
+
+print ' ';
print ''.$langs->trans('DisabledResourceLinkContact').' ';
print '';
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php
index b09f4820312..a04b23ce4fe 100644
--- a/htdocs/admin/salaries.php
+++ b/htdocs/admin/salaries.php
@@ -97,7 +97,7 @@ print " \n";
foreach ($list as $key)
{
- $var=!$var;
+
print '';
diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index 97cae20377c..4d0415dbd01 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -198,7 +198,7 @@ print " \n";
$head=security_prepare_head();
-dol_fiche_head($head, 'passwords', $langs->trans("Security"));
+dol_fiche_head($head, 'passwords', $langs->trans("Security"), -1);
$var=false;
@@ -250,7 +250,7 @@ foreach ($arrayhandler as $key => $module)
if ($module->isEnabled())
{
$var = !$var;
- print ' ';
+ print ' ';
print ucfirst($key);
print " \n";
print $module->getDescription().' ';
@@ -283,7 +283,7 @@ print '';
//if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
// Patter for Password Perso
if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){
-$var=!$var;
+
$tabConf = explode(";",$conf->global->USER_PASSWORD_PATTERN);
/*$this->length2 = $tabConf[0];
@@ -299,38 +299,38 @@ $var=!$var;
print ' '.$langs->trans("PasswordPatternDesc").' ';
print ' ';
- $var=!$var;
- print "";
+
+ print ' ';
print '' . $langs->trans("MinLength")." ";
print ' ';
print ' ';
- $var=!$var;
- print "";
+
+ print ' ';
print '' . $langs->trans("NbMajMin")." ";
print ' ';
print ' ';
- $var=!$var;
- print "";
+
+ print ' ';
print '' . $langs->trans("NbNumMin")." ";
print ' ';
print ' ';
- $var=!$var;
- print "";
+
+ print ' ';
print '' . $langs->trans("NbSpeMin")." ";
print ' ';
print ' ';
- $var=!$var;
- print "";
+
+ print ' ';
print '' . $langs->trans("NbIteConsecutive")." ";
print ' ';
print ' ';
- $var=!$var;
- print "";
+
+ print ' ';
print '' . $langs->trans("NoAmbiCaracAutoGeneration")." ";
print ' '.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).' ';
print ' ';
@@ -407,8 +407,8 @@ print ''.$langs->trans("Action").' ';
print '';
// Disable clear password in database
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("DoNotStoreClearPassword").' ';
print '';
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
@@ -441,8 +441,8 @@ print " ";
print ' ';
// Cryptage du mot de base de la base dans conf.php
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("MainDbPasswordFileConfEncrypted").' ';
print '';
if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
@@ -476,8 +476,8 @@ print ' ';
// Disable link "Forget password" on logon
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("DisableForgetPasswordLinkOnLogonPage").' ';
print '';
if(! empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK))
diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php
index f7a776c7249..8c1b1fa5b07 100644
--- a/htdocs/admin/security_file.php
+++ b/htdocs/admin/security_file.php
@@ -124,7 +124,7 @@ print ' ';
$head=security_prepare_head();
-dol_fiche_head($head, 'file', $langs->trans("Security"));
+dol_fiche_head($head, 'file', $langs->trans("Security"), -1);
// Upload options
@@ -136,7 +136,7 @@ print ' '.$langs->trans("Parameters").' ';
print ''.$langs->trans("Value").' ';
print ' ';
-print '';
+print ' ';
print ''.$langs->trans("MaxSizeForUploadedFiles").'.';
$max=@ini_get('upload_max_filesize');
if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit",$max*1024,$langs->trans("Kb")).'.';
@@ -147,8 +147,8 @@ print ' ';
print ' '.$langs->trans("UMask").' ';
print $form->textwithpicto('',$langs->trans("UMaskExplanation"));
print ' ';
@@ -158,8 +158,8 @@ print '';
print ' ';
// Use anti virus
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("AntiVirusCommand").' ';
print $langs->trans("AntiVirusCommandExample");
// Check command in inside safe_mode
@@ -181,8 +181,8 @@ print " ";
print ' ';
// Use anti virus
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("AntiVirusParam").' ';
print $langs->trans("AntiVirusParamExample");
print ' ';
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index ac0a1e883eb..e5c66d9e24b 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -103,7 +103,7 @@ print ' ';
$head=security_prepare_head();
-dol_fiche_head($head, 'misc', $langs->trans("Security"));
+dol_fiche_head($head, 'misc', $langs->trans("Security"), -1);
// Other Options
@@ -116,8 +116,8 @@ print ''.$langs->trans("Status").' ';
print ' ';
// Enable Captcha code
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("UseCaptchaCode").' ';
print '';
if (function_exists("imagecreatefrompng"))
@@ -146,8 +146,8 @@ else
print ' ';
// Enable advanced perms
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("UseAdvancedPerms").' ';
print '';
if (! empty($conf->use_javascript_ajax))
@@ -182,10 +182,10 @@ print ' '.$langs->trans("Parameters").' ';
print ''.$langs->trans("Value").' ';
print " \n";
-$var=!$var;
+
$sessiontimeout=ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout;
-print '';
+print ' ';
print ''.$langs->trans("SessionTimeOut").' ';
print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
print ' ';
@@ -194,10 +194,10 @@ print ' ';
print ' ';
-$var=!$var;
+
$sessiontimeout=ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE="";
-print '';
+print ' ';
print ''.$langs->trans("MAIN_APPLICATION_TITLE").' ';
print ' ';
print '';
diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php
index 05fe548daff..faf05b7fb0f 100644
--- a/htdocs/admin/sms.php
+++ b/htdocs/admin/sms.php
@@ -175,31 +175,31 @@ if ($action == 'edit')
print ' '.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
// Disable
- $var=!$var;
- print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").' ';
+
+ print ' '.$langs->trans("MAIN_DISABLE_ALL_SMS").' ';
print $form->selectyesno('MAIN_DISABLE_ALL_SMS',$conf->global->MAIN_DISABLE_ALL_SMS,1);
print ' ';
// Separator
- $var=!$var;
- print ' ';
+
+ print ' ';
// Method
- $var=!$var;
- print ''.$langs->trans("MAIN_SMS_SENDMODE").' ';
+
+ print ' '.$langs->trans("MAIN_SMS_SENDMODE").' ';
if (count($listofmethods)) print $form->selectarray('MAIN_SMS_SENDMODE',$listofmethods,$conf->global->MAIN_SMS_SENDMODE,1);
else print ''.$langs->trans("None").' ';
print ' ';
// From
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).' ';
+
+ print ''.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).' ';
print ' ';
// Autocopy to
- /*$var=!$var;
- print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' ';
+ /*
+ print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' ';
print ' ';
*/
@@ -224,31 +224,31 @@ else
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
// Disable
- $var=!$var;
- print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").' '.yn($conf->global->MAIN_DISABLE_ALL_SMS).' ';
+
+ print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").' '.yn($conf->global->MAIN_DISABLE_ALL_SMS).' ';
// Separator
- $var=!$var;
- print ' ';
+
+ print ' ';
// Method
- $var=!$var;
- print ''.$langs->trans("MAIN_SMS_SENDMODE").' ';
+
+ print ' '.$langs->trans("MAIN_SMS_SENDMODE").' ';
$text=$listofmethods[$conf->global->MAIN_SMS_SENDMODE];
if (empty($text)) $text=$langs->trans("Undefined").' '.img_warning();
print $text;
print ' ';
// From
- $var=!$var;
- print ''.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).' ';
+
+ print ''.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).' ';
print ''.$conf->global->MAIN_MAIL_SMS_FROM;
if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && ! isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) print ' '.img_warning($langs->trans("ErrorBadPhone"));
print ' ';
// Autocopy to
- /*$var=!$var;
- print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' ';
+ /*
+ print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' ';
print ''.$conf->global->MAIN_MAIL_AUTOCOPY_TO;
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && ! isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail"));
print ' ';
diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index f2a6d165bd5..1c5a92fb0e8 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -161,8 +161,8 @@ $var=true;
$found=0;
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("DeStockOnBill").' ';
print '';
if (! empty($conf->facture->enabled))
@@ -181,8 +181,8 @@ else
print " \n \n";
$found++;
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("DeStockOnValidateOrder").' ';
print '';
if (! empty($conf->commande->enabled))
@@ -203,8 +203,8 @@ $found++;
//if (! empty($conf->expedition->enabled))
//{
-$var=!$var;
-print " ";
+
+print ' ';
print ''.$langs->trans("DeStockOnShipment").' ';
print '';
if (! empty($conf->expedition->enabled))
@@ -223,8 +223,8 @@ else
print " \n \n";
$found++;
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("DeStockOnShipmentOnClosing").' ';
print '';
if (! empty($conf->expedition->enabled))
@@ -245,8 +245,8 @@ $found++;
/*if (! $found)
{
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.$langs->trans("NoModuleToManageStockDecrease").' ';
print " \n";
}*/
@@ -265,8 +265,8 @@ $var=true;
$found=0;
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("ReStockOnBill").' ';
print '';
if (! empty($conf->fournisseur->enabled))
@@ -286,8 +286,8 @@ print " \n \n";
$found++;
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("ReStockOnValidateOrder").' ';
print '';
if (! empty($conf->fournisseur->enabled))
@@ -306,8 +306,8 @@ else
print " \n \n";
$found++;
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("ReStockOnDispatchOrder").' ';
print '';
if (! empty($conf->fournisseur->enabled))
@@ -328,8 +328,8 @@ $found++;
/*if (! $found)
{
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.$langs->trans("NoModuleToManageStockIncrease").' ';
print " \n";
}*/
@@ -343,8 +343,8 @@ print " ".$langs->trans("RuleForStockAvailability")." \n";
print " \n";
print ''."\n";
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("WarehouseAllowNegativeTransfer").' ';
print '';
print "";
@@ -359,7 +359,7 @@ print " \n";
// Option to force stock to be enough before adding a line into document
if($conf->invoice->enabled) {
$var = !$var;
- print "";
+ print ' ';
print ''.$langs->trans("StockMustBeEnoughForInvoice").' ';
print '';
print "";
@@ -374,7 +374,7 @@ if($conf->invoice->enabled) {
if($conf->order->enabled) {
$var = !$var;
- print "";
+ print ' ';
print ''.$langs->trans("StockMustBeEnoughForOrder").' ';
print '';
print "";
@@ -389,7 +389,7 @@ if($conf->order->enabled) {
if($conf->expedition->enabled) {
$var = !$var;
- print "";
+ print ' ';
print ''.$langs->trans("StockMustBeEnoughForShipment").' ';
print '';
print "";
@@ -417,7 +417,7 @@ if ($virtualdiffersfromphysical)
print " \n";
print ' '."\n";
$var = !$var;
- print "";
+ print ' ';
print ''.$langs->trans("UseVirtualStockByDefault").' ';
print '';
print "";
@@ -441,8 +441,8 @@ print " \n";
print ' '."\n";
if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
- $var=!$var;
- print "";
+
+ print ' ';
print ''.$langs->trans("UseDispatchStatus").' ';
print '';
print "";
@@ -454,9 +454,9 @@ if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULAT
print " \n \n";
}
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("UserWarehouseAutoCreate").' ';
print '';
print "";
@@ -468,9 +468,9 @@ print ' ';
print " \n";
print " \n";
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("AllowAddLimitStockByWarehouse").' ';
print '';
@@ -489,9 +489,9 @@ print ' ';
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
if ($conf->global->PRODUIT_SOUSPRODUITS)
{
- $var=!$var;
+
- print " ";
+ print ' ';
print ''.$langs->trans("IndependantSubProductStock").' ';
print '';
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index 7510bfe37ef..2619951e1b5 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -250,8 +250,8 @@ foreach ($dirmodels as $reldir)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
- $var=!$var;
- print ' '.$module->nom." \n";
+
+ print ' '.$module->nom." \n";
print $module->info();
print ' ';
@@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir)
require_once $dir.'/'.$file;
$module = new $classname($db, new FactureFournisseur($db));
- $var=!$var;
+
print "\n";
print "";
print (empty($module->name)?$name:$module->name);
@@ -471,7 +471,7 @@ print ' '.$langs->trans("Value").' ';
print ' ';
print " \n";
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnInvoices").' '.img_info($langs->trans("AddCRIfTooLong")).'';
$variablename='SUPPLIER_INVOICE_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
@@ -505,7 +505,7 @@ print ' ';
print ' ';
print " \n";
-print '';
+print ' ';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").' ';
print ' ';
print " \n";
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index 1ac6ae86989..d54f0e367aa 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -279,8 +279,8 @@ foreach ($dirmodels as $reldir)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
- $var=!$var;
- print ''.$module->nom." \n";
+
+ print ' '.$module->nom." \n";
print $module->info();
print ' ';
@@ -402,7 +402,7 @@ foreach ($dirmodels as $reldir)
require_once $dir.'/'.$file;
$module = new $classname($db, new CommandeFournisseur($db));
- $var=!$var;
+
print "\n";
print "";
print (empty($module->name)?$name:$module->name);
@@ -493,7 +493,7 @@ print " \n";
$var=false;
//if ($conf->global->MAIN_FEATURES_LEVEL > 0)
//{
- print '';
+ print ' ';
print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').' ';
print $langs->trans("IfSetToYesDontForgetPermission");
print ' ';
@@ -501,15 +501,15 @@ $var=false;
print ' ';
print ' ';
print " \n";
- $var=!$var;
+
//}
// Ask for payment bank during supplier order
/* Kept as hidden for the moment
if ($conf->banque->enabled)
{
- $var=!$var;
- print '';
+
+ print ' ';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'   ';
if (! empty($conf->use_javascript_ajax))
{
@@ -530,13 +530,13 @@ if ($conf->banque->enabled)
}
else
{
- $var=!$var;
- print ' ';
+
+ print ' ';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '.$langs->trans('NotAvailable').' ';
}
*/
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnOrders").' '.img_info($langs->trans("AddCRIfTooLong")).' ';
$variablename='SUPPLIER_ORDER_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
@@ -571,7 +571,7 @@ print ' ';
print ' ';
print " \n";
-print '';
+print ' ';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").' ';
print ' ';
print " \n";
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index 933ee22a062..40caa94c8a8 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -279,7 +279,7 @@ foreach ($dirmodels as $reldir)
if ($module->isEnabled())
{
$var = !$var;
- print '';
+ print ' ';
echo preg_replace('/\-.*$/','',preg_replace('/mod_supplier_payment_/','',preg_replace('/\.php$/','',$file)));
print " \n";
@@ -384,7 +384,7 @@ foreach ($dirmodels as $reldir)
require_once $dir.'/'.$file;
$module = new $classname($db, new PaiementFourn($db));
- $var=!$var;
+
print " \n";
print "";
print (empty($module->name)?$name:$module->name);
diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php
index 7963aa7fabc..703fbc482e9 100644
--- a/htdocs/admin/supplier_proposal.php
+++ b/htdocs/admin/supplier_proposal.php
@@ -288,8 +288,8 @@ foreach ($dirmodels as $reldir)
if ($module->isEnabled())
{
- $var=!$var;
- print ' '.$module->nom." \n";
+
+ print ' '.$module->nom." \n";
print $module->info();
print ' ';
@@ -427,7 +427,7 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
$var = !$var;
- print '';
+ print ' ';
print (empty($module->name)?$name:$module->name);
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -527,7 +527,7 @@ $var=! $var;
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print $langs->trans("FreeLegalTextOnSupplierProposal").' '.img_info($langs->trans("AddCRIfTooLong")).'';
$variablename='SUPPLIER_PROPOSAL_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
@@ -545,11 +545,11 @@ print ' '
print " \n";
print ' ';
-$var=!$var;
+
print "";
print ' ';
print " ";
-print '';
+print ' ';
print $langs->trans("WatermarkOnDraftSupplierProposal").' ';
print ' ';
print ' ';
@@ -559,8 +559,8 @@ print '';
if ($conf->banque->enabled)
{
- $var=!$var;
- print ' ';
+
+ print ' ';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'   ';
if (! empty($conf->use_javascript_ajax))
{
@@ -581,8 +581,8 @@ if ($conf->banque->enabled)
}
else
{
- $var=!$var;
- print ' ';
+
+ print ' ';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '.$langs->trans('NotAvailable').' ';
}
diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index ae32c073349..71d06ae8e64 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -204,8 +204,8 @@ foreach ($syslogModules as $moduleName)
//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 '';
+
+ print ' ';
print '';
print ' ';
print $module->getName();
@@ -257,8 +257,8 @@ print ' '.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
print " \n";
$var=true;
-$var=!$var;
-print ''.$langs->trans("SyslogLevel").' ';
+
+print ''.$langs->trans("SyslogLevel").' ';
print '';
print 'global->SYSLOG_LEVEL==LOG_EMERG?'SELECTED':'').'>LOG_EMERG ('.LOG_EMERG.') ';
print 'global->SYSLOG_LEVEL==LOG_ALERT?'SELECTED':'').'>LOG_ALERT ('.LOG_ALERT.') ';
diff --git a/htdocs/admin/system/browser.php b/htdocs/admin/system/browser.php
index b2b5499d298..4051392c82c 100644
--- a/htdocs/admin/system/browser.php
+++ b/htdocs/admin/system/browser.php
@@ -51,24 +51,24 @@ $var=true;
print '';
print '
';
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' '."\n";
-$var=!$var;
-print ''.$langs->trans("UserAgent").' '.$_SERVER['HTTP_USER_AGENT'].' '."\n";
-$var=!$var;
-print ''.$langs->trans("BrowserName").' '.$tmp['browsername'].' '."\n";
-$var=!$var;
-print ''.$langs->trans("BrowserOS").' '.$tmp['browseros'].' '."\n";
-$var=!$var;
-print ''.$langs->trans("Version").' '.$tmp['browserversion'].' '."\n";
-$var=!$var;
-print ''.$langs->trans("Layout").' (phone/tablet/classic) '.$tmp['layout'].' '."\n";
-$var=!$var;
-print ''.$langs->trans("IPAddress").' '.$_SERVER['REMOTE_ADDR'].' '."\n";
-$var=!$var;
-print ''.$langs->trans("SessionName").' '.session_name().' '."\n";
-$var=!$var;
-print ''.$langs->trans("SessionId").' '.session_id().' '."\n";
-$var=!$var;
-print ''.$langs->trans("Screen").' ';
+
+print ' '.$langs->trans("UserAgent").' '.$_SERVER['HTTP_USER_AGENT'].' '."\n";
+
+print ''.$langs->trans("BrowserName").' '.$tmp['browsername'].' '."\n";
+
+print ''.$langs->trans("BrowserOS").' '.$tmp['browseros'].' '."\n";
+
+print ''.$langs->trans("Version").' '.$tmp['browserversion'].' '."\n";
+
+print ''.$langs->trans("Layout").' (phone/tablet/classic) '.$tmp['layout'].' '."\n";
+
+print ''.$langs->trans("IPAddress").' '.$_SERVER['REMOTE_ADDR'].' '."\n";
+
+print ''.$langs->trans("SessionName").' '.session_name().' '."\n";
+
+print ''.$langs->trans("SessionId").' '.session_id().' '."\n";
+
+print ''.$langs->trans("Screen").' ';
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
print ' '."\n";
print '
';
diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php
index 0fb3a6c9a7b..9590260f005 100644
--- a/htdocs/admin/system/constall.php
+++ b/htdocs/admin/system/constall.php
@@ -170,8 +170,8 @@ foreach($configfileparameters as $key)
continue;
}
- $var=!$var;
- print "
";
+
+ print ' ';
if ($newkey == 'separator')
{
print ' ';
@@ -238,9 +238,9 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print ' ';
+ print ' ';
print ''.$obj->name.' '."\n";
print ''.$obj->value.' '."\n";
if (empty($conf->multicompany->enabled) || !$user->entity) print ''.$obj->entity.' '."\n"; // If superadmin or multicompany disabled
diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php
index 6e528c73094..1e70cbab6cc 100644
--- a/htdocs/admin/system/database-tables.php
+++ b/htdocs/admin/system/database-tables.php
@@ -108,8 +108,8 @@ else
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.$obj->Name.' ';
print ''.$obj->Engine.' ';
@@ -163,8 +163,8 @@ else
while ($i < $num)
{
$row = $db->fetch_row($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.$row[0].' ';
print ''.$row[1].' ';
print ''.$row[2].' ';
@@ -205,7 +205,7 @@ else
$count = '?';
}
- print " ";
+ print ' ';
print ''.$row[0].' ';
print ''.$count.' ';
print ' ';
diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php
index c50e6ca9e4c..39511e8a814 100644
--- a/htdocs/admin/system/database.php
+++ b/htdocs/admin/system/database.php
@@ -103,8 +103,8 @@ else
$var=true;
foreach($listtouse as $param => $paramval)
{
- $var=!$var;
- print '
';
+
+ print ' ';
print '';
print $param;
print ' ';
diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php
index 3fc10bb0f3f..624edc2f38e 100644
--- a/htdocs/admin/system/dbtable.php
+++ b/htdocs/admin/system/dbtable.php
@@ -111,8 +111,8 @@ else
while ($i < $num)
{
$row = $db->fetch_row($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
print "$row[0] ";
print "$row[1] ";
diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php
index 6a5384da69a..c96a085456a 100644
--- a/htdocs/admin/system/dolibarr.php
+++ b/htdocs/admin/system/dolibarr.php
@@ -72,8 +72,8 @@ $var=true;
print '';
print '
';
print ''.$langs->trans("Version").' '.$langs->trans("Value").' '."\n";
-$var=!$var;
-print ''.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").') '.DOL_VERSION;
+
+print ' '.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").') '.DOL_VERSION;
// If current version differs from last upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
{
@@ -123,10 +123,10 @@ if (function_exists('curl_init'))
}
print ' '."\n";
-$var=!$var;
-print ''.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").') '.$conf->global->MAIN_VERSION_LAST_UPGRADE.' '."\n";
-$var=!$var;
-print ''.$langs->trans("VersionLastInstall").' '.$conf->global->MAIN_VERSION_LAST_INSTALL.' '."\n";
+
+print ''.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").') '.$conf->global->MAIN_VERSION_LAST_UPGRADE.' '."\n";
+
+print ''.$langs->trans("VersionLastInstall").' '.$conf->global->MAIN_VERSION_LAST_INSTALL.' '."\n";
print '
';
print '
';
print ' ';
@@ -136,29 +136,29 @@ $var=true;
print '';
print '
';
print ''.$langs->trans("Session").' '.$langs->trans("Value").' '."\n";
-$var=!$var;
-print ''.$langs->trans("SessionSavePath").' '.session_save_path().' '."\n";
-$var=!$var;
-print ''.$langs->trans("SessionName").' '.session_name().' '."\n";
-$var=!$var;
-print ''.$langs->trans("SessionId").' '.session_id().' '."\n";
-$var=!$var;
-print ''.$langs->trans("CurrentSessionTimeOut").' '.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds");
+
+print ' '.$langs->trans("SessionSavePath").' '.session_save_path().' '."\n";
+
+print ''.$langs->trans("SessionName").' '.session_name().' '."\n";
+
+print ''.$langs->trans("SessionId").' '.session_id().' '."\n";
+
+print ''.$langs->trans("CurrentSessionTimeOut").' '.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds");
print ' ';
print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
print " \n";
-$var=!$var;
-print ''.$langs->trans("CurrentTheme").' '.$conf->theme.' '."\n";
-$var=!$var;
-print ''.$langs->trans("CurrentMenuHandler").' ';
+
+print ' '.$langs->trans("CurrentTheme").' '.$conf->theme.' '."\n";
+
+print ''.$langs->trans("CurrentMenuHandler").' ';
print $conf->standard_menu;
print ' '."\n";
-$var=!$var;
-print ''.$langs->trans("Screen").' ';
+
+print ' '.$langs->trans("Screen").' ';
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
print ' '."\n";
-$var=!$var;
-print ''.$langs->trans("Session").' ';
+
+print ' '.$langs->trans("Session").' ';
$i=0;
foreach($_SESSION as $key => $val)
{
@@ -188,8 +188,8 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
foreach($shmoparray as $key => $val)
{
- $var=!$var;
- print ' '.$key.' ';
+
+ print ''.$key.' ';
print ''.count($val).' ';
print ''.dol_getshmopaddress($key).' ';
print ' '."\n";
@@ -206,40 +206,40 @@ $var=true;
print '';
print '
';
print ''.$langs->trans("LocalisationDolibarrParameters").' '.$langs->trans("Value").' '."\n";
-$var=!$var;
-print ''.$langs->trans("LanguageBrowserParameter","HTTP_ACCEPT_LANGUAGE").' '.$_SERVER["HTTP_ACCEPT_LANGUAGE"].' '."\n";
-$var=!$var;
-print ''.$langs->trans("CurrentUserLanguage").' '.$langs->getDefaultLang().' '."\n";
+
+print ''.$langs->trans("LanguageBrowserParameter","HTTP_ACCEPT_LANGUAGE").' '.$_SERVER["HTTP_ACCEPT_LANGUAGE"].' '."\n";
+
+print ''.$langs->trans("CurrentUserLanguage").' '.$langs->getDefaultLang().' '."\n";
// Thousands
-$var=!$var;
+
$thousand=$langs->transnoentitiesnoconv("SeparatorThousand");
if ($thousand == 'SeparatorThousand') $thousand=' '; // ' ' does not work on trans method
if ($thousand == 'None') $thousand='';
-print ''.$langs->trans("CurrentValueSeparatorThousand").' '.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).' '."\n";
+print ''.$langs->trans("CurrentValueSeparatorThousand").' '.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).' '."\n";
// Decimals
-$var=!$var;
+
$dec=$langs->transnoentitiesnoconv("SeparatorDecimal");
-print ''.$langs->trans("CurrentValueSeparatorDecimal").' '.$dec.' '."\n";
+print ''.$langs->trans("CurrentValueSeparatorDecimal").' '.$dec.' '."\n";
// Show results of functions to see if everything works
-$var=!$var;
-print ' => price2num(1233.56+1) '.price2num(1233.56+1,'2').' '."\n";
-$var=!$var;
+
+print ' => price2num(1233.56+1) '.price2num(1233.56+1,'2').' '."\n";
+
print " => price2num('."'1".$thousand."234".$dec."56') ".price2num("1".$thousand."234".$dec."56",'2')." \n";
if (($thousand != ',' && $thousand != '.') || ($thousand != ' '))
{
- $var=!$var;
+
print " => price2num('."'1 234.56') ".price2num("1 234.56",'2')." ";
print " \n";
}
-$var=!$var;
-print ' => price(1234.56) '.price(1234.56).' '."\n";
+
+print ' => price(1234.56) '.price(1234.56).' '."\n";
// Timezone
$txt =$langs->trans("OSTZ").' (variable system TZ): '.(! empty($_ENV["TZ"])?$_ENV["TZ"]:$langs->trans("NotDefined")).' '."\n";
$txt.=$langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone")?ini_get("date.timezone"):$langs->trans("NotDefined")).''." \n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
$txt.=$langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ)?$langs->trans("NotDefined"):$conf->global->MAIN_SERVER_TZ);
//$txt.=$langs->trans("YouCanEditPHPTZ"); // deprecated
-$var=!$var;
-print ''.$langs->trans("CurrentTimeZone").' '; // Timezone server PHP
+
+print ' '.$langs->trans("CurrentTimeZone").' '; // Timezone server PHP
$a=getServerTimeZoneInt('now');
$b=getServerTimeZoneInt('winter');
$c=getServerTimeZoneInt('summer');
@@ -251,19 +251,19 @@ $val.=' '.getServerTimeZoneString();
$val.=' '.$langs->trans("DaylingSavingTime").': '.($daylight==='unknown'?'unknown':($a==$c?yn($daylight):yn(0).($daylight?' ('.$langs->trans('YesInSummer').')':'')));
print $form->textwithtooltip($val,$txt,2,1,img_info(''));
print ' '."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
-$var=!$var;
-print ' => '.$langs->trans("CurrentHour").' '.dol_print_date(dol_now(),'dayhour','tzserver').' '."\n";
-$var=!$var;
-print ' => dol_print_date(0,"dayhourtext") '.dol_print_date(0,"dayhourtext").' ';
-$var=!$var;
-print ' => dol_get_first_day(1970,1,false) '.dol_get_first_day(1970,1,false).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').') ';
-$var=!$var;
-print ' => dol_get_first_day(1970,1,true) '.dol_get_first_day(1970,1,true).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').') ';
+
+print ' => '.$langs->trans("CurrentHour").' '.dol_print_date(dol_now(),'dayhour','tzserver').' '."\n";
+
+print ' => dol_print_date(0,"dayhourtext") '.dol_print_date(0,"dayhourtext").' ';
+
+print ' => dol_get_first_day(1970,1,false) '.dol_get_first_day(1970,1,false).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').') ';
+
+print ' => dol_get_first_day(1970,1,true) '.dol_get_first_day(1970,1,true).' (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').') ';
// Database timezone
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
{
- $var=!$var;
- print ''.$langs->trans("MySQLTimeZone").' (database) '; // Timezone server base
+
+ print ' '.$langs->trans("MySQLTimeZone").' (database) '; // Timezone server base
$sql="SHOW VARIABLES where variable_name = 'system_time_zone'";
$resql = $db->query($sql);
if ($resql)
@@ -274,9 +274,9 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
print ' '."\n";
}
// Client
-$var=!$var;
+
$tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
-print ''.$langs->trans("ClientTZ").' '.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')';
+print ' '.$langs->trans("ClientTZ").' '.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')';
print ' '.$_SESSION['dol_tz_string'];
print ' '.$langs->trans("DaylingSavingTime").': ';
if ($_SESSION['dol_dst']>0) print yn(1);
@@ -284,19 +284,19 @@ else print yn(0);
if (! empty($_SESSION['dol_dst_first'])) print ' ('.dol_print_date(dol_stringtotime($_SESSION['dol_dst_first']),'dayhour','gmt').' - '.dol_print_date(dol_stringtotime($_SESSION['dol_dst_second']),'dayhour','gmt').')';
print ' '."\n";
print ''."\n";
-$var=!$var;
-print ' => '.$langs->trans("ClientHour").' '.dol_print_date(dol_now(),'dayhour','tzuser').' '."\n";
-$var=!$var;
+print ' => '.$langs->trans("ClientHour").' '.dol_print_date(dol_now(),'dayhour','tzuser').' '."\n";
+
+
$filesystemencoding=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
-print ''.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding) '.$filesystemencoding.' '."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
+print ''.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding) '.$filesystemencoding.' '."\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 '
';
print '
';
@@ -384,8 +384,8 @@ foreach($configfileparameters as $key => $value)
}
if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue;
- $var=!$var;
- print "";
+
+ print ' ';
if (strpos($newkey, 'separator') !== false)
{
print ' ';
@@ -468,9 +468,9 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print ' ';
+ print ' ';
print ''.$obj->name.' '."\n";
print ''.$obj->value.' '."\n";
if (empty($conf->multicompany->enabled) || !$user->entity) print ''.$obj->entity.' '."\n"; // If superadmin or multicompany disabled
diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php
index 498e1ec54f0..c64379a96f1 100644
--- a/htdocs/admin/system/filecheck.php
+++ b/htdocs/admin/system/filecheck.php
@@ -50,11 +50,11 @@ $var = true;
print '';
print ''.$langs->trans("Version").' '.$langs->trans("Value").' '."\n";
$var = ! $var;
-print ''.$langs->trans("VersionLastInstall").' '.$conf->global->MAIN_VERSION_LAST_INSTALL.' '."\n";
+print ''.$langs->trans("VersionLastInstall").' '.$conf->global->MAIN_VERSION_LAST_INSTALL.' '."\n";
$var = ! $var;
-print ''.$langs->trans("VersionLastUpgrade").' '.$conf->global->MAIN_VERSION_LAST_UPGRADE.' '."\n";
+print ''.$langs->trans("VersionLastUpgrade").' '.$conf->global->MAIN_VERSION_LAST_UPGRADE.' '."\n";
$var = ! $var;
-print ''.$langs->trans("VersionProgram").' '.DOL_VERSION;
+print ' '.$langs->trans("VersionProgram").' '.DOL_VERSION;
// If current version differs from last upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) {
// Compare version with last install database version (upgrades never occured)
@@ -95,13 +95,13 @@ print ''."\n";
if (dol_is_file($xmlfile))
{
print ' '.$langs->trans("LocalSignature").' = ';
- print ' ';
+ print ' ';
print ' ';
}
else
{
print ' '.$langs->trans("LocalSignature").' = ';
- print ' ';
+ print ' ';
print ' ('.$langs->trans("AvailableOnlyOnPackagedVersions").') ';
print ' ';
}
@@ -109,7 +109,7 @@ print ''."\n";
if ($enableremotecheck)
{
print ' '.$langs->trans("RemoteSignature").' = ';
- print ' ';
+ print ' ';
}
else
{
diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php
index 706e0215059..68a01340303 100644
--- a/htdocs/admin/system/modules.php
+++ b/htdocs/admin/system/modules.php
@@ -118,7 +118,7 @@ $rights_ids = array();
foreach($sortorder as $numero=>$name)
{
$idperms="";
- $var=!$var;
+
// Module
print " ';
$alt=$name.' - '.$modules_files[$numero];
diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php
index 3e9ccbc895f..6bb431bfdfb 100644
--- a/htdocs/admin/system/phpinfo.php
+++ b/htdocs/admin/system/phpinfo.php
@@ -82,8 +82,8 @@ foreach($phparray as $key => $value)
{
if (! is_array($keyvalue))
{
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.$keyparam.' ';
$valtoshow=$keyvalue;
if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue,80);
@@ -97,8 +97,8 @@ foreach($phparray as $key => $value)
}
else
{
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.$keyparam.' ';
$i=0;
foreach($keyvalue as $keyparam2 => $keyvalue2)
diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php
index 00bf0635293..788d8604584 100644
--- a/htdocs/admin/taxes.php
+++ b/htdocs/admin/taxes.php
@@ -204,7 +204,7 @@ print " \n";
foreach ($list as $key)
{
- $var=!$var;
+
print '';
diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php
index 5a142f3e51e..68d56bd2ded 100644
--- a/htdocs/admin/tools/eaccelerator.php
+++ b/htdocs/admin/tools/eaccelerator.php
@@ -174,7 +174,7 @@ function create_script_table($list)
foreach($list as $script) {
$var = ! $var;
- print ' ';
+ print ' ';
print ''.dol_trunc($script['file'],80,'left').' ';
print ''.dol_print_date($script['mtime'],'dayhour').' ';
print ''.number_format($script['size'] / 1024, 2).'KB ';
@@ -207,7 +207,7 @@ function create_key_table($list)
foreach($list as $key) {
$var = !$var;
- print ' ';
+ print ' ';
print ''.dol_trunc($key['name'],80,'left').' ';
print ''.dol_print_date($key['created'],'dayhour').' ';
print ''.number_format($key['size']/1024, 3).'KB ';
@@ -239,37 +239,37 @@ print ' ';
print 'Information ';
print ' ';
$var = !$var;
-print '';
+print ' ';
print 'Caching enabled ';
print ''.($info['cache']?'yes':'no').' ';
print ' ';
$var = !$var;
-print '';
+print ' ';
print 'Optimizer enabled ';
print ''.$info['optimizer']?'yes':'no'.' ';
print ' ';
$var = !$var;
-print '';
+print ' ';
print 'Memory usage ';
print ''.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB) ';
print ' ';
$var = ! $var;
-print '';
+print ' ';
print 'Free memory in reserved cache ';
print ''.number_format($info['memoryAvailable']/(1024*1024), 2).'MB ';
print ' ';
$var = ! $var;
-print '';
+print ' ';
print 'Cached scripts ';
print ''.$info['cachedScripts'].' ';
print ' ';
$var = ! $var;
-print '';
+print ' ';
print 'Removed scripts ';
print ''.$info['removedScripts'].' ';
print ' ';
$var = ! $var;
-print '';
+print ' ';
print 'Cached keys ';
print ''.(isset($info['cachedKeys'])?$info['cachedKeys']:'').' ';
print ' ';
@@ -289,12 +289,12 @@ if (is_array($resCached) || is_array($resRemoved)) {
if (is_array($resCached)) {
$var = ! $var;
- print "";
+ print ' ';
print "Caching ";
print ' ';
print " ";
$var = ! $var;
- print "";
+ print ' ';
print "Optimizer ";
print ' ';
print " ";
@@ -302,17 +302,17 @@ if (is_array($resCached) || is_array($resRemoved)) {
if (is_array($resRemoved)) {
$var = ! $var;
- print "";
+ print ' ';
print "Clear cache ";
print ' ';
print " ";
$var = ! $var;
- print "";
+ print ' ';
print "Clean cache ";
print ' ';
print " ";
$var = ! $var;
- print "";
+ print ' ';
print "Purge cache ";
print ' ';
print "
";
diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php
index 4e0651597ee..f5e6afd36b1 100644
--- a/htdocs/admin/tools/listevents.php
+++ b/htdocs/admin/tools/listevents.php
@@ -261,9 +261,9 @@ if ($result)
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
- print ' ';
+ print ' ';
// Date
print ''.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').' ';
diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php
index c313c91a7bd..56db6eb2ad7 100644
--- a/htdocs/admin/tools/listsessions.php
+++ b/htdocs/admin/tools/listsessions.php
@@ -141,9 +141,9 @@ if ($savehandler == 'files')
foreach ($listofsessions as $key => $sessionentry)
{
- $var=!$var;
+
- print " ";
+ print ' ';
// Login
print ''.$sessionentry['login'].' ';
diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php
index 7d07f7ead94..6d3ee6ced8e 100644
--- a/htdocs/admin/translation.php
+++ b/htdocs/admin/translation.php
@@ -57,10 +57,6 @@ if (! $sortfield) $sortfield='lang,transkey';
if (! $sortorder) $sortorder='ASC';
-/*
- * Actions
- */
-
/*
* Actions
*/
@@ -83,7 +79,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$search_array_options=array();
}
-
if ($action == 'add' || (GETPOST('add') && $action != 'update'))
{
$error=0;
@@ -105,18 +100,22 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
}
if (! $error)
{
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')";
+ $db->begin();
+
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".$db->escape($conf->entity).")";
$result = $db->query($sql);
if ($result > 0)
{
- setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
+ $db->commit();
+ setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$action="";
$transkey="";
$transvalue="";
}
else
{
- dol_print_error($db);
+ $db->rollback();
+ setEventMessages($db->lasterror(), null, 'errors');
$action='';
}
}
@@ -181,7 +180,7 @@ print ' ';
$head=translation_prepare_head();
-dol_fiche_head($head, $mode, '', 0, '');
+dol_fiche_head($head, $mode, '', -1, '');
if ($mode == 'overwrite')
{
@@ -210,10 +209,9 @@ if ($mode == 'overwrite')
// Line to add new record
- $var=false;
print "\n";
- print ' ';
+ print ' ';
print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, 0, 'maxwidthonsmartphone', 1);
print ' '."\n";
print '';
@@ -240,18 +238,10 @@ if ($mode == 'overwrite')
// Show constants
- $sql = "SELECT";
- $sql.= " rowid";
- $sql.= ", lang";
- $sql.= ", transkey";
- $sql.= ", transvalue";
+ $sql = "SELECT rowid, entity, lang, transkey, transvalue";
$sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans";
$sql.= " WHERE 1 = 1";
//$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")";
- //if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
- //else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
- //if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
- //$sql.= " ORDER BY entity, name ASC";
$sql.= $db->order($sortfield, $sortorder);
dol_syslog("translation::select from table", LOG_DEBUG);
@@ -260,16 +250,14 @@ if ($mode == 'overwrite')
{
$num = $db->num_rows($result);
$i = 0;
- $var=false;
while ($i < $num)
{
$obj = $db->fetch_object($result);
- $var=!$var;
print "\n";
- print ' ';
+ print ' ';
print ''.$obj->lang.' '."\n";
print ''.$obj->transkey.' '."\n";
@@ -336,8 +324,8 @@ if ($mode == 'searchkey')
foreach($filearray as $file)
{
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
- $newlang->load($tmpfile, 0, 0, '', 0);
- $newlangfileonly->load($tmpfile, 0, 0, '', 1);
+ $newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
+ $newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records '."\n";
}
}
@@ -376,10 +364,9 @@ if ($mode == 'searchkey')
print " \n";
// Line to search new record
- $var=false;
print "\n";
- print '';
+ print ' ';
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
print $formadmin->select_language($langcode,'langcode', 0, null, 0, 0, 0, 'maxwidthonsmartphone', 1);
print ' '."\n";
@@ -412,14 +399,12 @@ if ($mode == 'searchkey')
// Show result
$i=0;
- $var=false;
foreach($recordtoshow as $key => $val)
{
$i++;
if ($i <= $offset) continue;
if ($i > ($offset + $limit)) break;
- $var=!$var;
- print ''.$langcode.' '.$key.' ';
+ print ' '.$langcode.' '.$key.' ';
print dol_escape_htmltag($val);
print ' ';
if ($val != $newlangfileonly->tab_translate[$key])
@@ -429,7 +414,7 @@ if ($mode == 'searchkey')
}
/*if (! empty($conf->multicompany->enabled) && !$user->entity)
{
- print $val;
+ print ' '.$val.' ';
}*/
print ' '."\n";
}
diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php
index c1224bffe89..0aae9c6915e 100644
--- a/htdocs/admin/triggers.php
+++ b/htdocs/admin/triggers.php
@@ -64,8 +64,8 @@ print '
$var=True;
foreach ($triggers as $trigger)
{
- $var=!$var;
- print '';
+
+ print ' ';
print ''.$trigger['picto'].' ';
print ''.$trigger['file'].' ';
print ''.$trigger['status'].' ';
diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php
index f76762c8334..42feea8f8ec 100644
--- a/htdocs/admin/user.php
+++ b/htdocs/admin/user.php
@@ -35,16 +35,83 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("admin");
$langs->load("members");
$langs->load("users");
-
if (! $user->admin) accessforbidden();
$extrafields = new ExtraFields($db);
+$action = GETPOST('action','alpha');
+$value = GETPOST('value','alpha');
+$type='user';
/*
* Action
*/
-if (preg_match('/set_(.*)/',$action,$reg))
+
+// Activate a model
+
+// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
+if ($action == 'setModuleOptions')
+{
+ $post_size=count($_POST);
+
+ $db->begin();
+
+ for($i=0;$i < $post_size;$i++)
+ {
+ if (array_key_exists('param'.$i,$_POST))
+ {
+ $param=GETPOST("param".$i,'alpha');
+ $value=GETPOST("value".$i,'alpha');
+ if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
+ if (! $res > 0) $error++;
+ }
+ }
+ if (! $error)
+ {
+ $db->commit();
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ $db->rollback();
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
+elseif ($action == 'set_default')
+{
+ $ret = addDocumentModel($value, $type, $label, $scandir);
+ $res = true;
+}
+
+elseif ($action == 'del_default')
+{
+ $ret = delDocumentModel($value, $type);
+ if ($ret > 0)
+ {
+ if ($conf->global->USER_ADDON_PDF_ODT == "$value") dolibarr_del_const($db, 'USER_ADDON_PDF_ODT',$conf->entity);
+ }
+ $res = true;
+}
+
+// Set default model
+elseif ($action == 'setdoc')
+{
+ if (dolibarr_set_const($db, "USER_ADDON_PDF_ODT",$value,'chaine',0,'',$conf->entity))
+ {
+ // La constante qui a ete lue en avant du nouveau set
+ // on passe donc par une variable pour avoir un affichage coherent
+ $conf->global->USER_ADDON_PDF_ODT = $value;
+ }
+
+ // On active le modele
+ $ret = delDocumentModel($value, $type);
+ if ($ret > 0)
+ {
+ $ret = addDocumentModel($value, $type, $label, $scandir);
+ }
+ $res = true;
+}
+elseif (preg_match('/set_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
@@ -58,7 +125,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
}
}
-if (preg_match('/del_(.*)/',$action,$reg))
+elseif (preg_match('/del_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
@@ -72,7 +139,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
}
}
//Set hide closed customer into combox or select
-if ($action == 'sethideinactiveuser')
+elseif ($action == 'sethideinactiveuser')
{
$status = GETPOST('status','alpha');
@@ -113,8 +180,8 @@ $var=true;
$form = new Form($db);
// Mail required for members
-$var=!$var;
-print ' ';
+
+print ' ';
print ''.$langs->trans("UserMailRequired").' ';
print ' ';
@@ -138,6 +205,164 @@ print ' ';
print '
';
+
+
+$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
+
+$form=new Form($db);
+
+// Defini tableau def des modeles
+$def = array();
+$sql = "SELECT nom";
+$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
+$sql.= " WHERE type = '".$type."'";
+$sql.= " AND entity = ".$conf->entity;
+$resql=$db->query($sql);
+if ($resql)
+{
+ $i = 0;
+ $num_rows=$db->num_rows($resql);
+ while ($i < $num_rows)
+ {
+ $array = $db->fetch_array($resql);
+ array_push($def, $array[0]);
+ $i++;
+ }
+}
+else
+{
+ dol_print_error($db);
+}
+
+print '';
+print '';
+print ''.$langs->trans("Name").' ';
+print ''.$langs->trans("Description").' ';
+print ''.$langs->trans("Status")." \n";
+print ''.$langs->trans("Default")." \n";
+print ''.$langs->trans("ShortInfo").' ';
+print ''.$langs->trans("Preview").' ';
+print " \n";
+
+clearstatcache();
+
+$var=true;
+foreach ($dirmodels as $reldir)
+{
+ foreach (array('','/doc') as $valdir)
+ {
+ $dir = dol_buildpath($reldir."core/modules/user".$valdir);
+ if (is_dir($dir))
+ {
+ $handle=opendir($dir);
+ if (is_resource($handle))
+ {
+ while (($file = readdir($handle))!==false)
+ {
+ $filelist[]=$file;
+ }
+ closedir($handle);
+ arsort($filelist);
+
+ foreach($filelist as $file)
+ {
+ if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
+ {
+
+ if (file_exists($dir.'/'.$file))
+ {
+ $name = substr($file, 4, dol_strlen($file) -16);
+ $classname = substr($file, 0, dol_strlen($file) -12);
+
+ require_once $dir.'/'.$file;
+ $module = new $classname($db);
+
+ $modulequalified=1;
+ if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
+ if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
+
+ if ($modulequalified)
+ {
+ $var = !$var;
+ print '';
+ print (empty($module->name)?$name:$module->name);
+ print " \n";
+ if (method_exists($module,'info')) print $module->info($langs);
+ else print $module->description;
+ print ' ';
+
+ // Active
+ if (in_array($name, $def))
+ {
+ print ''."\n";
+ print '';
+ print img_picto($langs->trans("Enabled"),'switch_on');
+ print ' ';
+ print ' ';
+ }
+ else
+ {
+ print ''."\n";
+ print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').' ';
+ print " ";
+ }
+
+ // Defaut
+ print '';
+ if ($conf->global->USER_ADDON_PDF == $name)
+ {
+ print img_picto($langs->trans("Default"),'on');
+ }
+ else
+ {
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').' ';
+ }
+ print ' ';
+
+ // Info
+ $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
+ $htmltooltip.=' '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
+ if ($module->type == 'pdf')
+ {
+ $htmltooltip.=' '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
+ }
+ $htmltooltip.=''.$langs->trans("FeaturesSupported").': ';
+ $htmltooltip.=' '.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
+ $htmltooltip.=' '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
+ $htmltooltip.=' '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
+ $htmltooltip.=' '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
+ $htmltooltip.=' '.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
+
+
+ print '';
+ print $form->textwithpicto('',$htmltooltip,1,0);
+ print ' ';
+
+ // Preview
+ print '';
+ if ($module->type == 'pdf')
+ {
+ print ''.img_object($langs->trans("Preview"),'contract').' ';
+ }
+ else
+ {
+ print img_object($langs->trans("PreviewNotAvailable"),'generic');
+ }
+ print ' ';
+
+ print " \n";
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+print '
';
+print " ";
+
dol_fiche_end();
llxFooter();
diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php
new file mode 100644
index 00000000000..db5ef3cbf59
--- /dev/null
+++ b/htdocs/admin/usergroup.php
@@ -0,0 +1,316 @@
+
+ * Copyright (C) 2003 Jean-Louis Bergamo
+ * Copyright (C) 2004-2009 Laurent Destailleur
+ * Copyright (C) 2004 Sebastien Di Cintio
+ * Copyright (C) 2004 Benoit Mortier
+ * Copyright (C) 2005-2011 Regis Houssin
+ * Copyright (C) 2015 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/admin/usergroup.php
+ * \ingroup core
+ * \brief Page to setup usergroup module
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+
+$langs->load("admin");
+$langs->load("members");
+$langs->load("users");
+if (! $user->admin) accessforbidden();
+
+$extrafields = new ExtraFields($db);
+
+$action = GETPOST('action','alpha');
+$value = GETPOST('value','alpha');
+$type='group';
+
+/*
+ * Action
+ */
+
+// Activate a model
+
+// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
+if ($action == 'setModuleOptions')
+{
+ $post_size=count($_POST);
+
+ $db->begin();
+
+ for($i=0;$i < $post_size;$i++)
+ {
+ if (array_key_exists('param'.$i,$_POST))
+ {
+ $param=GETPOST("param".$i,'alpha');
+ $value=GETPOST("value".$i,'alpha');
+ if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
+ if (! $res > 0) $error++;
+ }
+ }
+ if (! $error)
+ {
+ $db->commit();
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ $db->rollback();
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
+elseif ($action == 'set_default')
+{
+ $ret = addDocumentModel($value, $type, $label, $scandir);
+ $res = true;
+}
+
+elseif ($action == 'del_default')
+{
+ $ret = delDocumentModel($value, $type);
+ if ($ret > 0)
+ {
+ if ($conf->global->USERGROUP_ADDON_PDF_ODT == "$value") dolibarr_del_const($db, 'USERGROUP_ADDON_PDF_ODT',$conf->entity);
+ }
+ $res = true;
+}
+
+// Set default model
+elseif ($action == 'setdoc')
+{
+ if (dolibarr_set_const($db, "USERGROUP_ADDON_PDF_ODT",$value,'chaine',0,'',$conf->entity))
+ {
+ // La constante qui a ete lue en avant du nouveau set
+ // on passe donc par une variable pour avoir un affichage coherent
+ $conf->global->USERGROUP_ADDON_PDF_ODT = $value;
+ }
+
+ // On active le modele
+ $ret = delDocumentModel($value, $type);
+ if ($ret > 0)
+ {
+ $ret = addDocumentModel($value, $type, $label, $scandir);
+ }
+ $res = true;
+}
+elseif (preg_match('/set_(.*)/',$action,$reg))
+{
+ $code=$reg[1];
+ if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
+ {
+ header("Location: ".$_SERVER["PHP_SELF"]);
+ exit;
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+}
+
+elseif (preg_match('/del_(.*)/',$action,$reg))
+{
+ $code=$reg[1];
+ if (dolibarr_del_const($db, $code, $conf->entity) > 0)
+ {
+ header("Location: ".$_SERVER["PHP_SELF"]);
+ exit;
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+}
+/*
+ * View
+ */
+
+$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios';
+llxHeader('',$langs->trans("UsersSetup"),$help_url);
+
+$linkback=''.$langs->trans("BackToModuleList").' ';
+print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup');
+
+
+$head=user_admin_prepare_head();
+
+dol_fiche_head($head,'usergroupcard', $langs->trans("MenuUsersAndGroups"), 0, 'user');
+
+
+$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
+
+$form=new Form($db);
+
+// Defini tableau def des modeles
+$def = array();
+$sql = "SELECT nom";
+$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
+$sql.= " WHERE type = '".$type."'";
+$sql.= " AND entity = ".$conf->entity;
+$resql=$db->query($sql);
+if ($resql)
+{
+ $i = 0;
+ $num_rows=$db->num_rows($resql);
+ while ($i < $num_rows)
+ {
+ $array = $db->fetch_array($resql);
+ array_push($def, $array[0]);
+ $i++;
+ }
+}
+else
+{
+ dol_print_error($db);
+}
+
+print '';
+print '';
+print ''.$langs->trans("Name").' ';
+print ''.$langs->trans("Description").' ';
+print ''.$langs->trans("Status")." \n";
+print ''.$langs->trans("Default")." \n";
+print ''.$langs->trans("ShortInfo").' ';
+print ''.$langs->trans("Preview").' ';
+print " \n";
+
+clearstatcache();
+
+$var=true;
+foreach ($dirmodels as $reldir)
+{
+ foreach (array('','/doc') as $valdir)
+ {
+ $dir = dol_buildpath($reldir."core/modules/usergroup".$valdir);
+ if (is_dir($dir))
+ {
+ $handle=opendir($dir);
+ if (is_resource($handle))
+ {
+ while (($file = readdir($handle))!==false)
+ {
+ $filelist[]=$file;
+ }
+ closedir($handle);
+ arsort($filelist);
+
+ foreach($filelist as $file)
+ {
+ if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
+ {
+
+ if (file_exists($dir.'/'.$file))
+ {
+ $name = substr($file, 4, dol_strlen($file) -16);
+ $classname = substr($file, 0, dol_strlen($file) -12);
+
+ require_once $dir.'/'.$file;
+ $module = new $classname($db);
+
+ $modulequalified=1;
+ if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
+ if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
+
+ if ($modulequalified)
+ {
+ $var = !$var;
+ print '';
+ print (empty($module->name)?$name:$module->name);
+ print " \n";
+ if (method_exists($module,'info')) print $module->info($langs);
+ else print $module->description;
+ print ' ';
+
+ // Active
+ if (in_array($name, $def))
+ {
+ print ''."\n";
+ print '';
+ print img_picto($langs->trans("Enabled"),'switch_on');
+ print ' ';
+ print ' ';
+ }
+ else
+ {
+ print ''."\n";
+ print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').' ';
+ print " ";
+ }
+
+ // Defaut
+ print '';
+ if ($conf->global->USERGROUP_ADDON_PDF == $name)
+ {
+ print img_picto($langs->trans("Default"),'on');
+ }
+ else
+ {
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').' ';
+ }
+ print ' ';
+
+ // Info
+ $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
+ $htmltooltip.=' '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
+ if ($module->type == 'pdf')
+ {
+ $htmltooltip.=' '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
+ }
+ $htmltooltip.=''.$langs->trans("FeaturesSupported").': ';
+ $htmltooltip.=' '.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
+ $htmltooltip.=' '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
+ $htmltooltip.=' '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
+ $htmltooltip.=' '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
+ $htmltooltip.=' '.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
+
+
+ print '';
+ print $form->textwithpicto('',$htmltooltip,1,0);
+ print ' ';
+
+ // Preview
+ print '';
+ if ($module->type == 'pdf')
+ {
+ print ''.img_object($langs->trans("Preview"),'contract').' ';
+ }
+ else
+ {
+ print img_object($langs->trans("PreviewNotAvailable"),'generic');
+ }
+ print ' ';
+
+ print " \n";
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+print '
';
+print " ";
+
+dol_fiche_end();
+
+llxFooter();
+$db->close();
diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php
index 1204fded0aa..7aef2671c8d 100644
--- a/htdocs/api/class/api.class.php
+++ b/htdocs/api/class/api.class.php
@@ -90,7 +90,6 @@ class DolibarrApi
// Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses
unset($object->linkedObjects);
- unset($object->lignes); // should be ->lines
unset($object->oldline);
unset($object->error);
diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php
index b622aa1d9dd..14b6dabf5e5 100644
--- a/htdocs/bookmarks/admin/bookmark.php
+++ b/htdocs/bookmarks/admin/bookmark.php
@@ -75,8 +75,8 @@ print '';
print ''.$langs->trans("Name").' ';
print ''.$langs->trans("Value").' ';
print " \n";
-$var=!$var;
-print '';
+
+print ' ';
print $langs->trans("NbOfBoomarkToShow").' ';
print ' ';
print ' ';
diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php
index 3cee534e797..d84713d1e62 100644
--- a/htdocs/bookmarks/bookmarks.lib.php
+++ b/htdocs/bookmarks/bookmarks.lib.php
@@ -41,9 +41,12 @@ function printBookmarksList($aDb, $aLangs)
$langs->load("bookmarks");
$url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:'');
-
+ // TODO Add post param to $url
+
$ret = '';
+
// Menu bookmark
+ /*
$ret.= '';
-
+ */
$ret.= ''."\n";
+ $ret.= '';
+ $ret.= '';
+ $ret.= ' ';
+
+ $ret.=ajax_combobox('boxbookmark');
+
+ $ret.='';
$ret .= '';
return $ret;
diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php
index 818a38c28df..a9d4a39ef85 100644
--- a/htdocs/bookmarks/card.php
+++ b/htdocs/bookmarks/card.php
@@ -157,15 +157,19 @@ if ($action == 'create')
print '';
- print ''.$langs->trans("BookmarkTitle").' '.$langs->trans("SetHereATitleForLink").' ';
-
- print ''.$langs->trans("UrlOrLink").' '.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").' ';
+ print ''.$langs->trans("BookmarkTitle").' '.$langs->trans("SetHereATitleForLink").' ';
+ dol_set_focus('#titlebookmark');
+
+ // Url
+ print ''.$langs->trans("UrlOrLink").' '.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").' ';
+ // Target
print ''.$langs->trans("BehaviourOnClick").' ';
$liste=array(0=>$langs->trans("ReplaceWindow"),1=>$langs->trans("OpenANewWindow"));
print $form->selectarray('target',$liste,1);
print ' '.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").' ';
+ // Owner
print ''.$langs->trans("Owner").' ';
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:$user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print ' ';
@@ -219,9 +223,11 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
$linkback = ''.$langs->trans("BackToList").' ';
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0);
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0);
- print '
';
+ print '';
+
+ print '
';
print '
';
print '';
@@ -297,6 +303,8 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
print '
';
+ print '
';
+
dol_fiche_end();
if ($action == 'edit')
diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php
index d72fb19a6e5..40a316d881b 100644
--- a/htdocs/bookmarks/list.php
+++ b/htdocs/bookmarks/list.php
@@ -27,32 +27,40 @@ require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
$langs->load("bookmarks");
$langs->load("admin");
+$action=GETPOST('action','alpha');
+$massaction=GETPOST('massaction','alpha');
+$show_files=GETPOST('show_files','int');
+$confirm=GETPOST('confirm','alpha');
+$toselect = GETPOST('toselect', 'array');
+
// Security check
if (! $user->rights->bookmark->lire) {
restrictedArea($user, 'bookmarks');
}
$optioncss = GETPOST('optioncss','alpha');
+$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
-if ($page == -1) { $page = 0 ; }
-$offset = $conf->liste_limit * $page ;
+if ($page == -1) { $page = 0; }
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-if (! $sortorder) $sortorder="ASC";
-if (! $sortfield) $sortfield="position";
-$limit=$conf->liste_limit;
+if (! $sortfield) $sortfield='position';
+if (! $sortorder) $sortorder='ASC';
+
+$id = GETPOST("bid",'int');
/*
* Actions
*/
-if ($_GET["action"] == 'delete')
+if ($action == 'delete')
{
$bookmark=new Bookmark($db);
- $res=$bookmark->remove($_GET["bid"]);
+ $res=$bookmark->remove($id);
if ($res > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
@@ -71,9 +79,9 @@ if ($_GET["action"] == 'delete')
$userstatic=new User($db);
-llxHeader();
+llxHeader('', $langs->trans("ListOfBookmarks"));
-print load_fiche_titre($langs->trans("Bookmarks"));
+print load_fiche_titre($langs->trans("ListOfBookmarks"));
$sql = "SELECT b.fk_soc as rowid, b.dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
$sql.= " u.login, u.lastname, u.firstname";
@@ -100,12 +108,9 @@ if ($resql)
print "";
//print " ";
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","", $param,'align="left"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Title"),'','');
- print "";
+ print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"title","", $param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Link"),'','');
- print "";
print_liste_field_titre($langs->trans("Target"),'','','','','align="center"');
- print "";
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","", $param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","", $param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","", $param,'align="right"',$sortfield,$sortorder);
@@ -117,8 +122,8 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
// Id
print '';
@@ -126,8 +131,8 @@ if ($resql)
print ' ';
$linkintern=0;
- $title=dol_trunc($obj->title,24);
- $link=dol_trunc($obj->url,24);
+ $title=$obj->title;
+ $link=$obj->url;
// Title
print "";
@@ -152,7 +157,7 @@ if ($resql)
print " \n";
// Url
- print "";
+ print ' ';
if (! $linkintern) print 'target?' target="newlink"':'').'>';
print $link;
if (! $linkintern) print ' ';
diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php
index de60e8b80cf..0d1dbf2de53 100644
--- a/htdocs/cashdesk/admin/cashdesk.php
+++ b/htdocs/cashdesk/admin/cashdesk.php
@@ -100,27 +100,27 @@ print '';
print '';
print ''.$langs->trans("Parameters").' '.$langs->trans("Value").' ';
print " \n";
-$var=!$var;
-print ''.$langs->trans("CashDeskThirdPartyForSell").' ';
+
+print ''.$langs->trans("CashDeskThirdPartyForSell").' ';
print '';
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,0,1,array(),0);
print ' ';
if (! empty($conf->banque->enabled))
{
- $var=!$var;
- print ''.$langs->trans("CashDeskBankAccountForSell").' ';
+
+ print ''.$langs->trans("CashDeskBankAccountForSell").' ';
print '';
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH,'CASHDESK_ID_BANKACCOUNT_CASH',0,"courant=2",1);
print ' ';
- $var=!$var;
- print ''.$langs->trans("CashDeskBankAccountForCheque").' ';
+
+ print ''.$langs->trans("CashDeskBankAccountForCheque").' ';
print '';
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE,'CASHDESK_ID_BANKACCOUNT_CHEQUE',0,"courant=1",1);
print ' ';
- $var=!$var;
- print ''.$langs->trans("CashDeskBankAccountForCB").' ';
+
+ print ''.$langs->trans("CashDeskBankAccountForCB").' ';
print '';
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB,'CASHDESK_ID_BANKACCOUNT_CB',0,"courant=1",1);
print ' ';
@@ -128,8 +128,8 @@ if (! empty($conf->banque->enabled))
if (! empty($conf->stock->enabled))
{
- $var=!$var;
- print ''.$langs->trans("CashDeskDoNotDecreaseStock").' '; // Force warehouse (this is not a default value)
+
+ print ''.$langs->trans("CashDeskDoNotDecreaseStock").' '; // Force warehouse (this is not a default value)
print '';
if (empty($conf->productbatch->enabled)) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
@@ -145,8 +145,8 @@ if (! empty($conf->stock->enabled))
$disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK;
- $var=!$var;
- print ' '.$langs->trans("CashDeskIdWareHouse").' '; // Force warehouse (this is not a default value)
+
+ print ''.$langs->trans("CashDeskIdWareHouse").' '; // Force warehouse (this is not a default value)
print '';
if (! $disabled)
{
@@ -163,7 +163,7 @@ if (! empty($conf->stock->enabled))
if (! empty($conf->service->enabled))
{
$var=! $var;
- print ' ';
+ print ' ';
print $langs->trans("CashdeskShowServices");
print ' ';
print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1);
@@ -174,7 +174,7 @@ if (! empty($conf->service->enabled))
if (! empty($conf->receiptprinter->enabled))
{
$var=! $var;
- print ' ';
+ print ' ';
print $langs->trans("DolibarrReceiptPrinter").' ('.$langs->trans("FeatureNotYetAvailable").')';
print ' ';
print $form->selectyesno("CASHDESK_DOLIBAR_RECEIPT_PRINTER",$conf->global->CASHDESK_DOLIBAR_RECEIPT_PRINTER,1);
diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php
index 9a61a50b38a..8f6af8b6d4d 100644
--- a/htdocs/cashdesk/index.php
+++ b/htdocs/cashdesk/index.php
@@ -63,7 +63,7 @@ top_htmlhead('','',0,0,'',$arrayofcss);
logo_small))
{
- print ' ';
+ print ' ';
}
else
{
diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php
index 78ce86f45f7..40be470c429 100644
--- a/htdocs/cashdesk/tpl/ticket.tpl.php
+++ b/htdocs/cashdesk/tpl/ticket.tpl.php
@@ -37,7 +37,7 @@ $object->fetch($facid);
- logo_small).'">'; ?>
+ logo_small).'">'; ?>
name; ?>
diff --git a/htdocs/cashdesk/tpl/validation2.tpl.php b/htdocs/cashdesk/tpl/validation2.tpl.php
index 8f24e2069aa..a6e2fe2a3f3 100644
--- a/htdocs/cashdesk/tpl/validation2.tpl.php
+++ b/htdocs/cashdesk/tpl/validation2.tpl.php
@@ -41,7 +41,7 @@ $langs->load("bills");
-
trans("ShowInvoice"); ?>
+
trans("ShowInvoice"); ?>
trans("PrintTicket"); ?>
diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php
index d1af6bdafb2..bc27be9bb12 100644
--- a/htdocs/categories/admin/categorie.php
+++ b/htdocs/categories/admin/categorie.php
@@ -96,8 +96,8 @@ $var=true;
$form = new Form($db);
// Mail required for members
-$var=!$var;
-print '
';
+
+print ' ';
print ''.$langs->trans("CategorieRecursiv").' ';
print ''. $form->textwithpicto('',$langs->trans("CategorieRecursivHelp"),1,'help').' ';
diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php
index 1f37623544b..a08abdfc545 100644
--- a/htdocs/categories/class/api_categories.class.php
+++ b/htdocs/categories/class/api_categories.class.php
@@ -248,6 +248,7 @@ class Categories extends DolibarrApi
if( ! count($obj_ret)) {
throw new RestException(404, 'No category found');
}
+
return $obj_ret;
}
@@ -351,9 +352,47 @@ class Categories extends DolibarrApi
$object = parent::_cleanObjectDatas($object);
- // Remove the subscriptions because they are handled as a subresource.
- //unset($object->subscriptions);
-
+ // Remove fields not relevent to categories
+ unset($object->country);
+ unset($object->country_id);
+ unset($object->country_code);
+ unset($object->total_ht);
+ unset($object->total_ht);
+ unset($object->total_localtax1);
+ unset($object->total_localtax2);
+ unset($object->total_ttc);
+ unset($object->total_tva);
+ unset($object->lines);
+ unset($object->fk_incoterms);
+ unset($object->libelle_incoterms);
+ unset($object->location_incoterms);
+ unset($object->civility_id);
+ unset($object->name);
+ unset($object->lastname);
+ unset($object->firstname);
+ unset($object->shipping_method_id);
+ unset($object->fk_delivery_address);
+ unset($object->cond_reglement);
+ unset($object->cond_reglement_id);
+ unset($object->mode_reglement_id);
+ unset($object->barcode_type_coder);
+ unset($object->barcode_type_label);
+ unset($object->barcode_type_code);
+ unset($object->barcode_type);
+ unset($object->canvas);
+ unset($object->cats);
+ unset($object->motherof);
+ unset($object->context);
+ unset($object->socid);
+ unset($object->thirdparty);
+ unset($object->contact);
+ unset($object->contact_id);
+ unset($object->user);
+ unset($object->fk_account);
+ unset($object->fk_project);
+ unset($object->note);
+ unset($object->statut);
+
return $object;
}
diff --git a/htdocs/categories/class/api_deprecated_category.class.php b/htdocs/categories/class/api_deprecated_category.class.php
index 6f2f16bb222..271f2900502 100644
--- a/htdocs/categories/class/api_deprecated_category.class.php
+++ b/htdocs/categories/class/api_deprecated_category.class.php
@@ -291,7 +291,7 @@ class CategoryApi extends DolibarrApi
* @url GET /customer/{cusid}/categories
*/
function getListCustomerCategories($cusid, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
- return $this->getListForItem('customer', $sortfield, $sortorder, $limit, $page, $cusid);
+ return $this->getListForItem($sortfield, $sortorder, $limit, $page, 'customer', $cusid);
}
/**
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index 464b9bf3127..b2cd3d3dd31 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -49,9 +49,10 @@ class Categorie extends CommonObject
const TYPE_MEMBER = 3; // TODO Replace this value with 'member'
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
- const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
- const TYPE_PROJECT = 6;
- public $picto = 'category';
+ const TYPE_ACCOUNT = 5; // TODO Replace this value with 'bank_account'
+ const TYPE_PROJECT = 6;
+ const TYPE_BANK_LINE = 'bank_line';
+ public $picto = 'category';
/**
@@ -1337,34 +1338,68 @@ class Categorie extends CommonObject
$type = $map_type[$type];
}
- $sql = "SELECT ct.fk_categorie, c.label, c.rowid";
- $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
- $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type];
- $sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")";
-
- $res = $this->db->query($sql);
- if ($res)
+ if ($type == Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code
{
- while ($obj = $this->db->fetch_object($res))
- {
- if ($mode == 'id') {
- $cats[] = $obj->rowid;
- } else if ($mode == 'label') {
- $cats[] = $obj->label;
- } else {
- $cat = new Categorie($this->db);
- $cat->fetch($obj->fk_categorie);
- $cats[] = $cat;
- }
- }
-
- return $cats;
- }
- else
- {
- dol_print_error($this->db);
- return -1;
+ // Load bank groups
+ $sql = "SELECT c.label, c.rowid";
+ $sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c";
+ $sql.= " WHERE a.lineid=".$id." AND a.fk_categ = c.rowid";
+ $sql.= " ORDER BY c.label";
+
+ $res = $this->db->query($sql);
+ if ($res)
+ {
+ while ($obj = $this->db->fetch_object($res))
+ {
+ if ($mode == 'id') {
+ $cats[] = $obj->rowid;
+ } else if ($mode == 'label') {
+ $cats[] = $obj->label;
+ } else {
+ $cat = new Categorie($this->db);
+ $cat->id = $obj->rowid;
+ $cat->label = $obj->label;
+ $cats[] = $cat;
+ }
+ }
+ }
+ else
+ {
+ dol_print_error($this->db);
+ return -1;
+ }
}
+ else
+ {
+ $sql = "SELECT ct.fk_categorie, c.label, c.rowid";
+ $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
+ $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type];
+ $sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")";
+
+ $res = $this->db->query($sql);
+ if ($res)
+ {
+ while ($obj = $this->db->fetch_object($res))
+ {
+ if ($mode == 'id') {
+ $cats[] = $obj->rowid;
+ } else if ($mode == 'label') {
+ $cats[] = $obj->label;
+ } else {
+ $cat = new Categorie($this->db);
+ $cat->fetch($obj->fk_categorie);
+ $cats[] = $cat;
+ }
+ }
+ }
+ else
+ {
+ dol_print_error($this->db);
+ return -1;
+ }
+ }
+
+ return $cats;
}
@@ -1532,14 +1567,14 @@ class Categorie extends CommonObject
{
while (($file = readdir($handle)) !== false)
{
- if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file))
+ if (dol_is_file($dir.$file) && preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file))
{
$nbphoto++;
$photo = $file;
// On determine nom du fichier vignette
$photo_vignette='';
- if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs))
+ if (preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs))
{
$photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo).'_small'.$regs[0];
}
@@ -1582,7 +1617,7 @@ class Categorie extends CommonObject
dol_delete_file($file,1);
// Si elle existe, on efface la vignette
- if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$filename,$regs))
+ if (preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$filename,$regs))
{
$photo_vignette=preg_replace('/'.$regs[0].'/i','',$filename).'_small'.$regs[0];
if (file_exists($dirthumb.$photo_vignette))
diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php
index ee03f9f4771..100d2d0d48e 100644
--- a/htdocs/categories/photos.php
+++ b/htdocs/categories/photos.php
@@ -105,7 +105,7 @@ if ($object->id)
$head = categories_prepare_head($object,$type);
- dol_fiche_head($head, 'photos', $title, 0, 'category');
+ dol_fiche_head($head, 'photos', $title, -1, 'category');
$linkback = ''.$langs->trans("BackToList").' ';
@@ -130,6 +130,7 @@ if ($object->id)
print ' ';
+ print '';
print '
';
print '
';
@@ -146,7 +147,8 @@ if ($object->id)
print '';
print "
\n";
-
+ print '
';
+
print dol_fiche_end();
@@ -198,7 +200,7 @@ if ($object->id)
$dir = $upload_dir.'/'.$pdir;
print ' ';
- print '';
+ print '';
foreach ($object->liste_photos($dir) as $key => $obj)
{
@@ -255,14 +257,12 @@ if ($object->id)
$nbphoto++;
}
+ print '
';
+
if ($nbphoto < 1)
{
- print '';
- print " ".$langs->trans("NoPhotoYet")." ";
- print ' ';
+ print ''.$langs->trans("NoPhotoYet")."
";
}
-
- print '
';
}
}
else
diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php
index a239b357045..7dbe6325e1d 100644
--- a/htdocs/categories/traduction.php
+++ b/htdocs/categories/traduction.php
@@ -167,7 +167,7 @@ if (! empty($object->multilangs))
}
}
-dol_fiche_head($head, 'translation', $title, 0, 'category');
+dol_fiche_head($head, 'translation', $title, -1, 'category');
$linkback = ''.$langs->trans("BackToList").' ';
@@ -184,6 +184,7 @@ dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref',
print ' ';
+print '';
print '
';
print '
';
@@ -201,6 +202,7 @@ print $formother->showColor($object->color);
print '';
print '
';
+print '
';
dol_fiche_end();
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index a1c33c568f3..ebd5fa9991c 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -192,7 +192,7 @@ else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type);
-dol_fiche_head($head, 'card', $title, 0, 'category');
+dol_fiche_head($head, 'card', $title, -1, 'category');
$linkback = ''.$langs->trans("BackToList").' ';
@@ -219,11 +219,12 @@ if ($action == 'delete')
print ' ';
+print '';
print '
';
print '
';
// Description
-print '';
+print ' ';
print $langs->trans("Description").' ';
print dol_htmlentitiesbr($object->description);
print ' ';
@@ -241,6 +242,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
}
print '
';
+print '
';
dol_fiche_end();
@@ -290,7 +292,7 @@ else
$var=true;
foreach ($cats as $cat)
{
- $var=!$var;
+
print "\t \n";
print "\t\t".'';
print "".$cat->label." ";
@@ -361,7 +363,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
$var=true;
foreach ($prods as $prod)
{
- $var=!$var;
+
print "\t \n";
print '';
print $prod->getNomUrl(1);
@@ -412,7 +414,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER)
$var=true;
foreach ($socs as $soc)
{
- $var=!$var;
+
print "\t \n";
print '';
@@ -468,7 +470,7 @@ if($object->type == Categorie::TYPE_CUSTOMER)
if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself
$i++;
- $var=!$var;
+
print "\t \n";
print '';
print $soc->getNomUrl(1);
@@ -521,7 +523,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
$var=true;
foreach ($prods as $key => $member)
{
- $var=!$var;
+
print "\t \n";
print '';
$member->ref=$member->login;
@@ -576,7 +578,7 @@ if($object->type == Categorie::TYPE_CONTACT)
foreach ($contacts as $key => $contact)
{
$i++;
- $var=!$var;
+
print "\t \n";
print '';
print $contact->getNomUrl(1,'category');
@@ -630,7 +632,7 @@ if ($object->type == Categorie::TYPE_ACCOUNT)
$var=true;
foreach ($accounts as $key => $account)
{
- $var=!$var;
+
print "\t \n";
print '';
print $account->getNomUrl(1,0);
@@ -685,7 +687,7 @@ if ($object->type == Categorie::TYPE_PROJECT)
$var=true;
foreach ($projects as $key => $project)
{
- $var=!$var;
+
print "\t \n";
print '';
print $project->getNomUrl(1,0);
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index f853e88a0df..fc4fc218971 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -752,6 +752,8 @@ if ($action == 'create')
print '
';
print ' ';
+
+
print '';
// Related company
@@ -1184,7 +1186,7 @@ if ($id > 0)
}
else
{
- dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action');
+ dol_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action');
// Clone event
@@ -1255,6 +1257,8 @@ if ($id > 0)
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
+ print '';
+
print '
';
// Affichage fiche action en mode visu
@@ -1320,7 +1324,7 @@ if ($id > 0)
print '
';
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '
';
- if (in_array($user->id,array_keys($listofuserid)))
+ if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
{
print '
';
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
@@ -1345,6 +1349,7 @@ if ($id > 0)
print '
';
+ print '
';
print '
';
if ($conf->societe->enabled)
@@ -1380,21 +1385,6 @@ if ($id > 0)
}
print '';
}
-
- // Project
- /*
- if (! empty($conf->projet->enabled))
- {
- print ''.$langs->trans("Project").' ';
- if ($object->fk_project)
- {
- $project=new Project($db);
- $project->fetch($object->fk_project);
- print $project->getNomUrl(1,'',1);
- }
- print ' ';
- }
- */
// Priority
print ''.$langs->trans("Priority").' ';
@@ -1423,7 +1413,9 @@ if ($id > 0)
//Extra field
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
- print '';
+ print ' ';
+ print '
';
+ print '';
foreach($extrafields->attribute_label as $key=>$label)
{
if (isset($_POST["options_" . $key])) {
@@ -1443,6 +1435,8 @@ if ($id > 0)
print '
';
}
+ print '';
+
dol_fiche_end();
}
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 7140bb09a1e..fc0bbebb901 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -936,7 +936,7 @@ class ActionComm extends CommonObject
$response->label = $langs->trans("ActionsToDo");
$response->url = DOL_URL_ROOT.'/comm/action/listactions.php?status=todo&mainmenu=agenda';
if ($user->rights->agenda->allactions->read) $response->url.='&filtert=-1';
- $response->img = img_object($langs->trans("Actions"),"action");
+ $response->img = img_object('',"action");
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 241843623c2..2caa55bcd59 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -121,7 +121,7 @@ if ($object->id > 0)
$now=dol_now();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
- dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
+ dol_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action');
$linkback = img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"');
$linkback.= ''.$langs->trans("BackToList").' ';
@@ -164,6 +164,8 @@ if ($object->id > 0)
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
+ print '';
+
print '
';
// Affichage fiche action en mode visu
@@ -236,13 +238,10 @@ if ($object->id > 0)
print '
';
-
- print ' ';
-
print '';
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
@@ -255,7 +254,9 @@ if ($object->id > 0)
print '
';
- dol_fiche_end();
+ print '';
+
+ dol_fiche_end();
$modulepart = 'actions';
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index f8b50fb588a..d365acef38b 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -306,28 +306,28 @@ $param.="&maxprint=".$maxprint;
// Show navigation bar
if (empty($action) || $action=='show_month')
{
- $nav ="".img_previous($langs->trans("Previous"), 'class="valignbottom"')." \n";
+ $nav =" \n";
$nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,1,$year),"%b %Y");
$nav.=" \n";
- $nav.="".img_next($langs->trans("Next"), 'class="valignbottom"')." \n";
+ $nav.=" \n";
$nav.=" (".$langs->trans("Today")." )";
$picto='calendar';
}
if ($action=='show_week')
{
- $nav ="".img_previous($langs->trans("Previous"), 'class="valignbottom"')." \n";
+ $nav ="trans("Previous"))."\"> \n";
$nav.=" ".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week;
$nav.=" \n";
- $nav.="".img_next($langs->trans("Next"), 'class="valignbottom"')." \n";
+ $nav.=" trans("Next"))."\"> \n";
$nav.=" (".$langs->trans("Today")." )";
$picto='calendarweek';
}
if ($action=='show_day')
{
- $nav ="".img_previous($langs->trans("Previous"), 'class="valignbottom"')." \n";
+ $nav =" \n";
$nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"daytextshort");
$nav.=" \n";
- $nav.="".img_next($langs->trans("Next"), 'class="valignbottom"')." \n";
+ $nav.=" \n";
$nav.=" (".$langs->trans("Today")." )";
$picto='calendarday';
}
@@ -364,12 +364,19 @@ if (! empty($conf->use_javascript_ajax)) // If javascript on
$s.=''."\n";
$s.='' . "\n";
@@ -384,7 +391,6 @@ if (! empty($conf->use_javascript_ajax)) // If javascript on
$s.='jQuery(document).ready(function () {
jQuery("table input[name^=\"check_ext\"]").click(function() {
var name = $(this).attr("name");
-
jQuery(".family_ext" + name.replace("check_ext", "")).toggle();
});
});' . "\n";
@@ -957,7 +963,14 @@ if (count($listofextcals))
// Complete $eventarray with events coming from external module
$parameters=array(); $object=null;
$reshook=$hookmanager->executeHooks('getCalendarEvents',$parameters,$object,$action);
-if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($eventarray, $hookmanager->resArray['eventarray']);
+if (! empty($hookmanager->resArray['eventarray'])) {
+ foreach ($hookmanager->resArray['eventarray'] as $keyDate => $events) {
+ if (!isset($eventarray[$keyDate])) {
+ $eventarray[$keyDate]=array();
+ }
+ $eventarray[$keyDate]=array_merge($eventarray[$keyDate], $events);
+ }
+}
@@ -1000,10 +1013,10 @@ if (empty($action) || $action == 'show_month') // View by month
print $langs->trans($labelshort[$numdayinweek]);
}
else print $langs->trans("Day".$numdayinweek);
- print " \n";
+ print ' '."\n";
$i++;
}
- echo " \n";
+ echo ' '."\n";
$todayarray=dol_getdate($now,'fast');
$todaytms=dol_mktime(0, 0, 0, $todayarray['mon'], $todayarray['mday'], $todayarray['year']);
@@ -1186,21 +1199,23 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
global $theme_datacolor;
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
- print "\n".'';
+ $dateint = sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
+
+ print "\n";
// Line with title of day
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
- print '
'."\n";
+ print ''."\n";
- print '
';
- print ' ';
+ print '';
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
{
$newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
@@ -1211,11 +1226,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print img_picto($langs->trans("NewAction"),'edit_add.png');
print '';
}
- print '
'."\n";
+ print '
'."\n";
// Line with td contains all div of each events
- print '';
- print '';
+ print '
';
+ print '
';
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
@@ -1235,26 +1250,26 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
if ($i < $maxprint || $maxprint == 0 || ! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
{
- $keysofuserassigned=array_keys($event->userassigned);
+ $keysofuserassigned=array_keys($event->userassigned);
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
// Define $color (Hex string like '0088FF') and $cssclass of event
$color=-1; $colorindex=-1;
- if (in_array($user->id, $keysofuserassigned))
- {
- $nummytasks++; $cssclass='family_mytasks';
-
- if (empty($cacheusers[$event->userownerid]))
- {
- $newuser=new User($db);
- $newuser->fetch($event->userownerid);
- $cacheusers[$event->userownerid]=$newuser;
- }
- //var_dump($cacheusers[$event->userownerid]->color);
-
- // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
- if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
+ if (in_array($user->id, $keysofuserassigned))
+ {
+ $nummytasks++; $cssclass='family_mytasks';
+
+ if (empty($cacheusers[$event->userownerid]))
+ {
+ $newuser=new User($db);
+ $newuser->fetch($event->userownerid);
+ $cacheusers[$event->userownerid]=$newuser;
+ }
+ //var_dump($cacheusers[$event->userownerid]->color);
+
+ // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
+ if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
}
else if ($event->type_code == 'ICALEVENT') // Event come from external ical file
{
@@ -1332,7 +1347,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($user->rights->agenda->allactions->create ||
(($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create))
{
- $cssclass.= " movable";
+ $cssclass.= " movable cursormove";
}else{
$cssclass.= " unmovable";
}
@@ -1345,19 +1360,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// Show rect of event
print "\n";
- print '
'."\n";
+ print '
';
- print '
'; // always 1 li per ul, 1 ul per event
- print '';
- print 'transparency)?'':' cal_event_busy').'" style="'.$h;
+ print 'background: #'.$color.';';
+ print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, 0).'), to(#'.dol_color_minus($color, 1).'));';
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
- print ' -moz-border-radius:4px;" width="100%">';
- print '';
+ //print ' -moz-border-radius:4px;"';
+ //print 'border: 1px solid #ccc" width="100%"';
+ print '">';
+ print ' ';
+ print '';
+
+ $daterange='';
+
if ($event->type_code == 'BIRTHDAY') // It's a birthday
{
print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact');
@@ -1373,9 +1394,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// Date
if (empty($event->fulldayevent))
{
- //print '';
- $daterange='';
-
// Show hours (start ... end)
$tmpyearstart = date('Y',$event->date_start_in_calendar);
$tmpmonthstart = date('m',$event->date_start_in_calendar);
@@ -1408,20 +1426,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
$daterange.=dol_print_date($event->date_end_in_calendar,'%H:%M'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user
}
- //print $daterange;
- if ($event->type_code != 'ICALEVENT')
- {
- $savlabel=$event->libelle;
- $event->libelle=$daterange;
- print $event->getNomUrl(0);
- $event->libelle=$savlabel;
- }
- else
- {
- print $daterange;
- }
- //print ' ';
- print " \n";
}
else
{
@@ -1432,9 +1436,36 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
// Show title
- if ($event->type_code == 'ICALEVENT') print dol_trunc($event->libelle,$maxnbofchar);
- else print $event->getNomUrl(0,$maxnbofchar,'cal_event');
+ $titletoshow = $daterange;
+ $titletoshow.=($titletoshow?' ':'').$event->libelle;
+
+ if ($event->type_code == 'ICALEVENT') print $titletoshow;
+ else
+ {
+ $savlabel=$event->libelle;
+ $event->libelle=$titletoshow;
+ print $event->getNomUrl(0,$maxnbofchar,'cal_event','',0,1);
+ $event->libelle=$savlabel;
+ }
+ // Loop on each assigned user
+ $listofusertoshow='';
+ $posuserassigned=0;
+ foreach($event->userassigned as $tmpid => $tmpdata)
+ {
+ if (! $posuserassigned && $titletoshow) $listofusertoshow.=' ';
+ $posuserassigned++;
+ if (empty($cacheusers[$tmpid]))
+ {
+ $newuser=new User($db);
+ $newuser->fetch($tmpid);
+ $cacheusers[$tmpid]=$newuser;
+ }
+
+ $listofusertoshow.=$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'valigntextbottom');
+ }
+ print $listofusertoshow;
+
if ($event->type_code == 'ICALEVENT') print ' ('.dol_trunc($event->icalname,$maxnbofchar).')';
// If action related to company / contact
@@ -1477,12 +1508,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print ' ';
// Status - Percent
- print '';
- if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1);
+ $withstatus=0;
+ if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT')
+ {
+ $withstatus=1;
+ if ($event->percentage >= 0) $withstatus=2;
+ }
+ print ' ';
+ if ($withstatus) print $event->getLibStatut(3,1);
else print ' ';
print '
';
- print ' ';
- print ' ';
print '
'."\n";
$i++;
}
@@ -1524,10 +1559,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print ''."\n";
}
- print '
';
- print '
';
+ print ''; // td tr
- print '
'."\n";
+ print ''; // table
+ print "\n";
}
@@ -1535,14 +1570,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
* Change color with a delta
*
* @param string $color Color
- * @param int $minus Delta
+ * @param int $minus Delta (1 = 16 unit)
+ * @param int $minusunit Minus unit
* @return string New color
*/
-function dol_color_minus($color, $minus)
+function dol_color_minus($color, $minus, $minusunit = 16)
{
$newcolor=$color;
- $newcolor[0]=((hexdec($newcolor[0])-$minus)<0)?0:dechex((hexdec($newcolor[0])-$minus));
- $newcolor[2]=((hexdec($newcolor[2])-$minus)<0)?0:dechex((hexdec($newcolor[2])-$minus));
- $newcolor[4]=((hexdec($newcolor[4])-$minus)<0)?0:dechex((hexdec($newcolor[4])-$minus));
+ if ($minusunit == 16)
+ {
+ $newcolor[0]=dechex(max(min(hexdec($newcolor[0])-$minus, 15), 0));
+ $newcolor[2]=dechex(max(min(hexdec($newcolor[2])-$minus, 15), 0));
+ $newcolor[4]=dechex(max(min(hexdec($newcolor[4])-$minus, 15), 0));
+ }
+ else
+ {
+ // Not yet implemented
+ }
return $newcolor;
}
diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php
index 2ad3f424b12..7bee5550453 100644
--- a/htdocs/comm/action/info.php
+++ b/htdocs/comm/action/info.php
@@ -59,7 +59,7 @@ $object->fetch($id);
$object->info($object->id);
$head=actions_prepare_head($object);
-dol_fiche_head($head, 'info', $langs->trans("Action"),0,'action');
+dol_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action');
$linkback = img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"');
$linkback.= ''.$langs->trans("BackToList").' ';
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index 0a08b6e55f1..8b1dc424239 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
+include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$langs->load("users");
$langs->load("companies");
@@ -147,6 +148,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$form=new Form($db);
$userstatic=new User($db);
+$formactions=new FormActions($db);
$nav='';
$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
@@ -227,6 +229,7 @@ if ($type) $sql.= " AND c.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
+if ($status == '100') { $sql.= " AND a.percent = 100"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($search_title) $sql.=natural_search("a.label", $search_title);
@@ -324,7 +327,6 @@ if ($resql)
if ($optioncss != '') $nav.= ' ';
if ($actioncode) $nav.=' ';
if ($resourceid) $nav.=' ';
- if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.=' ';
if ($filter) $nav.=' ';
if ($filtert) $nav.=' ';
if ($socid) $nav.=' ';
@@ -341,21 +343,7 @@ if ($resql)
print '';
print '
'."\n";
- print '';
- print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
- //if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
- print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder);
- print_liste_field_titre("");
- print " \n";
-
- print '';
+ print ' ';
print ' ';
print ' ';
print ' ';
@@ -368,13 +356,29 @@ if ($resql)
print ' ';
print ' ';
print ' ';
- print ' ';
+ print '';
+ print $formactions->form_select_status_action('formaction',$status,1,'status',1,2);
+ print ' ';
// Action column
print '';
- $searchpitco=$form->showFilterAndCheckAddButtons(0);
+ $searchpitco=$form->showFilterButtons();
print $searchpitco;
print ' ';
print " \n";
+
+ print '';
+ print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
+ //if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
+ print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre("");
+ print " \n";
$contactstatic = new Contact($db);
$now=dol_now();
@@ -396,7 +400,7 @@ if ($resql)
continue;
}
- $var=!$var;
+
$actionstatic->id=$obj->id;
$actionstatic->ref=$obj->id;
@@ -405,7 +409,7 @@ if ($resql)
$actionstatic->type_picto=$obj->type_picto;
$actionstatic->label=$obj->label;
- print "";
+ print ' ';
// Action (type)
print '';
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index f5de3fa6ca3..61bf98634c4 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -242,10 +242,10 @@ $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
$tmpday = $first_day;
-$nav ="".img_previous($langs->trans("Previous"), 'class="valignbottom"')." \n";
+$nav ="trans("Previous"))."\"> \n";
$nav.=" ".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week;
$nav.=" \n";
-$nav.="".img_next($langs->trans("Next"), 'class="valignbottom"')." \n";
+$nav.=" trans("Next"))."\"> \n";
$nav.=" (".$langs->trans("Today")." )";
$picto='calendarweek';
diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php
index 97f255abe14..760d82f0246 100644
--- a/htdocs/comm/action/rapport/index.php
+++ b/htdocs/comm/action/rapport/index.php
@@ -135,8 +135,8 @@ if ($resql)
if ($obj)
{
- $var=!$var;
- print " ";
+
+ print ' ';
print "".$obj->df." \n";
print ''.$obj->cc.' ';
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 126c3fe0f62..31def3d1b29 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -460,7 +460,7 @@ if ($id > 0)
}
else
{
- print $langs->trans("ThirdpartyNotLinkedToMember");
+ print ''.$langs->trans("ThirdpartyNotLinkedToMember").' ';
}
print '';
print " \n";
@@ -519,7 +519,7 @@ if ($id > 0)
// Lien recap
$boxstat.='';
- $boxstat.='
';
+ $boxstat.='';
$boxstat.='';
if ($conf->propal->enabled)
@@ -639,8 +639,8 @@ if ($id > 0)
while ($i < $num && $i < $MAXLIST)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
print '';
$propal_static->id = $objp->propalid;
$propal_static->ref = $objp->ref;
@@ -723,8 +723,8 @@ if ($id > 0)
while ($i < $num && $i < $MAXLIST)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
print '';
$commande_static->id = $objp->cid;
$commande_static->ref = $objp->ref;
@@ -850,8 +850,8 @@ if ($id > 0)
$contrat=new Contrat($db);
$objp = $db->fetch_object($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
print '';
$contrat->id=$objp->id;
$contrat->ref=$objp->ref?$objp->ref:$objp->id;
@@ -906,7 +906,7 @@ if ($id > 0)
print ' '.img_picto($langs->trans("Statistics"),'stats').' ';
print '
';
print '';
- $var=!$var;
+
}
$i = 0;
while ($i < $num && $i < $MAXLIST)
@@ -916,13 +916,13 @@ if ($id > 0)
$fichinter_static->id=$objp->id;
$fichinter_static->statut=$objp->fk_statut;
- print "";
+ print ' ';
print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.' '."\n";
//print ''.dol_print_date($db->jdate($objp->startdate)).' '."\n";
print ''.convertSecondToTime($objp->duration).' '."\n";
print ''.$fichinter_static->getLibStatut(5).' '."\n";
print ' ';
- $var=!$var;
+
$i++;
}
$db->free($resql);
@@ -978,8 +978,8 @@ if ($id > 0)
while ($i < $num && $i < $MAXLIST)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print "";
+
+ print ' ';
print '';
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->facnumber;
@@ -1094,7 +1094,7 @@ if ($id > 0)
else print '';
}
- if ($object->client != 0) print '';
+ if ($object->client != 0) print '';
else print '';
}
diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php
index 7b71e3ade9c..fe66e3ac243 100644
--- a/htdocs/comm/contact.php
+++ b/htdocs/comm/contact.php
@@ -150,9 +150,9 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print " ";
+ print ' ';
print ''.img_object($langs->trans("ShowContact"),"contact");
print ' '.$obj->name.' ';
print "$obj->firstname ";
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index c967f303648..4bd999b1d5a 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -158,17 +158,17 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print '';
print '';
- print ''.$langs->trans("ProposalsDraft").($num?' '.$num.' ':'').' ';
+ print ''.$langs->trans("ProposalsDraft").($num?' '.$num.' ':'').' ';
+ $var=true;
if ($num > 0)
{
$i = 0;
- $var=true;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print '';
+
+ print ' ';
$propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref;
$propalstatic->ref_client=$obj->ref_client;
@@ -192,14 +192,14 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
}
if ($total>0)
{
- $var=!$var;
+
print ' '.$langs->trans("Total").' '.price($total)." ";
}
}
else
{
- $var=!$var;
- print ''.$langs->trans("NoProposal").' ';
+
+ print ''.$langs->trans("NoProposal").' ';
}
print "
";
@@ -239,17 +239,17 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
print '';
print '';
- print ''.$langs->trans("SupplierProposalsDraft").($num?' '.$num.' ':'').' ';
+ print ''.$langs->trans("SupplierProposalsDraft").($num?' '.$num.' ':'').' ';
+ $var=true;
if ($num > 0)
{
$i = 0;
- $var=true;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print '';
+
+ print ' ';
$supplierproposalstatic->id=$obj->rowid;
$supplierproposalstatic->ref=$obj->ref;
$supplierproposalstatic->total_ht = $obj->total_ht;
@@ -272,14 +272,14 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
}
if ($total>0)
{
- $var=!$var;
+
print ' '.$langs->trans("Total").' '.price($total)." ";
}
}
else
{
- $var=!$var;
- print ''.$langs->trans("NoProposal").' ';
+
+ print ''.$langs->trans("NoProposal").' ';
}
print "
";
@@ -318,17 +318,17 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
print '';
print '';
- print ''.$langs->trans("DraftOrders").($num?' '.$num.' ':'').' ';
+ print ''.$langs->trans("DraftOrders").($num?' '.$num.' ':'').' ';
- if ($num)
+ $var = true;
+ if ($num > 0)
{
$i = 0;
- $var = true;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print '';
+ print ' ';
$orderstatic->id=$obj->rowid;
$orderstatic->ref=$obj->ref;
$orderstatic->ref_client=$obj->ref_client;
@@ -352,14 +352,14 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
}
if ($total>0)
{
- $var=!$var;
+
print ' '.$langs->trans("Total").' '.price($total)." ";
}
}
else
{
- $var=!$var;
- print ''.$langs->trans("NoOrder").' ';
+
+ print ''.$langs->trans("NoOrder").' ';
}
print "
";
@@ -399,17 +399,17 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
print '';
print '';
- print ''.$langs->trans("DraftSuppliersOrders").($num?' '.$num.' ':'').' ';
+ print ''.$langs->trans("DraftSuppliersOrders").($num?' '.$num.' ':'').' ';
- if ($num)
+ $var = true;
+ if ($num > 0)
{
$i = 0;
- $var = true;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print '';
+ print ' ';
$supplierorderstatic->id=$obj->rowid;
$supplierorderstatic->ref=$obj->ref;
$supplierorderstatic->ref_supplier=$obj->ref_suppliert;
@@ -433,14 +433,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
}
if ($total>0)
{
- $var=!$var;
+
print ' '.$langs->trans("Total").' '.price($total)." ";
}
}
else
{
- $var=!$var;
- print ''.$langs->trans("NoSupplierOrder").' ';
+
+ print ''.$langs->trans("NoSupplierOrder").' ';
}
print "
";
@@ -485,12 +485,12 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
print '';
print '';
- print '';
+ print ' ';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max);
else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
else print $langs->trans("BoxTitleLastModifiedCustomers",$max);
- print '';
- print ' '.$langs->trans("DateModificationShort").' ';
+ print '';
+ print ''.$langs->trans("DateModificationShort").' ';
print ' ';
if ($num)
{
@@ -503,7 +503,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas=$objp->canvas;
- print '';
+ print ' ';
print ''.$companystatic->getNomUrl(1,'customer',48).' ';
print '';
print $companystatic->getLibCustProspStatut();
@@ -511,7 +511,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
print ' '.dol_print_date($db->jdate($objp->tms),'day')." ";
print ' ';
$i++;
- $var=!$var;
+
}
@@ -519,7 +519,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
}
else
{
- print ''.$langs->trans("None").' ';
+ print ''.$langs->trans("None").' ';
}
print "
";
}
@@ -549,8 +549,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
$i = 0;
print '';
- print ''.$langs->trans("BoxTitleLastModifiedSuppliers",min($max,$num)).' ';
- print ''.$langs->trans("DateModificationShort").' ';
+ print ''.$langs->trans("BoxTitleLastModifiedSuppliers",min($max,$num)).' ';
+ print ''.$langs->trans("DateModificationShort").' ';
print ' ';
if ($num)
{
@@ -562,18 +562,18 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas=$objp->canvas;
- print '';
+ print ' ';
print ''.$companystatic->getNomUrl(1,'supplier',44).' ';
print ''.dol_print_date($db->jdate($objp->dm),'day').' ';
print ' ';
- $var=!$var;
+
$i++;
}
}
else
{
- print ''.$langs->trans("None").' ';
+ print ''.$langs->trans("None").' ';
}
print '
';
}
@@ -628,7 +628,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
if ($num > 0)
{
print '';
- print ''.$langs->trans("LastContracts",5).' ';
+ print ''.$langs->trans("LastContracts",5).' ';
$i = 0;
$staticcontrat=new Contrat($db);
@@ -647,7 +647,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
print $companystatic->getNomUrl(1,'customer',44);
print ''."\n";
print "".$staticcontrat->LibStatut($obj->statut,3)." \n";
- $var=!$var;
+
$i++;
}
print "
";
@@ -689,14 +689,14 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$var=true;
print '';
- print ''.$langs->trans("ProposalsOpened").' '.$num.' ';
+ print ''.$langs->trans("ProposalsOpened").' '.$num.' ';
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
- $var=!$var;
- print '';
+
+ print ' ';
// Ref
print '';
@@ -788,14 +788,14 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
$var=true;
print '';
- print ''.$langs->trans("OrdersOpened").' '.$num.' ';
+ print ''.$langs->trans("OrdersOpened").' '.$num.' ';
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
- $var=!$var;
- print '';
+
+ print ' ';
// Ref
print '';
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index ea4b21d78be..13ea930dc5e 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -259,8 +259,8 @@ if (empty($reshook))
}
// Fabrication du mail
- $trackid=''; // TODO Define a trackid for mass emailing too. We can use source type for this.
- $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid);
+ $trackid='emailing-'.$obj2->source_type.$obj2->source_id;
+ $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing');
if ($mail->error)
{
@@ -433,7 +433,8 @@ if (empty($reshook))
}
}
- $mailfile = new CMailFile($tmpsujet,$object->sendto,$object->email_from,$tmpbody, $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$object->email_errorsto,$arr_css);
+ $trackid='emailingtest';
+ $mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing');
$result=$mailfile->sendfile();
if ($result)
@@ -846,11 +847,6 @@ else
print '';
-/* print ''.$langs->trans("Ref").' ';
- print '';
- print $form->showrefnav($object,'id', $linkback);
- print ' ';
-*/
// Description
print ''.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').' ';
print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
@@ -865,13 +861,6 @@ else
print ' '.$form->editfieldkey("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string').' ';
print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
print ' ';
-
- // Status
- /*
- print ''.$langs->trans("Status").' '.$object->getLibStatut(4);
- if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')';
- print' ';
- */
// Nb of distinct emails
print '';
@@ -1062,7 +1051,7 @@ else
$htmltext.='';
// Print mail content
- print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
+ print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
dol_fiche_head('');
@@ -1085,7 +1074,7 @@ else
}
else
{
- print $langs->trans("NoAttachedFiles").' ';
+ print ''.$langs->trans("NoAttachedFiles").' ';
}
print ' ';
@@ -1191,7 +1180,7 @@ else
$htmltext.='';
// Print mail content
- print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
+ print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
dol_fiche_head();
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 470ee2a4ec1..16f3f4db561 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -229,7 +229,7 @@ if ($object->fetch($id) >= 0)
print "";
- $var=!$var;
+
$allowaddtarget=($object->statut == 0);
@@ -311,7 +311,7 @@ if ($object->fetch($id) >= 0)
if ($qualified)
{
$var = !$var;
- //print '';
+ //print ' ';
// print '';
if ($allowaddtarget)
@@ -523,9 +523,9 @@ if ($object->fetch($id) >= 0)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print "
";
+ print ' ';
print ''.$obj->email.' ';
print ''.$obj->lastname.' ';
print ''.$obj->firstname.' ';
diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index 0ea109960e7..52eacf6c115 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -57,10 +57,10 @@ print '';
print '
';
print '
\n";
@@ -110,7 +110,7 @@ if (is_resource($handle))
foreach ($mailmodule->getSqlArrayForStats() as $sql)
{
- print '
';
+ print ' ';
$result=$db->query($sql);
if ($result)
@@ -176,9 +176,9 @@ if ($result)
while ($i < $num )
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
- print " ";
+ print ' ';
print ''.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.' ';
print ''.dol_trunc($obj->titre,38).' ';
print ''.dol_print_date($db->jdate($obj->date_creat),'day').' ';
diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php
index 2d6fae37b98..99af5749963 100644
--- a/htdocs/comm/mailing/list.php
+++ b/htdocs/comm/mailing/list.php
@@ -122,18 +122,7 @@ if ($result)
print '';
print '
'."\n";
- print '';
- print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"m.titre",$param,"","",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"m.date_creat",$param,"",'align="center"',$sortfield,$sortorder);
- if (! $filteremail) print_liste_field_titre($langs->trans("NbOfEMails"),$_SERVER["PHP_SELF"],"m.nbemail",$param,"",'align="center"',$sortfield,$sortorder);
- if (! $filteremail) print_liste_field_titre($langs->trans("DateLastSend"),$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder);
- else print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder);
- print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print " \n";
-
- print '';
+ print ' ';
print '';
print ' ';
print ' ';
@@ -151,17 +140,27 @@ if ($result)
print '';
print " \n";
- $var=True;
-
+ print '';
+ print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"m.titre",$param,"","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"m.date_creat",$param,"",'align="center"',$sortfield,$sortorder);
+ if (! $filteremail) print_liste_field_titre($langs->trans("NbOfEMails"),$_SERVER["PHP_SELF"],"m.nbemail",$param,"",'align="center"',$sortfield,$sortorder);
+ if (! $filteremail) print_liste_field_titre($langs->trans("DateLastSend"),$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder);
+ else print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
+ print " \n";
+
+
$email=new Mailing($db);
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
- print "";
+ print " ";
print '';
print img_object($langs->trans("ShowEMail"),"email").' '.stripslashes($obj->rowid).' ';
print ''.$obj->titre.' ';
diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php
deleted file mode 100644
index cdeacefafe1..00000000000
--- a/htdocs/comm/propal/apercu.php
+++ /dev/null
@@ -1,224 +0,0 @@
-
- * Copyright (C) 2004 Eric Seigne
- * Copyright (C) 2004-2007 Laurent Destailleur
- * Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2011 Juanjo Menent
- * Copyright (C) 2014 Frederic France
- *
- * 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/comm/propal/apercu.php
- * \ingroup propal
- * \brief Preview tab of propal
- */
-
-require '../../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-
-$langs->load('propal');
-$langs->load("bills");
-$langs->load('compta');
-
-// Security check
-$socid=0;
-$id = GETPOST('id','int');
-$ref = GETPOST("ref");
-if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'propal', $id);
-
-
-/*
- * View Mode
- */
-
-$form = new Form($db);
-
-llxHeader();
-
-if ($id > 0 || ! empty($ref))
-{
- $object = new Propal($db);
-
- if ($object->fetch($id,$ref) > 0)
- {
- $soc = new Societe($db);
- $soc->fetch($object->socid);
-
- $head = propal_prepare_head($object);
- dol_fiche_head($head, 'preview', $langs->trans('Proposal'), 0, 'propal');
-
-
- /*
- * Propal
- */
- print '';
-
- $linkback = '' . $langs->trans("BackToList") . ' ';
-
- // Ref
- print '' . $langs->trans('Ref') . ' ';
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
- print ' ';
-
- // Ref client
- print ''.$langs->trans('RefCustomer').' ';
- print ''.$object->ref_client.' ';
- print ' ';
-
-
- // Thirdparty
- print ''.$langs->trans('Company').' ';
- print ''.$soc->getNomUrl(1).' ';
- print ' ';
-
- // Status
- print ''.$langs->trans("Status").' ';
- print ''.$object->getLibStatut(4).' ';
- print ' ';
-
- // Discount
- print ''.$langs->trans('Discounts').' ';
- if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
- else print $langs->trans("CompanyHasNoRelativeDiscount");
- $absolute_discount=$soc->getAvailableDiscounts();
- print '. ';
- if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
- else print $langs->trans("CompanyHasNoAbsoluteDiscount");
- print '. ';
- print ' ';
-
- // Date
- print ''.$langs->trans('Date').' ';
- print ''.dol_print_date($object->date,'daytext').' ';
-
- // Right part with $rowspan lines
- $rowspan=4;
- print '';
-
- /*
- * Documents
- */
- $objectref = dol_sanitizeFileName($object->ref);
- $dir_output = $conf->propal->dir_output . "/";
- $filepath = $dir_output . $objectref . "/";
- $file = $filepath . $objectref . ".pdf";
- $filedetail = $filepath . $objectref . "-detail.pdf";
- $relativepath = $objectref.'/'.$objectref.'.pdf';
- $relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf';
-
- // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
- $fileimage = $file.'_preview.png'; // If PDF has 1 page
- $fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page
- $relativepathimage = $relativepath.'_preview.png';
-
- $var=true;
-
- // Si fichier PDF existe
- if (file_exists($file))
- {
- $encfile = urlencode($file);
- print '';
- print ''.$langs->trans("Documents").' ';
-
- print ''.$langs->trans("Proposal").' PDF ';
-
- print ''.$object->ref.'.pdf ';
-
- print ''.dol_print_size(dol_filesize($file)).' ';
- print ''.dol_print_date(dol_filemtime($file),'dayhour').' ';
- print ' ';
-
- print "
\n";
-
- // Conversion du PDF en image png si fichier png non existant
- if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
- {
- if (class_exists("Imagick"))
- {
- $ret = dol_convert_file($file,'png',$fileimage);
- if ($ret < 0) $error++;
- }
- else
- {
- $langs->load("errors");
- print ''.$langs->trans("ErrorNoImagickReadimage").' ';
- }
- }
- }
-
- print ' ';
- print ' ';
-
- // Total HT - left part
- print ''.$langs->trans('AmountHT').' ';
- print '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
- print ' ';
-
- // Total VAT - left part
- print ''.$langs->trans('AmountVAT').' ';
- print '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
- print ' ';
-
- // Total TTC - left part
- print ''.$langs->trans('AmountTTC').' ';
- print '' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
- print ' ';
-
- print '
';
-
- dol_fiche_end();
- }
- else
- {
- // Propal non trouvee
- print $langs->trans("ErrorPropalNotFound",$_GET["id"]);
- }
-}
-
-print '';
-print '';
-print '';
-// Si fichier png PDF d'1 page trouve
-if (file_exists($fileimage))
-{
- print '
';
-}
-// Si fichier png PDF de plus d'1 page trouve
-elseif (file_exists($fileimagebis))
-{
- $multiple = preg_replace('/\.png/','',$relativepath) . "-";
-
- for ($i = 0; $i < 20; $i++)
- {
- $preview = $multiple.$i.'.png';
-
- if (file_exists($dir_output.$preview))
- {
- print '
';
- }
- }
-}
-print '
';
-print ' ';
-print '
';
-
-
-llxFooter();
-
-$db->close();
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index b1a37c67b31..444669a6f49 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1321,8 +1321,18 @@ if ($action == 'create')
// Replicate extrafields
$objectsrc->fetch_optionals($originid);
$object->array_options = $objectsrc->array_options;
+
+ if (!empty($conf->multicurrency->enabled))
+ {
+ if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code;
+ if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx;
+ }
}
}
+ else
+ {
+ if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
+ }
$object = new Propal($db);
@@ -1500,14 +1510,13 @@ if ($action == 'create')
print '';
print ''.fieldLabel('Currency','multicurrency_code').' ';
print '';
- $currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency));
print $form->selectMultiCurrency($currency_code, 'multicurrency_code', 0);
print ' ';
}
// Public note
print '';
- print '' . $langs->trans('NotePublic') . ' ';
+ print '' . $langs->trans('NotePublic') . ' ';
print '';
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null));
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
@@ -1517,7 +1526,7 @@ if ($action == 'create')
if (empty($user->societe_id))
{
print ' ';
- print '' . $langs->trans('NotePrivate') . ' ';
+ print '' . $langs->trans('NotePrivate') . ' ';
print '';
$note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null));
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
@@ -1666,7 +1675,7 @@ if ($action == 'create')
$soc->fetch($object->socid);
$head = propal_prepare_head($object);
- dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal');
+ dol_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal');
$formconfirm = '';
@@ -1795,42 +1804,7 @@ if ($action == 'create')
print '';
- // Ref
- /*
- print '' . $langs->trans('Ref') . ' ';
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
- print ' ';
- */
-
- // Ref customer
- /*
- print '';
- print '';
- print ' ';
- if ($user->rights->propal->creer && $action == 'refclient') {
- print 'id . '" method="post">';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
- } else {
- print $object->ref_client;
- }
- print ' ';
- print ' ';
- */
-
- // Company
- /*
- print '' . $langs->trans('Company') . ' ' . $soc->getNomUrl(1) . ' ';
- print ' ';*/
-
- // Lin for thirdparty discounts
+ // Link for thirdparty discounts
print '' . $langs->trans('Discounts') . ' ';
if ($soc->remise_percent)
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
@@ -2038,7 +2012,7 @@ if ($action == 'create')
print '';
print ' ';
@@ -2049,7 +2023,7 @@ if ($action == 'create')
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
- if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
+ if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
print '';
@@ -2383,7 +2357,7 @@ if ($action == 'create')
{
if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
{
- print '';
+ print '';
}
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
@@ -2414,7 +2388,6 @@ if ($action == 'create')
print '';
}
- print " \n";
//Select mail models is same action as presend
if (GETPOST('modelselected')) $action = 'presend';
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 765179c3d63..3489860e1dd 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -3027,7 +3027,7 @@ class Propal extends CommonObject
$response->label = $label;
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
- $response->img = img_object($langs->trans("Propals"),"propal");
+ $response->img = img_object('',"propal");
// This assignment in condition is not a bug. It allows walking the results.
while ($obj=$this->db->fetch_object($resql))
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index 8588bfc5749..3c3aa6aef88 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -151,7 +151,7 @@ $formother = new FormOther($db);
if ($object->id > 0)
{
$head = propal_prepare_head($object);
- dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal');
+ dol_fiche_head($head, 'contact', $langs->trans("Proposal"), -1, 'propal');
// Proposal card
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 9b875e434f7..82244886763 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -89,10 +89,10 @@ if ($object->id > 0)
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
$head = propal_prepare_head($object);
- dol_fiche_head($head, 'document', $langs->trans('Proposal'), 0, 'propal');
+ dol_fiche_head($head, 'document', $langs->trans('Proposal'), -1, 'propal');
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index 82d57f721da..145d1891be3 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -66,7 +66,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
print ' ';
print ' \n";
}
@@ -122,8 +122,8 @@ if ($resql)
$dataseries[]=array('label'=>$propalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0));
if (! $conf->use_javascript_ajax)
{
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.$propalstatic->LibStatut($status,0).' ';
print ''.(isset($vals[$status])?$vals[$status]:0).' ';
print " \n";
@@ -176,9 +176,9 @@ if (! empty($conf->propal->enabled))
$var = True;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print "";
+ print ' ';
$propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref;
@@ -236,10 +236,10 @@ if ($resql)
$var = True;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print " ";
+ print ' ';
print '';
$propalstatic->id=$obj->rowid;
@@ -317,8 +317,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref
print '';
@@ -405,9 +405,9 @@ if (! empty($conf->propal->enabled))
$var = True;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print " ";
+ print ' ';
print '';
$propalstatic->id=$obj->rowid;
@@ -477,9 +477,9 @@ if (! empty($conf->propal->enabled))
$var = True;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print " ";
+ print ' ';
print '';
$propalstatic->id=$obj->rowid;
diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php
index 14a4911b80f..d8af8fb87a8 100644
--- a/htdocs/comm/propal/info.php
+++ b/htdocs/comm/propal/info.php
@@ -59,7 +59,7 @@ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_c
$object->fetch_thirdparty();
$head = propal_prepare_head($object);
-dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal');
+dol_fiche_head($head, 'info', $langs->trans('Proposal'), -1, 'propal');
$object->info($object->id);
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index aa6df1afb2b..ce6d6e2bc72 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -556,49 +556,12 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
-
+ if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
+
print '';
print '
'."\n";
-
- // Fields title
- print '';
- if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'],$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['p.date']['checked'])) print_liste_field_titre($arrayfields['p.date']['label'],$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'],$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'],$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'],$_SERVER["PHP_SELF"],'p.tva','',$param, 'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'],$_SERVER["PHP_SELF"],'p.total','',$param, 'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'],$_SERVER["PHP_SELF"],'u.login','',$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['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print ' '."\n";
-
- print '';
+
+ print ' ';
if (! empty($arrayfields['p.ref']['checked']))
{
print '';
@@ -733,25 +696,63 @@ if ($resql)
}
// Action column
print ' ';
- $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
+ $searchpitco=$form->showFilterButtons();
print $searchpitco;
print ' ';
print " \n";
+
+ // Fields title
+ print '';
+ if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'],$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['p.date']['checked'])) print_liste_field_titre($arrayfields['p.date']['label'],$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'],$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'],$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'],$_SERVER["PHP_SELF"],'p.tva','',$param, 'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'],$_SERVER["PHP_SELF"],'p.total','',$param, 'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'],$_SERVER["PHP_SELF"],'u.login','',$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($langs->trans($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['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+ if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+ if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
+ print ' '."\n";
+
$now = dol_now();
$i=0;
- $var=true;
$totalarray=array();
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
$objectstatic->id=$obj->rowid;
$objectstatic->ref=$obj->ref;
- print '';
+ print ' ';
if (! empty($arrayfields['p.ref']['checked']))
{
@@ -779,7 +780,7 @@ if ($resql)
print '';
}
// Other picto tool
- print '';
+ print ' ';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
@@ -807,7 +808,7 @@ if ($resql)
// Thirdparty
if (! empty($arrayfields['s.nom']['checked']))
{
- print ' ';
+ print ' ';
print $companystatic->getNomUrl(1,'customer');
print ' ';
if (! $i) $totalarray['nbfield']++;
@@ -977,7 +978,12 @@ if ($resql)
}
// Show total line
- if (isset($totalarray['totalhtfield']))
+ if (isset($totalarray['totalhtfield'])
+ || isset($totalarray['totalvatfield'])
+ || isset($totalarray['totalttcfield'])
+ || isset($totalarray['totalamfield'])
+ || isset($totalarray['totalrtpfield'])
+ )
{
print ' ';
$i=0;
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index 57181b83f6b..ec1dac31c24 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -74,7 +74,7 @@ if ($id > 0 || ! empty($ref))
if ($object->fetch_thirdparty() > 0)
{
$head = propal_prepare_head($object);
- dol_fiche_head($head, 'note', $langs->trans('Proposal'), 0, 'propal');
+ dol_fiche_head($head, 'note', $langs->trans('Proposal'), -1, 'propal');
$cssclass='titlefield';
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php
index 04c1af11e1d..abb24b8ffa4 100644
--- a/htdocs/comm/propal/stats/index.php
+++ b/htdocs/comm/propal/stats/index.php
@@ -242,7 +242,7 @@ $h++;
complete_head_from_modules($conf,$langs,null,$head,$h,'propal_stats');
-dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
+dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
print '';
@@ -300,7 +300,7 @@ foreach ($data as $val)
while (! empty($year) && $oldyear > $year+1)
{ // If we have empty year
$oldyear--;
- $var=!$var;
+
print '
';
print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.' ';
print '0 ';
diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
index dd325da7297..f797025a5de 100644
--- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
@@ -40,7 +40,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
- $var=!$var;
+
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php
index b68bdb9135e..2364672ccf9 100644
--- a/htdocs/comm/prospect/index.php
+++ b/htdocs/comm/prospect/index.php
@@ -58,9 +58,9 @@ if (! empty($conf->propal->enabled))
print ' ';
print ' \n";
}
@@ -96,8 +96,8 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
print '';
print img_action($langs->trans("Show"),$obj->id).' ';
print $langs->trans("StatusProspect".$obj->id);
@@ -140,8 +140,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print '';
+
+ print ' ';
print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.' ';
print ' ';
print price($obj->price);
@@ -150,7 +150,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$total += $obj->price;
}
if ($total>0) {
- $var=!$var;
+
print ' '.$langs->trans("Total")." ".price($total)." ";
}
print "
";
@@ -205,8 +205,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print '
';
+
+ print ' ';
print '';
print img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.' ';
@@ -263,8 +263,8 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print '';
+
+ print ' ';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php
index 82269434638..2be1981c5ae 100644
--- a/htdocs/comm/remise.php
+++ b/htdocs/comm/remise.php
@@ -107,7 +107,7 @@ if ($socid > 0)
print ' ';
print ' ';
- dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company');
+ dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
@@ -119,20 +119,21 @@ if ($socid > 0)
// Discount
print ' ';
print $langs->trans("CustomerRelativeDiscount").' '.price2num($object->remise_percent)."% ";
-
print '
';
print ' ';
print load_fiche_titre($langs->trans("NewRelativeDiscount"),'','');
+ print '
';
+
print '";
@@ -177,21 +178,26 @@ if ($socid > 0)
print ' '.$langs->trans("NoteReason").' ';
print ''.$langs->trans("User").' ';
print ' ';
- $i = 0 ;
$num = $db->num_rows($resql);
-
- while ($i < $num )
- {
- $obj = $db->fetch_object($resql);
- $tag = !$tag;
- print '';
- print ''.dol_print_date($db->jdate($obj->dc),"dayhour").' ';
- print ''.price2num($obj->remise_percent).'% ';
- print ''.$obj->note.' ';
- print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
- print ' ';
- $i++;
+ if ($num > 0)
+ {
+ $i = 0;
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+ print '';
+ print ''.dol_print_date($db->jdate($obj->dc),"dayhour").' ';
+ print ''.price2num($obj->remise_percent).'% ';
+ print ''.$obj->note.' ';
+ print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
+ print ' ';
+ $i++;
+ }
}
+ else
+ {
+ print ''.$langs->trans("None").' ';
+ }
$db->free($resql);
print "
";
}
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index 9e781139723..375b4d0ecb8 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -92,7 +92,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
$newdiscount2->fk_facture=$discount->fk_facture;
$newdiscount1->fk_facture_line=$discount->fk_facture_line;
$newdiscount2->fk_facture_line=$discount->fk_facture_line;
- if ($discount->description == '(CREDIT_NOTE)')
+ if ($discount->description == '(CREDIT_NOTE)' || $discount->description == '(DEPOSIT)')
{
$newdiscount1->description=$discount->description;
$newdiscount2->description=$discount->description;
@@ -235,7 +235,7 @@ if ($socid > 0)
print '
';
print '
';
- dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"),0,'company');
+ dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
@@ -274,6 +274,8 @@ if ($socid > 0)
}
print '
';
+ print '';
+
if ($user->rights->societe->creer)
{
print ' ';
@@ -294,7 +296,6 @@ if ($socid > 0)
print "
";
}
- print '';
dol_fiche_end();
@@ -342,8 +343,8 @@ if ($socid > 0)
print load_fiche_titre($langs->trans("DiscountStillRemaining"));
print '';
print '';
- print ''.$langs->trans("Date").' '; // Need 120+ for format with AM/PM
- print ''.$langs->trans("ReasonDiscount").' ';
+ print ''.$langs->trans("Date").' '; // Need 120+ for format with AM/PM
+ print ''.$langs->trans("ReasonDiscount").' ';
print ''.$langs->trans("ConsumedBy").' ';
print ''.$langs->trans("AmountHT").' ';
print ''.$langs->trans("VATRate").' ';
@@ -354,73 +355,79 @@ if ($socid > 0)
$showconfirminfo=array();
- $var = true;
$i = 0;
$num = $db->num_rows($resql);
- while ($i < $num)
+ if ($num > 0)
{
- $obj = $db->fetch_object($resql);
- $var = !$var;
- print " ";
- print ''.dol_print_date($db->jdate($obj->dc),'dayhour').' ';
- if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
- {
- print '';
- $facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
- $facturestatic->type=$obj->type;
- print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1);
- print ' ';
- }
- elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
- {
- print '';
- $facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
- $facturestatic->type=$obj->type;
- print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1);
- print ' ';
- }
- elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description))
- {
- print '';
- $facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
- $facturestatic->type=$obj->type;
- print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1);
- print ' ';
- }
- else
- {
- print '';
- print $obj->description;
- print ' ';
- }
- print ''.$langs->trans("NotConsumed").' ';
- print ''.price($obj->amount_ht).' ';
- print ''.price2num($obj->tva_tx,'MU').'% ';
- print ''.price($obj->amount_ttc).' ';
- print '';
- print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
- print ' ';
- if ($user->rights->societe->creer || $user->rights->facture->creer)
- {
- print '';
- print 'id.'&action=split&remid='.$obj->rowid.'">'.img_picto($langs->trans("SplitDiscount"),'split').' ';
- print ' ';
- print 'id.'&action=remove&remid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveDiscount")).' ';
- print ' ';
- }
- else print ' ';
- print ' ';
-
- if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
- {
- $showconfirminfo['rowid']=$obj->rowid;
- $showconfirminfo['amount_ttc']=$obj->amount_ttc;
- }
- $i++;
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+
+ print '';
+ print ''.dol_print_date($db->jdate($obj->dc),'dayhour').' ';
+ if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
+ {
+ print '';
+ $facturestatic->id=$obj->fk_facture_source;
+ $facturestatic->ref=$obj->ref;
+ $facturestatic->type=$obj->type;
+ print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1);
+ print ' ';
+ }
+ elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
+ {
+ print '';
+ $facturestatic->id=$obj->fk_facture_source;
+ $facturestatic->ref=$obj->ref;
+ $facturestatic->type=$obj->type;
+ print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1);
+ print ' ';
+ }
+ elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description))
+ {
+ print '';
+ $facturestatic->id=$obj->fk_facture_source;
+ $facturestatic->ref=$obj->ref;
+ $facturestatic->type=$obj->type;
+ print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1);
+ print ' ';
+ }
+ else
+ {
+ print '';
+ print $obj->description;
+ print ' ';
+ }
+ print ''.$langs->trans("NotConsumed").' ';
+ print ''.price($obj->amount_ht).' ';
+ print ''.price2num($obj->tva_tx,'MU').'% ';
+ print ''.price($obj->amount_ttc).' ';
+ print '';
+ print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
+ print ' ';
+ if ($user->rights->societe->creer || $user->rights->facture->creer)
+ {
+ print '';
+ print 'id.'&action=split&remid='.$obj->rowid.'">'.img_split($langs->trans("SplitDiscount")).' ';
+ print ' ';
+ print 'id.'&action=remove&remid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveDiscount")).' ';
+ print ' ';
+ }
+ else print ' ';
+ print ' ';
+
+ if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
+ {
+ $showconfirminfo['rowid']=$obj->rowid;
+ $showconfirminfo['amount_ttc']=$obj->amount_ttc;
+ }
+ $i++;
+ }
}
+ else
+ {
+ print ''.$langs->trans("None").' ';
+ }
$db->free($resql);
print "
";
@@ -491,8 +498,8 @@ if ($socid > 0)
print load_fiche_titre($langs->trans("DiscountAlreadyCounted"));
print '';
print '';
- print ''.$langs->trans("Date").' '; // Need 120+ for format with AM/PM
- print ''.$langs->trans("ReasonDiscount").' ';
+ print ''.$langs->trans("Date").' '; // Need 120+ for format with AM/PM
+ print ''.$langs->trans("ReasonDiscount").' ';
print ''.$langs->trans("ConsumedBy").' ';
print ''.$langs->trans("AmountHT").' ';
print ''.$langs->trans("VATRate").' ';
@@ -501,15 +508,17 @@ if ($socid > 0)
print ' ';
print ' ';
- $var = true;
$tab_sqlobj=array();
$tab_sqlobjOrder=array();
$num = $db->num_rows($resql);
- for ($i = 0;$i < $num;$i++)
+ if ($num > 0)
{
- $sqlobj = $db->fetch_object($resql);
- $tab_sqlobj[] = $sqlobj;
- $tab_sqlobjOrder[]=$db->jdate($sqlobj->dc);
+ for ($i = 0;$i < $num; $i++)
+ {
+ $sqlobj = $db->fetch_object($resql);
+ $tab_sqlobj[] = $sqlobj;
+ $tab_sqlobjOrder[]=$db->jdate($sqlobj->dc);
+ }
}
$db->free($resql);
@@ -524,57 +533,64 @@ if ($socid > 0)
array_multisort($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj);
$num = count($tab_sqlobj);
- $i = 0 ;
- while ($i < $num )
+ if ($num > 0)
{
- $obj = array_shift($tab_sqlobj);
- $var = !$var;
- print "";
- print ''.dol_print_date($db->jdate($obj->dc),'dayhour').' ';
- if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
- {
- print '';
- $facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
- $facturestatic->type=$obj->type;
- print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1);
- print ' ';
- }
- elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
- {
- print '';
- $facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
- $facturestatic->type=$obj->type;
- print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1);
- print ' ';
- }
- elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description))
- {
- print '';
- $facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
- $facturestatic->type=$obj->type;
- print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1);
- print ' ';
- }
- else
- {
- print '';
- print $obj->description;
- print ' ';
- }
- print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.' ';
- print ''.price($obj->amount_ht).' ';
- print ''.price2num($obj->tva_tx,'MU').'% ';
- print ''.price($obj->amount_ttc).' ';
- print '';
- print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
- print ' ';
- print ' ';
- print ' ';
- $i++;
+ $i = 0 ;
+ while ($i < $num )
+ {
+ $obj = array_shift($tab_sqlobj);
+ print '';
+ print ''.dol_print_date($db->jdate($obj->dc),'dayhour').' ';
+ if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
+ {
+ print '';
+ $facturestatic->id=$obj->fk_facture_source;
+ $facturestatic->ref=$obj->ref;
+ $facturestatic->type=$obj->type;
+ print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1);
+ print ' ';
+ }
+ elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
+ {
+ print '';
+ $facturestatic->id=$obj->fk_facture_source;
+ $facturestatic->ref=$obj->ref;
+ $facturestatic->type=$obj->type;
+ print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1);
+ print ' ';
+ }
+ elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description))
+ {
+ print '';
+ $facturestatic->id=$obj->fk_facture_source;
+ $facturestatic->ref=$obj->ref;
+ $facturestatic->type=$obj->type;
+ print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1);
+ print ' ';
+ }
+ else
+ {
+ print '';
+ print $obj->description;
+ print ' ';
+ }
+ print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.' ';
+ print ''.price($obj->amount_ht).' ';
+ print ''.price2num($obj->tva_tx,'MU').'% ';
+ print ''.price($obj->amount_ttc).' ';
+ print '';
+ print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ $i++;
+ }
}
+ else
+ {
+ print ''.$langs->trans("None").' ';
+ }
+
print "
";
}
else
diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php
deleted file mode 100644
index 1ec3a0533cc..00000000000
--- a/htdocs/commande/apercu.php
+++ /dev/null
@@ -1,223 +0,0 @@
-
- * Copyright (C) 2004 Eric Seigne
- * Copyright (C) 2004-2011 Laurent Destailleur
- * Copyright (C) 2005-2011 Regis Houssin
- * Copyright (C) 2011 Juanjo Menent
- * Copyright (C) 2014 Frederic France
- *
- * 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/commande/apercu.php
- * \ingroup commande
- * \brief Preview tab of order
- */
-
-require '../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
-
-$langs->load('orders');
-$langs->load("bills");
-$langs->load('compta');
-
-// Security check
-$socid=0;
-$id = GETPOST('id','int');
-$ref = GETPOST("ref");
-if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'commande',$id,'');
-
-
-/*
- * View Mode
- */
-
-$form = new Form($db);
-
-llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
-
-if ($id > 0 || ! empty($ref))
-{
- $object = new Commande($db);
-
- if ($object->fetch($id,$ref) > 0)
- {
- $soc = new Societe($db);
- $soc->fetch($object->socid);
-
-
- $head = commande_prepare_head($object);
- dol_fiche_head($head, 'preview', $langs->trans("CustomerOrder"), 0, 'order');
-
- print '';
-
- //$linkback = '' . $langs->trans("BackToList") . ' ';
-
- // Ref
- print '' . $langs->trans('Ref') . ' ';
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
- print ' ';
-
- // Ref cde client
- print ''.$langs->trans('RefCustomer').' ';
- print ''.$object->ref_client.' ';
- print ' ';
-
- // Client
- print ''.$langs->trans("Customer").' ';
- print ''.$soc->getNomUrl(1).' ';
- print ' ';
-
- // Statut
- print ''.$langs->trans("Status").' ';
- print ''.$object->getLibStatut(4).' ';
- print ' ';
-
- // Discount - left part
- print ''.$langs->trans('Discounts').' ';
- print ''.$object->remise_percent.'% ';
- print ' ';
-
- // Date - left part
- print ''.$langs->trans("Date").' ';
- print ''.dol_print_date($object->date,"daytext").' ';
-
- // Right part with $rowspan lines
- $rowspan=4;
- print '';
-
- /*
- * Documents
- */
- $objectref = dol_sanitizeFileName($object->ref);
- $dir_output = $conf->commande->dir_output . "/";
- $filepath = $dir_output . $objectref . "/";
- $file = $filepath . $objectref . ".pdf";
- $filedetail = $filepath . $objectref . "-detail.pdf";
- $relativepath = $objectref.'/'.$objectref.'.pdf';
- $relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf';
-
- // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
- $fileimage = $file.'_preview.png'; // If PDF has 1 page
- $fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page
- $relativepathimage = $relativepath.'_preview.png';
-
- $var=true;
-
- // if PDF file exist
- if (file_exists($file))
- {
- $encfile = urlencode($file);
- print '';
- print ''.$langs->trans("Documents").' ';
-
- print "".$langs->trans("Order")." PDF ";
-
- print ''.$object->ref.'.pdf ';
- print ''.dol_print_size(dol_filesize($file)).' ';
- print ''.dol_print_date(dol_filemtime($file),'dayhour').' ';
- print ' ';
-
- // Si fichier detail PDF existe
- // TODO deprecated ?
- if (file_exists($filedetail))
- {
- print "Commande detaillee ";
-
- print ''.$object->ref.'-detail.pdf ';
- print ''.dol_print_size(dol_filesize($filedetail)).' ';
- print ''.dol_print_date(dol_filemtime($filedetail),'dayhour').' ';
- print ' ';
- }
- print "
\n";
-
- // Conversion du PDF en image png si fichier png non existant
- if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
- {
- if (class_exists("Imagick"))
- {
- $ret = dol_convert_file($file,'png',$fileimage);
- if ($ret < 0) $error++;
- }
- else
- {
- $langs->load("errors");
- print ''.$langs->trans("ErrorNoImagickReadimage").' ';
- }
- }
- }
-
- print ' ';
-
- // Total HT - left part
- print ''.$langs->trans('AmountHT').' ';
- print '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
- print ' ';
-
- // Total VAT - left part
- print ''.$langs->trans('AmountVAT').' ';
- print '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
- print ' ';
-
- // Total TTC - left part
- print ''.$langs->trans('AmountTTC').' ';
- print '' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
- print ' ';
-
- print '
';
-
- dol_fiche_end();
- }
- else
- {
- // Object not found
- print $langs->trans("ErrorOrderNotFound",$id);
- }
-}
-
-print '';
-print '';
-print '';
-// Si fichier png PDF d'1 page trouve
-if (file_exists($fileimage))
-{
- print '
';
-}
-// Si fichier png PDF de plus d'1 page trouve
-elseif (file_exists($fileimagebis))
-{
- $multiple = preg_replace('/\.png/','',$relativepath) . "-";
-
- for ($i = 0; $i < 20; $i++)
- {
- $preview = $multiple.$i.'.png';
-
- if (file_exists($dir_output.$preview))
- {
- print '
';
- }
- }
-}
-print '
';
-print ' ';
-print '
';
-
-
-llxFooter();
-
-$db->close();
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index e5c78c75f04..e369a1a7217 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -64,6 +64,7 @@ $langs->load('propal');
$langs->load('deliveries');
$langs->load('sendings');
$langs->load('products');
+$langs->load('other');
if (!empty($conf->incoterm->enabled)) $langs->load('incoterm');
if (! empty($conf->margin->enabled)) $langs->load('margins');
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
@@ -1254,10 +1255,6 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
- /*
- * Send mail
- */
-
// Actions to send emails
$actiontypecode='AC_COM';
$trigger_name='ORDER_SENTBYMAIL';
@@ -1768,7 +1765,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$res = $object->fetch_optionals($object->id, $extralabels);
$head = commande_prepare_head($object);
- dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order');
+ dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order');
$formconfirm = '';
@@ -2008,7 +2005,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$addrelativediscount = 'id . '">' . $langs->trans("EditRelativeDiscounts") . ' ';
$addabsolutediscount = 'id . '">' . $langs->trans("EditGlobalDiscounts") . ' ';
- $addcreditnote = 'id . '">' . $langs->trans("AddCreditNote") . ' ';
+ $addcreditnote = 'id . '">' . $langs->trans("AddCreditNote") . ' ';
print '' . $langs->trans('Discounts') . ' ';
if ($soc->remise_percent)
@@ -2054,7 +2051,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print ' ';
print '';
} else {
- print $object->date ? dol_print_date($object->date, 'daytext') : ' ';
+ print $object->date ? dol_print_date($object->date, 'day') : ' ';
if ($object->hasDelay() && empty($object->date_livraison)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
@@ -2187,7 +2184,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '';
print ' ';
@@ -2198,7 +2195,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
- if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
+ if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
print '';
@@ -2540,7 +2537,7 @@ if ($action == 'create' && $user->rights->commande->creer)
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
if ($object->statut > Commande::STATUS_DRAFT && ! $object->billed) {
if (! empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
- print '';
+ print '';
}
if ($user->rights->commande->creer && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {
print '';
@@ -2588,7 +2585,6 @@ if ($action == 'create' && $user->rights->commande->creer)
print ' '; // ancre
// Documents
$comref = dol_sanitizeFileName($object->ref);
- $file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->commande->dir_output . '/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
@@ -2650,6 +2646,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$file = $fileparams['fullname'];
}
+ print '
';
print '
';
print ' ';
print load_fiche_titre($langs->trans('SendOrderByMail'));
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 7bad08b2f84..e87923beb8c 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3102,6 +3102,8 @@ class Commande extends CommonOrder
$error = 0;
+ dol_syslog(get_class($this) . "::delete ".$this->id, LOG_DEBUG);
+
$this->db->begin();
if (! $error && ! $notrigger)
@@ -3117,7 +3119,6 @@ class Commande extends CommonOrder
{
// Delete order details
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE fk_commande = ".$this->id;
- dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if (! $this->db->query($sql) )
{
$error++;
@@ -3126,7 +3127,6 @@ class Commande extends CommonOrder
// Delete order
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande WHERE rowid = ".$this->id;
- dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if (! $this->db->query($sql) )
{
$error++;
@@ -3184,7 +3184,6 @@ class Commande extends CommonOrder
if (! $error)
{
- dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG);
$this->db->commit();
return 1;
}
@@ -3192,7 +3191,6 @@ class Commande extends CommonOrder
{
foreach($this->errors as $errmsg)
{
- dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
@@ -3233,7 +3231,7 @@ class Commande extends CommonOrder
$response->warning_delay=$conf->commande->client->warning_delay/60/60/24;
$response->label=$langs->trans("OrdersToProcess");
$response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3&mainmenu=commercial&leftmenu=orders';
- $response->img=img_object($langs->trans("Orders"),"order");
+ $response->img=img_object('',"order");
$generic_commande = new Commande($this->db);
diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index f693d09da52..bc257f3ac05 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -143,7 +143,7 @@ if ($id > 0 || ! empty($ref))
$object->fetch_thirdparty();
$head = commande_prepare_head($object);
- dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), 0, 'order');
+ dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order');
// Order card
diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php
index 5f9a5a570ff..b5672f276e7 100644
--- a/htdocs/commande/customer.php
+++ b/htdocs/commande/customer.php
@@ -155,9 +155,9 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print " ";
+ print ' ';
print '';
$result='';
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index 5ce456fe8e0..ef4f220f3e4 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -92,10 +92,10 @@ if ($id > 0 || ! empty($ref))
$upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($object->ref);
$head = commande_prepare_head($object);
- dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), 0, 'order');
+ dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), -1, 'order');
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php
index 24e07b5ab07..9f7f36f78ca 100644
--- a/htdocs/commande/index.php
+++ b/htdocs/commande/index.php
@@ -70,7 +70,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
print ' ';
print ' \n";
}
@@ -119,7 +119,7 @@ if ($resql)
}
$db->free($resql);
print '';
- print ''.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").' '."\n";
+ print ''.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").' '."\n";
$listofstatus=array(0,1,2,3,3,-1);
$bool=false;
foreach ($listofstatus as $status)
@@ -141,8 +141,8 @@ if ($resql)
{
if (! $conf->use_javascript_ajax)
{
- $var=!$var;
- print "";
+
+ print ' ';
print ''.$commandestatic->LibStatut($status,$bool,0).' ';
print ''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
print $commandestatic->LibStatut($status,$bool,3);
@@ -187,7 +187,7 @@ if (! empty($conf->commande->enabled))
{
print ' ';
print '';
- print ''.$langs->trans("DraftOrders").' ';
+ print ''.$langs->trans("DraftOrders").' ';
$langs->load("orders");
$num = $db->num_rows($resql);
if ($num)
@@ -196,7 +196,7 @@ if (! empty($conf->commande->enabled))
$var = true;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
$commandestatic->id=$obj->rowid;
@@ -208,7 +208,7 @@ if (! empty($conf->commande->enabled))
$companystatic->code_client=$obj->code_client;
$companystatic->canvas=$obj->canvas;
- print "";
+ print ' ';
print '';
print $commandestatic->getNomUrl(1);
print " ";
@@ -220,8 +220,8 @@ if (! empty($conf->commande->enabled))
}
else
{
- $var=!$var;
- print ' '.$langs->trans("NoOrder").' ';
+
+ print ''.$langs->trans("NoOrder").' ';
}
print "
";
}
@@ -259,7 +259,7 @@ if ($resql)
{
print '';
print '';
- print ''.$langs->trans("LastModifiedOrders",$max).' ';
+ print ''.$langs->trans("LastModifiedOrders",$max).' ';
$num = $db->num_rows($resql);
if ($num)
@@ -268,10 +268,10 @@ if ($resql)
$var = true;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print "";
+ print ' ';
print '';
$commandestatic->id=$obj->rowid;
@@ -341,7 +341,7 @@ if (! empty($conf->commande->enabled))
print '';
print '';
- print ''.$langs->trans("OrdersToProcess").' '.$num.' ';
+ print ''.$langs->trans("OrdersToProcess").' '.$num.' ';
if ($num)
{
@@ -349,9 +349,9 @@ if (! empty($conf->commande->enabled))
$var = true;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print "";
+ print ' ';
print '';
$commandestatic->id=$obj->rowid;
@@ -423,7 +423,7 @@ if (! empty($conf->commande->enabled))
print '';
print '';
- print ''.$langs->trans("OnProcessOrders").' '.$num.' ';
+ print ''.$langs->trans("OnProcessOrders").' '.$num.' ';
if ($num)
{
@@ -431,9 +431,9 @@ if (! empty($conf->commande->enabled))
$var = true;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print "";
+ print ' ';
print '';
$commandestatic->id=$obj->rowid;
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index 58b445c8ce7..02b631c4c8a 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -53,13 +53,15 @@ if (! $object->fetch($id, $ref) > 0)
* View
*/
+$form = new Form($db);
+
llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
$object->fetch_thirdparty();
$object->info($object->id);
$head = commande_prepare_head($object);
-dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), 0, 'order');
+dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), -1, 'order');
// Order card
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index f92836599de..4185518b721 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -199,227 +199,226 @@ if (empty($reshook))
$permtodelete = $user->rights->commande->supprimer;
$uploaddir = $conf->commande->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
-}
-
-if ($massaction == 'confirm_createbills') {
-
- $orders = GETPOST('toselect');
- $createbills_onebythird = GETPOST('createbills_onebythird', 'int');
- $validate_invoices = GETPOST('valdate_invoices', 'int');
-
- $TFact = array();
- $TFactThird = array();
-
- $nb_bills_created = 0;
-
- $db->begin();
-
- foreach($orders as $id_order) {
-
- $cmd = new Commande($db);
- if($cmd->fetch($id_order) <= 0) continue;
-
- $object = new Facture($db);
- if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
- else {
-
- $object->socid = $cmd->socid;
- $object->type = Facture::TYPE_STANDARD;
- $object->cond_reglement_id = $cmd->cond_reglement_id;
- $object->mode_reglement_id = $cmd->mode_reglement_id;
- $object->fk_project = $cmd->fk_project;
-
- $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
- if (empty($datefacture))
- {
- $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
- }
-
- $object->date = $datefacture;
- $object->origin = 'commande';
- $object->origin_id = $id_order;
-
- $res = $object->create($user);
-
- if($res > 0) $nb_bills_created++;
-
- }
-
- if($object->id > 0) {
-
- $db->begin();
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
- $sql.= "fk_source";
- $sql.= ", sourcetype";
- $sql.= ", fk_target";
- $sql.= ", targettype";
- $sql.= ") VALUES (";
- $sql.= $id_order;
- $sql.= ", '".$object->origin."'";
- $sql.= ", ".$object->id;
- $sql.= ", '".$object->element."'";
- $sql.= ")";
-
- if ($db->query($sql))
- {
- $db->commit();
- }
- else
- {
- $db->rollback();
- }
-
- $lines = $cmd->lines;
- if (empty($lines) && method_exists($cmd, 'fetch_lines'))
- {
- $cmd->fetch_lines();
- $lines = $cmd->lines;
- }
-
- $fk_parent_line=0;
- $num=count($lines);
-
- for ($i=0;$i<$num;$i++)
- {
- $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
- if ($lines[$i]->subprice < 0)
- {
- // Negative line, we create a discount line
- $discount = new DiscountAbsolute($db);
- $discount->fk_soc=$object->socid;
- $discount->amount_ht=abs($lines[$i]->total_ht);
- $discount->amount_tva=abs($lines[$i]->total_tva);
- $discount->amount_ttc=abs($lines[$i]->total_ttc);
- $discount->tva_tx=$lines[$i]->tva_tx;
- $discount->fk_user=$user->id;
- $discount->description=$desc;
- $discountid=$discount->create($user);
- if ($discountid > 0)
- {
- $result=$object->insert_discount($discountid);
- //$result=$discount->link_to_invoice($lineid,$id);
- }
- else
- {
- setEventMessages($discount->error, $discount->errors, 'errors');
- $error++;
- break;
- }
- }
- else
- {
- // Positive line
- $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
- // Date start
- $date_start=false;
- if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue;
- if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
- if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
- //Date end
- $date_end=false;
- if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue;
- if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
- if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
- // Reset fk_parent_line for no child products and special product
- if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9)
- {
- $fk_parent_line = 0;
- }
- $result = $object->addline(
- $desc,
- $lines[$i]->subprice,
- $lines[$i]->qty,
- $lines[$i]->tva_tx,
- $lines[$i]->localtax1_tx,
- $lines[$i]->localtax2_tx,
- $lines[$i]->fk_product,
- $lines[$i]->remise_percent,
- $date_start,
- $date_end,
- 0,
- $lines[$i]->info_bits,
- $lines[$i]->fk_remise_except,
- 'HT',
- 0,
- $product_type,
- $ii,
- $lines[$i]->special_code,
- $object->origin,
- $lines[$i]->rowid,
- $fk_parent_line,
- $lines[$i]->fk_fournprice,
- $lines[$i]->pa_ht,
- $lines[$i]->label
- );
- if ($result > 0)
- {
- $lineid=$result;
- }
- else
- {
- $lineid=0;
- $error++;
- break;
- }
- // Defined the new fk_parent_line
- if ($result > 0 && $lines[$i]->product_type == 9)
- {
- $fk_parent_line = $result;
- }
- }
- }
-
- }
-
- $cmd->classifyBilled($user);
-
- if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
- else $TFact[$object->id] = $object;
- }
-
- // Build doc with all invoices
- $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
- $toselect = array();
-
- if(!empty($validate_invoices)) {
-
- $massaction = $action = 'builddoc';
-
- foreach($TAllFact as &$object) {
- $object->validate($user);
- $toselect[] = $object->id; // For builddoc action
-
- // Fac builddoc
- $upload_dir = $conf->facture->dir_output;
- $permissioncreate=$user->rights->facture->creer;
- include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
- }
-
- $objectclass='Facture';
- $objectlabel='Invoice';
- $permtoread = $user->rights->facture->lire;
- $permtodelete = $user->rights->facture->supprimer;
- $uploaddir = $conf->facture->dir_output;
- include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
-
- }
-
- if (! $error)
- {
- $db->commit();
- setEventMessage($langs->trans('BillCreated', $nb_bills_created));
- }
- else
- {
- $db->rollback();
- $action='create';
- $_GET["origin"]=$_POST["origin"];
- $_GET["originid"]=$_POST["originid"];
- setEventMessages($object->error, $object->errors, 'errors');
- $error++;
- }
-
+ // TODO Move this into mass action include
+ if ($massaction == 'confirm_createbills') {
+
+ $orders = GETPOST('toselect');
+ $createbills_onebythird = GETPOST('createbills_onebythird', 'int');
+ $validate_invoices = GETPOST('valdate_invoices', 'int');
+
+ $TFact = array();
+ $TFactThird = array();
+
+ $nb_bills_created = 0;
+
+ $db->begin();
+
+ foreach($orders as $id_order) {
+
+ $cmd = new Commande($db);
+ if($cmd->fetch($id_order) <= 0) continue;
+
+ $object = new Facture($db);
+ if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
+ else {
+
+ $object->socid = $cmd->socid;
+ $object->type = Facture::TYPE_STANDARD;
+ $object->cond_reglement_id = $cmd->cond_reglement_id;
+ $object->mode_reglement_id = $cmd->mode_reglement_id;
+ $object->fk_project = $cmd->fk_project;
+
+ $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+ if (empty($datefacture))
+ {
+ $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
+ }
+
+ $object->date = $datefacture;
+ $object->origin = 'commande';
+ $object->origin_id = $id_order;
+
+ $res = $object->create($user);
+
+ if($res > 0) $nb_bills_created++;
+
+ }
+
+ if($object->id > 0) {
+
+ $db->begin();
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
+ $sql.= "fk_source";
+ $sql.= ", sourcetype";
+ $sql.= ", fk_target";
+ $sql.= ", targettype";
+ $sql.= ") VALUES (";
+ $sql.= $id_order;
+ $sql.= ", '".$object->origin."'";
+ $sql.= ", ".$object->id;
+ $sql.= ", '".$object->element."'";
+ $sql.= ")";
+
+ if ($db->query($sql))
+ {
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
+ }
+
+ $lines = $cmd->lines;
+ if (empty($lines) && method_exists($cmd, 'fetch_lines'))
+ {
+ $cmd->fetch_lines();
+ $lines = $cmd->lines;
+ }
+
+ $fk_parent_line=0;
+ $num=count($lines);
+
+ for ($i=0;$i<$num;$i++)
+ {
+ $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
+ if ($lines[$i]->subprice < 0)
+ {
+ // Negative line, we create a discount line
+ $discount = new DiscountAbsolute($db);
+ $discount->fk_soc=$object->socid;
+ $discount->amount_ht=abs($lines[$i]->total_ht);
+ $discount->amount_tva=abs($lines[$i]->total_tva);
+ $discount->amount_ttc=abs($lines[$i]->total_ttc);
+ $discount->tva_tx=$lines[$i]->tva_tx;
+ $discount->fk_user=$user->id;
+ $discount->description=$desc;
+ $discountid=$discount->create($user);
+ if ($discountid > 0)
+ {
+ $result=$object->insert_discount($discountid);
+ //$result=$discount->link_to_invoice($lineid,$id);
+ }
+ else
+ {
+ setEventMessages($discount->error, $discount->errors, 'errors');
+ $error++;
+ break;
+ }
+ }
+ else
+ {
+ // Positive line
+ $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
+ // Date start
+ $date_start=false;
+ if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue;
+ if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
+ if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
+ //Date end
+ $date_end=false;
+ if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue;
+ if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
+ if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
+ // Reset fk_parent_line for no child products and special product
+ if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9)
+ {
+ $fk_parent_line = 0;
+ }
+ $result = $object->addline(
+ $desc,
+ $lines[$i]->subprice,
+ $lines[$i]->qty,
+ $lines[$i]->tva_tx,
+ $lines[$i]->localtax1_tx,
+ $lines[$i]->localtax2_tx,
+ $lines[$i]->fk_product,
+ $lines[$i]->remise_percent,
+ $date_start,
+ $date_end,
+ 0,
+ $lines[$i]->info_bits,
+ $lines[$i]->fk_remise_except,
+ 'HT',
+ 0,
+ $product_type,
+ $ii,
+ $lines[$i]->special_code,
+ $object->origin,
+ $lines[$i]->rowid,
+ $fk_parent_line,
+ $lines[$i]->fk_fournprice,
+ $lines[$i]->pa_ht,
+ $lines[$i]->label
+ );
+ if ($result > 0)
+ {
+ $lineid=$result;
+ }
+ else
+ {
+ $lineid=0;
+ $error++;
+ break;
+ }
+ // Defined the new fk_parent_line
+ if ($result > 0 && $lines[$i]->product_type == 9)
+ {
+ $fk_parent_line = $result;
+ }
+ }
+ }
+
+ }
+
+ $cmd->classifyBilled($user);
+
+ if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
+ else $TFact[$object->id] = $object;
+ }
+
+ // Build doc with all invoices
+ $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
+ $toselect = array();
+
+ if(!empty($validate_invoices)) {
+
+ $massaction = $action = 'builddoc';
+
+ foreach($TAllFact as &$object) {
+ $object->validate($user);
+ $toselect[] = $object->id; // For builddoc action
+
+ // Fac builddoc
+ $upload_dir = $conf->facture->dir_output;
+ $permissioncreate=$user->rights->facture->creer;
+ include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
+ }
+
+ $objectclass='Facture';
+ $objectlabel='Invoice';
+ $permtoread = $user->rights->facture->lire;
+ $permtodelete = $user->rights->facture->supprimer;
+ $uploaddir = $conf->facture->dir_output;
+ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
+
+ }
+
+ if (! $error)
+ {
+ $db->commit();
+ setEventMessage($langs->trans('BillCreated', $nb_bills_created));
+ }
+ else
+ {
+ $db->rollback();
+ $action='create';
+ $_GET["origin"]=$_POST["origin"];
+ $_GET["originid"]=$_POST["originid"];
+ setEventMessages($object->error, $object->errors, 'errors');
+ $error++;
+ }
+ }
}
@@ -435,8 +434,9 @@ $formfile = new FormFile($db);
$companystatic = new Societe($db);
$formcompany=new FormCompany($db);
+$title=$langs->trans("Orders");
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
-llxHeader('',$langs->trans("Orders"),$help_url);
+llxHeader('',$title,$help_url);
$sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
@@ -563,8 +563,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
}
$sql.= $db->plimit($limit + 1,$offset);
-
//print $sql;
+
$resql = $db->query($sql);
if ($resql)
{
@@ -622,7 +622,6 @@ if ($resql)
if ($show_files) $param.='&show_files=' .$show_files;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($billed != '') $param.='&billed='.$billed;
-
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{
@@ -654,6 +653,7 @@ if ($resql)
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
+ // TODO Move this into an invluce
if ($massaction == 'presend')
{
$langs->load("mails");
@@ -679,9 +679,6 @@ if ($resql)
print ' ';
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
- $formmail = new FormMail($db);
-
dol_fiche_head(null, '', '');
$topicmail="SendOrderRef";
@@ -789,7 +786,6 @@ if ($resql)
print ' ';
print '';
print ' ';
-
}
if ($sall)
@@ -841,49 +837,12 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
-
+ if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
+
print '';
print '
'."\n";
- // Fields title
- print '';
- if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'],$_SERVER["PHP_SELF"],'c.ref','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['c.ref_client']['checked'])) print_liste_field_titre($arrayfields['c.ref_client']['label'],$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'],$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'],$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'],$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'],$_SERVER["PHP_SELF"],'c.tva','',$param, 'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'],$_SERVER["PHP_SELF"],'c.total_ttc','',$param, 'align="right"',$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['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'],$_SERVER["PHP_SELF"],"c.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'],$_SERVER["PHP_SELF"],'c.facture','',$param,'align="center"',$sortfield,$sortorder,'');
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print ' '."\n";
-
- print '';
+ print ' ';
// Ref
if (! empty($arrayfields['c.ref']['checked']))
{
@@ -1030,12 +989,50 @@ if ($resql)
}
// Action column
print '';
- $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
+ $searchpitco=$form->showFilterButtons();
print $searchpitco;
print ' ';
print " \n";
+ // Fields title
+ print '';
+ if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'],$_SERVER["PHP_SELF"],'c.ref','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.ref_client']['checked'])) print_liste_field_titre($arrayfields['c.ref_client']['label'],$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'],$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'],$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'],$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'],$_SERVER["PHP_SELF"],'c.tva','',$param, 'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'],$_SERVER["PHP_SELF"],'c.total_ttc','',$param, 'align="right"',$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($langs->trans($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['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'],$_SERVER["PHP_SELF"],"c.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'],$_SERVER["PHP_SELF"],'c.facture','',$param,'align="center"',$sortfield,$sortorder,'');
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
+ print ' '."\n";
+
$total=0;
$subtotal=0;
$productstat_cache=array();
@@ -1044,13 +1041,12 @@ if ($resql)
$generic_product = new Product($db);
$i=0;
- $var=true;
$totalarray=array();
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print '';
+
+ print ' ';
$notshippable=0;
$warning = 0;
@@ -1223,7 +1219,7 @@ if ($resql)
// Third party
if (! empty($arrayfields['s.nom']['checked']))
{
- print '';
+ print ' ';
print $companystatic->getNomUrl(1,'customer');
// If module invoices enabled and user with invoice creation permissions
@@ -1393,7 +1389,12 @@ if ($resql)
}
// Show total line
- if (isset($totalarray['totalhtfield']))
+ if (isset($totalarray['totalhtfield'])
+ || isset($totalarray['totalvatfield'])
+ || isset($totalarray['totalttcfield'])
+ || isset($totalarray['totalamfield'])
+ || isset($totalarray['totalrtpfield'])
+ )
{
print ' ';
$i=0;
@@ -1424,8 +1425,6 @@ if ($resql)
print ''."\n";
- //print ' '.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).' ';
-
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
{
/*
@@ -1436,7 +1435,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->commande->lire;
- $delallowed=$user->rights->commande->lire;
+ $delallowed=$user->rights->commande->supprimer;
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
@@ -1451,6 +1450,5 @@ else
dol_print_error($db);
}
-// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 4d53d8e8d50..79475c75917 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -75,7 +75,7 @@ if ($id > 0 || ! empty($ref))
$head = commande_prepare_head($object);
- dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order');
+ dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), -1, 'order');
// Order card
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index d7c5682e0a9..c6b93cb8f0f 100644
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2012 Andreu Bisquerra Gaya
* Copyright (C) 2012 David Rodriguez Martinez
- * Copyright (C) 2012 Juanjo Menent
+ * Copyright (C) 2012-2017 Juanjo Menent
* Copyright (C) 2015 Ferran Marcet
*
* This program is free software; you can redistribute it and/or modify
@@ -122,7 +122,7 @@ if (($action == 'create' || $action == 'add') && !$error)
}
if (isset($_POST['orders_to_invoice']))
{
- $orders_id = GETPOST('orders_to_invoice','',1);
+ $orders_id = GETPOST('orders_to_invoice','',2);
$nn = count($orders_id);
$ii = 0;
@@ -350,7 +350,7 @@ if (($action == 'create' || $action == 'add') && !$error)
if ($id > 0 && ! $error)
{
$db->commit();
- header('Location: '.DOL_URL_ROOT.'/compta/facture.php?facid='.$id);
+ header('Location: '.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$id);
exit;
}
else
@@ -653,8 +653,8 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
while ($i < $num)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print '';
+
+ print ' ';
print '';
$generic_commande->id=$objp->rowid;
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index d900709b835..dd79ee54ba1 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -253,7 +253,7 @@ if ($mode == 'supplier') $type='supplier_order_stats';
complete_head_from_modules($conf,$langs,null,$head,$h,$type);
-dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
+dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
print '';
@@ -323,7 +323,7 @@ foreach ($data as $val)
while (! empty($year) && $oldyear > $year+1)
{ // If we have empty year
$oldyear--;
- $var=!$var;
+
print '
';
print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.' ';
print '0 ';
@@ -335,7 +335,7 @@ foreach ($data as $val)
print ' ';
}
- $var=!$var;
+
print '
';
print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.' ';
print ''.$val['nb'].' ';
diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php
index 38efbc91ca2..629cd3c0fb0 100644
--- a/htdocs/commande/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php
@@ -36,7 +36,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
- $var=!$var;
+
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index af63247f48d..cb10fd8c3c7 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -144,7 +144,7 @@ else
// Onglets
$head=bank_prepare_head($object);
-dol_fiche_head($head,'annual',$langs->trans("FinancialAccount"),0,'account');
+dol_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), -1, 'account');
$title=$langs->trans("FinancialAccount")." : ".$object->label;
$link=($year_start?"".img_previous('', 'class="valignbottom"')." ".$langs->trans("Year")." ".img_next('', 'class="valignbottom"')." ":"");
@@ -203,8 +203,8 @@ print ' ';
$var=true;
for ($mois = 1 ; $mois < 13 ; $mois++)
{
- $var=!$var;
- print '
';
+
+ print ' ';
print "".dol_print_date(dol_mktime(1,1,1,$mois,1,2000),"%B")." ";
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php
index ad3817f28cd..bddf1292214 100644
--- a/htdocs/compta/bank/bankentries.php
+++ b/htdocs/compta/bank/bankentries.php
@@ -4,8 +4,9 @@
* Copyright (C) 2005-2010 Regis Houssin
* Copyright (C) 2012 Vinícius Nogueira
* Copyright (C) 2014 Florian Henry
- * Copyright (C) 2015 Jean-François Ferry
+ * Copyright (C) 2015 Jean-François Ferry
* Copyright (C) 2016 Juanjo Menent
+ * Copyright (C) 2017 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
@@ -91,6 +92,7 @@ $search_dv_end = dol_mktime(0, 0, 0, GETPOST('search_end_dvmonth', 'int'), GETPO
$search_thirdparty=GETPOST("thirdparty",'alpha');
$search_req_nb=GETPOST("req_nb",'alpha');
$search_num_releve=GETPOST("search_num_releve",'alpha');
+$search_conciliated=GETPOST("search_conciliated",'int');
$num_releve=GETPOST("num_releve");
$cat=GETPOST("cat");
@@ -150,6 +152,7 @@ $arrayfields=array(
'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605),
'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>1000),
'b.num_releve'=>array('label'=>$langs->trans("AccountStatement"), 'checked'=>1, 'position'=>1010),
+ 'b.conciliated'=>array('label'=>$langs->trans("Conciliated"), 'enabled'=> $object->rappro, 'checked'=>($action == 'reconcile'?1:0), 'position'=>1020),
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
@@ -175,7 +178,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
-if (GETPOST("button_removefilter_x") || 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_dt_start='';
$search_dt_end='';
@@ -190,6 +193,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$search_req_nb='';
$search_thirdparty='';
$search_num_releve='';
+ $search_conciliated='';
$thirdparty='';
$account="";
@@ -294,7 +298,7 @@ if (GETPOST('save') && $id && ! $cancel && $user->rights->banque->modifier)
if (! $error)
{
$object->fetch($id);
- $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
+ $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user);
if ($insertid > 0)
{
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
@@ -393,40 +397,37 @@ if ($id > 0 || ! empty($ref))
foreach ($bankcateg->fetchAll() as $bankcategory) {
$options[$bankcategory->id] = $bankcategory->label;
}
-
+
// Bank card
-
$head=bank_prepare_head($object);
dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account');
-
+
$linkback = ''.$langs->trans("BackToList").' ';
-
+
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
-
+
dol_fiche_end();
-
-
/*
* Buttons actions
*/
- if ($action != 'addline' && $action != 'reconcile')
+ if ($action != 'reconcile')
{
print '';
-
- if ($action != 'addline')
- {
- if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
- {
- if ($user->rights->banque->modifier) {
- print '
'.$langs->trans("AddBankRecord").' ';
- } else {
- print '
'.$langs->trans("AddBankRecord").' ';
- }
- } else {
- print '
'.$langs->trans("AddBankRecord").' ';
- }
- }
+
+ if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
+ {
+ if ($user->rights->banque->modifier) {
+ print '
'.$langs->trans("AddBankRecord").' ';
+ } else {
+ print '
'.$langs->trans("AddBankRecord").' ';
+ }
+ }
+ else
+ {
+ print '
'.$langs->trans("AddBankRecord").' ';
+ }
+
if ($object->canBeConciliated() > 0) {
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate) {
@@ -444,7 +445,7 @@ else
llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param);
}
-$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq,";
+$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
$sql.= " b.fk_account, b.fk_type,";
$sql.= " ba.rowid as bankid, ba.ref as bankref,";
$sql.= " bu.url_id,";
@@ -474,6 +475,7 @@ if (dol_strlen($search_dv_end)>0) $sql .= " AND b.datev <= '" . $db->idate($sear
if ($search_ref) $sql.=natural_search("b.rowid", $search_ref);
if ($search_req_nb) $sql.= natural_search("b.num_chq", $search_req_nb);
if ($search_num_releve) $sql.= natural_search("b.num_releve", $search_num_releve);
+if ($search_conciliated != '' && $search_conciliated != '-1') $sql.= " AND b.rappro = ".$search_conciliated;
if ($search_thirdparty) $sql.= natural_search("s.nom", $search_thirdparty);
if ($description) $sql.= natural_search("b.label", $description); // Warning some text are just translation keys, not translated strings
if ($bid) $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid;
@@ -636,49 +638,6 @@ if ($resql)
// print '
';
}
- // Form to add a transaction with no invoice
- if ($user->rights->banque->modifier && $action == 'addline')
- {
- print load_fiche_titre($langs->trans("AddBankRecordLong"),'','');
-
- print '
';
- print '';
- print ''.$langs->trans("Date").' ';
- print ' ';
- print ''.$langs->trans("Type").' ';
- print ''.$langs->trans("Numero").' ';
- print ''.$langs->trans("Description").' ';
- print ''.$langs->trans("Debit").' ';
- print ''.$langs->trans("Credit").' ';
- print ' ';
- print ' ';
-
- print '';
- print '';
- $form->select_date(empty($dateop)?-1:$dateop,'op',0,0,0,'transaction');
- print ' ';
- print '';
- $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1);
- print ' ';
- print ' ';
- print '';
- print ' ';
- if ($options) {
- print ' '.$langs->trans("Rubrique").': ';
- print Form::selectarray('cat1', $options, GETPOST('cat1'), 1);
- }
- print ' ';
- print ' ';
- print ' ';
- print '';
- print ' ';
- print ' ';
- print ' ';
- print '
';
- print '
';
- }
-
-
/// ajax to adjust value date with plus and less picto
print '
';
+
+ return $out;
+ }
+
/**
* Return HTML to show the search and clear seach button
*
@@ -6163,31 +6262,10 @@ class Form
*/
function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0)
{
- global $conf, $langs;
-
- $out='
';
- $out.=' ';
- $out.=' ';
- $out.='
';
+ $out.=$this->showFilterButtons();
if ($addcheckuncheckall)
{
- if (! empty($conf->use_javascript_ajax)) $out.='
';
- $out.='';
+ $out.=$this->showCheckAddButtons($cssclass, $calljsfunction);
}
return $out;
}
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index b44f854087c..b799e0e2359 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -120,7 +120,7 @@ class FormActions
{
//var_dump($selected);
if ($selected == 'done') $selected='100';
- print '
';
+ print '';
if ($showempty) print ' ';
foreach($listofstatus as $key => $val)
{
@@ -207,8 +207,8 @@ class FormActions
$ref=$action->getNomUrl(1,-1);
$label=$action->getNomUrl(0,38);
- $var=!$var;
- print '';
+
+ print ' ';
print ''.$ref.' ';
print ''.$label.' ';
print ''.$action->type.' ';
diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php
index ace00b77caa..f4902e4912e 100644
--- a/htdocs/core/class/html.formcontract.class.php
+++ b/htdocs/core/class/html.formcontract.class.php
@@ -66,6 +66,7 @@ class FormContract
//if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")";
if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)";
if ($socid > 0) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)";
+ $sql.= " ORDER BY c.ref ";
dol_syslog(get_class($this)."::select_contract", LOG_DEBUG);
$resql=$db->query($sql);
@@ -129,6 +130,14 @@ class FormContract
}
print '';
$db->free($resql);
+
+ if (!empty($conf->use_javascript_ajax))
+ {
+ // Make select dynamic
+ include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
+ print ajax_combobox($htmlname);
+ }
+
return $num;
}
else
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index e80ff8008df..8d90892cfb6 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -89,6 +89,11 @@ class FormFile
}
else
{
+ //If there is no permission and the option to hide unauthorized actions is enabled, then nothing is printed
+ if (!$perm && !empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) {
+ return 1;
+ }
+
$maxlength=$size;
$out = "\n\n\n";
@@ -229,7 +234,7 @@ class FormFile
* @param integer $allowgenifempty Show warning if no model activated
* @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined)
* @param int $iconPDF Show only PDF icon with link (1/0)
- * @param int $maxfilenamelength Max length for filename shown
+ * @param int $notused Not used
* @param integer $noform Do not output html form tags
* @param string $param More param on http links
* @param string $title Title to show on top of form
@@ -238,10 +243,10 @@ class FormFile
* @return int <0 if KO, number of shown files if OK
* @deprecated Use print xxx->showdocuments() instead.
*/
- function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
+ function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
{
$this->numoffiles=0;
- print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang);
+ print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang);
return $this->numoffiles;
}
@@ -259,7 +264,7 @@ class FormFile
* @param integer $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning)
* @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined)
* @param int $iconPDF Deprecated, see getDocumentsLink
- * @param int $maxfilenamelength Max length for filename shown
+ * @param int $notused Not used
* @param integer $noform Do not output html form tags
* @param string $param More param on http links
* @param string $title Title to show on top of form
@@ -269,7 +274,7 @@ class FormFile
* @param Object $object Object when method is called from an object card.
* @return string Output string with HTML array of documents (might be empty string)
*/
- function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='',$object=null)
+ function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='',$object=null)
{
// Deprecation warning
if (0 !== $iconPDF) {
@@ -297,7 +302,6 @@ class FormFile
$hookmanager->initHooks(array('formfile'));
$forname='builddoc';
$out='';
- $var=true;
$headershown=0;
$showempty=0;
@@ -308,7 +312,7 @@ class FormFile
if (preg_match('/massfilesarea_/', $modulepart))
{
- $out.=' ';
+ $out.='
';
$title=$langs->trans("MassFilesArea").' ('.$langs->trans("Hide").') ';
$title.='';
+ if ($addlink) $out.=' '.$langs->trans("Link").' ';
+ return $out;
+}
+
/**
* Convert a html select field into an ajax combobox.
* Use ajax_combobox() only for small combo list! If not, use instead ajax_autocompleter().
@@ -377,12 +396,12 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
$(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({
dir: \'ltr\',
width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */
- minimumInputLength: '.$minLengthToAutocomplete.'
+ minimumInputLength: '.$minLengthToAutocomplete.'
})';
if ($forcefocus) $msg.= '.select2(\'focus\')';
$msg.= ';'."\n";
- if (count($events))
+ if (count($events)) // If an array of js events to do were provided.
{
$msg.= '
jQuery("#'.$htmlname.'").change(function () {
@@ -395,6 +414,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
});
function runJsCodeForEvent'.$htmlname.'(obj) {
+ console.log("Run runJsCodeForEvent'.$htmlname.'");
var id = $("#'.$htmlname.'").val();
var method = obj.method;
var url = obj.url;
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 47d3539e3ba..c88a0b7afed 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -77,7 +77,7 @@ function bank_prepare_head(Account $object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id;
$head[$h][1] = $langs->trans("Documents");
@@ -91,6 +91,11 @@ function bank_prepare_head(Account $object)
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank');
+ /*$head[$h][0] = DOL_URL_ROOT . "/compta/bank/info.php?id=" . $object->id;
+ $head[$h][1] = $langs->trans("Info");
+ $head[$h][2] = 'info';
+ $h++;*/
+
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank', 'remove');
return $head;
@@ -134,6 +139,51 @@ function bank_admin_prepare_head($object)
return $head;
}
+/**
+ * Prepare array with list of tabs
+ *
+ * @param Object $object Object related to tabs
+ * @return array Array of tabs to shoc
+ */
+function various_payment_prepare_head($object) {
+
+ global $db, $langs, $conf;
+
+ $h = 0;
+ $head = array();
+
+ $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$object->id;
+ $head[$h][1] = $langs->trans("Card");
+ $head[$h][2] = 'card';
+ $h++;
+
+ // Show more tabs from modules
+ // Entries must be declared in modules descriptor with line
+ // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'various_payment');
+
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
+ $upload_dir = $conf->banque->dir_output . "/" . dol_sanitizeFileName($object->ref);
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
+ $nbLinks=Link::count($db, $object->element, $object->id);
+ $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/document.php?id='.$object->id;
+ $head[$h][1] = $langs->trans('Documents');
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).' ';
+ $head[$h][2] = 'documents';
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/info.php?id='.$object->id;
+ $head[$h][1] = $langs->trans("Info");
+ $head[$h][2] = 'info';
+ $h++;
+
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'various_payment', 'remove');
+
+ return $head;
+}
+
/**
* Check SWIFT informations for a bank account
*
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 2e809fa6c3b..809a045bacf 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -43,7 +43,7 @@ function societe_prepare_head(Societe $object)
$h = 0;
$head = array();
- $head[$h][0] = DOL_URL_ROOT.'/societe/soc.php?socid='.$object->id;
+ $head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
@@ -215,7 +215,7 @@ function societe_prepare_head(Societe $object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id ;
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
@@ -259,7 +259,7 @@ function societe_prepare_head2($object)
$h = 0;
$head = array();
- $head[$h][0] = DOL_URL_ROOT.'/societe/soc.php?socid='.$object->id;
+ $head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'company';
$h++;
@@ -531,10 +531,13 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
print "\n";
print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,'');
+ print '';
print "\n".'
';
- $sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status";
+ $sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
+ $sql .= ", cls.code as opp_status_code";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
$sql .= " WHERE p.fk_soc = ".$object->id;
$sql .= " ORDER BY p.dateo DESC";
@@ -544,8 +547,14 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
$num = $db->num_rows($result);
print '';
- print ''.$langs->trans("Ref").' '.$langs->trans("Name").' '.$langs->trans("DateStart").' '.$langs->trans("DateEnd").' ';
- print ''.$langs->trans("Status").' ';
+ print ''.$langs->trans("Ref").' ';
+ print ''.$langs->trans("Name").' ';
+ print ''.$langs->trans("DateStart").' ';
+ print ''.$langs->trans("DateEnd").' ';
+ print ''.$langs->trans("OpportunityAmountShort").' ';
+ print ''.$langs->trans("OpportunityStatusShort").' ';
+ print ''.$langs->trans("OpportunityProbabilityShort").' ';
+ print ''.$langs->trans("Status").' ';
print ' ';
if ($num > 0)
@@ -567,16 +576,31 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
if ($user->rights->projet->lire && $userAccess > 0)
{
$var = !$var;
- print "";
+ print ' ';
// Ref
print ''.img_object($langs->trans("ShowProject"),($obj->public?'projectpub':'project'))." ".$obj->ref.' ';
// Label
print ''.$obj->title.' ';
// Date start
- print ''.dol_print_date($db->jdate($obj->do),"day").' ';
+ print ''.dol_print_date($db->jdate($obj->do),"day").' ';
// Date end
- print ''.dol_print_date($db->jdate($obj->de),"day").' ';
+ print ''.dol_print_date($db->jdate($obj->de),"day").' ';
+ // Opp amount
+ print '';
+ if ($obj->opp_status_code)
+ {
+ print price($obj->opp_amount, 1, '', 1, -1, -1, '');
+ }
+ print ' ';
+ // Opp status
+ print '';
+ if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code);
+ print ' ';
+ // Opp percent
+ print '';
+ if ($obj->opp_percent) print price($obj->opp_percent, 1, '', 1, 0).'%';
+ print ' ';
// Status
print ''.$projecttmp->getLibStatut(5).' ';
@@ -588,7 +612,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
else
{
$var = false;
- print ' '.$langs->trans("None").' ';
+ print ''.$langs->trans("None").' ';
}
$db->free($result);
}
@@ -597,7 +621,8 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
dol_print_error($db);
}
print "
";
-
+ print '
';
+
print " \n";
}
@@ -668,7 +693,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$colspan=9;
print ' ';
- print_liste_field_titre('');
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Poste"),$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email"),$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
@@ -703,21 +727,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
{
print ' ';
- // Photo
- print '';
- print ' ';
-
- // Name - Position
+ // Photo - Name
print '';
print ' ';
print ' ';
- // Address / Phone
+ // Position
print '';
- //print ' ';
print ' ';
- // Email
+ // Address - Phone - Email
print ' ';
// Status
@@ -744,7 +763,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
while ($i < $num)
{
$obj = $db->fetch_object($result);
- $var = !$var;
$contactstatic->id = $obj->rowid;
$contactstatic->ref = $obj->ref;
@@ -770,16 +788,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$contactstatic->setGenderFromCivility();
- print " ";
+ print " ";
- // Photo
- print '';
- print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder','small',1,0,1);
- print ' ';
-
- // Name
+ // Photo - Name
print '';
- print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage));
+ print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder valignmiddle marginrightonly','small',1,0,1);
+ print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage));
print ' ';
// Job position
@@ -787,7 +801,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
if ($obj->poste) print $obj->poste;
print '';
- // Address and phone
+ // Address - Phone - Email
print '';
print $contactstatic->getBannerAddress('contact', $object);
print ' ';
@@ -879,7 +893,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
{
$var = !$var;
- print " ";
+ print ' ';
print '';
$addressstatic->id = $address->id;
@@ -915,7 +929,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
}
else
{
- //print " ";
+ //print ' ';
//print ''.$langs->trans("NoAddressYetDefined").' ';
//print " \n";
}
@@ -958,7 +972,7 @@ function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$ac
* @param Contact $objcon Object contact
* @param int $noprint Return string but does not output it
* @param string $actioncode Filter on actioncode
- * @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter.
+ * @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all).
* @param array $filters Filter on other fields
* @param string $sortfield Sort field
* @param string $sortorder Sort order
@@ -990,7 +1004,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$sql.= " a.fk_element, a.elementtype,";
$sql.= " a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
- $sql.= " u.login, u.rowid as user_id";
+ $sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
if (get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
if (get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
@@ -1063,9 +1077,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
+
'userid'=>$obj->user_id,
- 'login'=>$obj->login,
- 'contact_id'=>$obj->fk_contact,
+ 'login'=>$obj->user_login,
+ 'userfirstname'=>$obj->user_firstname,
+ 'userlastname'=>$obj->user_lastname,
+ 'userphoto'=>$obj->user_photo,
+
+ 'contact_id'=>$obj->fk_contact,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'fk_element'=>$obj->fk_element,
@@ -1094,7 +1113,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$sql = "SELECT m.rowid as id, mc.date_envoi as da, m.titre as note, '100' as percentage,";
$sql.= " 'AC_EMAILING' as acode,";
- $sql.= " u.rowid as user_id, u.login"; // User that valid action
+ $sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action
$sql.= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email.
$sql.= " AND mc.statut = 1";
@@ -1121,8 +1140,12 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
'note'=>$obj->note,
'percent'=>$obj->percentage,
'acode'=>$obj->acode,
- 'userid'=>$obj->user_id,
- 'login'=>$obj->login
+
+ 'userid'=>$obj->user_id,
+ 'login'=>$obj->user_login,
+ 'userfirstname'=>$obj->user_firstname,
+ 'userlastname'=>$obj->user_lastname,
+ 'userphoto'=>$obj->user_photo
);
$numaction++;
$i++;
@@ -1174,54 +1197,55 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.='';
$out.='
';
+
+ $out.='';
+ if ($donetodo)
+ {
+ $out.=' ';
+ }
+ $out.=' ';
+ $out.=' ';
+ $out.=' ';
+ $out.=' ';
+ $out.='';
+ $out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1);
+ $out.=' ';
+ $out.=' ';
+ $out.=' ';
+ $out.=' ';
+ // Action column
+ $out.='';
+ $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
+ $out.=$searchpitco;
+ $out.=' ';
+ $out.=' ';
+
$out.='';
if ($donetodo)
{
- $out.='';
- if (get_class($filterobj) == 'Societe') $out.='';
- $out.=$langs->trans("ActionsToDoShort").' / '.$langs->trans("ActionsDoneShort");
- if (get_class($filterobj) == 'Societe') $out.=' ';
- $out.=' ';
+ $tmp='';
+ if (get_class($filterobj) == 'Societe') $tmp.='';
+ $tmp.=($donetodo != 'done' ? $langs->trans("ActionsToDoShort") : '');
+ $tmp.=($donetodo != 'done' && $donetodo != 'todo' ? ' / ' : '');
+ $tmp.=($donetodo != 'todo' ? $langs->trans("ActionsDoneShort") : '');
+ //$out.=$langs->trans("ActionsToDoShort").' / '.$langs->trans("ActionsDoneShort");
+ if (get_class($filterobj) == 'Societe') $tmp.=' ';
+ $out.=getTitleFieldOfList($tmp);
}
- $out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder);
- $out.=''.$langs->trans("Label").' ';
- $out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, '', $sortfield, $sortorder);
- $out.=''.$langs->trans("Type").' ';
- $out.=' ';
- $out.=' ';
- $out.=''.$langs->trans("Owner").' ';
+ $out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder);
+ $out.=getTitleFieldOfList($langs->trans("Owner"));
+ $out.=getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
+ $out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder);
+ $out.=getTitleFieldOfList($langs->trans("Type"));
+ $out.=getTitleFieldOfList('');
+ $out.=getTitleFieldOfList('');
$out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder);
- $out.='';
- //TODO Add selection of fields
- $out.=' ';
- $out.=' ';
-
-
- $out.='';
- if ($donetodo)
- {
- $out.=' ';
- }
- $out.=' ';
- $out.=' ';
- $out.=' ';
- $out.='';
- $out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1);
- $out.=' ';
- $out.=' ';
- $out.=' ';
- $out.=' ';
- $out.=' ';
- // Action column
- $out.='';
- $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
- $out.=$searchpitco;
- $out.=' ';
+ $out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
$out.=' ';
foreach ($histo as $key=>$value)
{
- $var=!$var;
+
$actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo
$out.="";
@@ -1238,6 +1262,15 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.=$actionstatic->getNomUrl(1, -1);
$out.='';
+ // Author of event
+ $out.='';
+ //$userstatic->id=$histo[$key]['userid'];
+ //$userstatic->login=$histo[$key]['login'];
+ //$out.=$userstatic->getLoginUrl(1);
+ $userstatic->fetch($histo[$key]['userid']);
+ $out.=$userstatic->getNomUrl(-1);
+ $out.=' ';
+
// Title
$out.='';
if (isset($histo[$key]['type']) && $histo[$key]['type']=='action')
@@ -1258,9 +1291,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.=dol_trunc($libelle,120);
}
$out.=' ';
-
+
// Date
- $out.='';
+ $out.=' ';
$out.=dol_print_date($histo[$key]['datestart'],'dayhour');
if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart'])
{
@@ -1356,16 +1389,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.=' ';
}
- // Auteur
- $out.='';
- //$userstatic->id=$histo[$key]['userid'];
- //$userstatic->login=$histo[$key]['login'];
- //$out.=$userstatic->getLoginUrl(1);
- $userstatic->fetch($histo[$key]['userid']);
- $out.=$userstatic->getNomUrl(1);
- $out.=' ';
-
- // Statut
+ // Status
$out.=''.$actionstatic->LibStatut($histo[$key]['percent'],3,1,$histo[$key]['datestart']).' ';
// Actions
@@ -1430,7 +1454,7 @@ function show_subsidiaries($conf,$langs,$db,$object)
$obj = $db->fetch_object($result);
$var = !$var;
- print " ";
+ print ' ';
print '';
$socstatic->id = $obj->rowid;
@@ -1445,7 +1469,7 @@ function show_subsidiaries($conf,$langs,$db,$object)
print ' '.$obj->code_client.' ';
print '';
- print '';
+ print ' ';
print img_edit();
print ' ';
diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php
index c507e2e66ee..f951439f0c5 100644
--- a/htdocs/core/lib/contact.lib.php
+++ b/htdocs/core/lib/contact.lib.php
@@ -76,7 +76,7 @@ function contact_prepare_head(Contact $object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->societe->dir_output . "/contact/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$tab][0] = DOL_URL_ROOT.'/contact/document.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Documents");
diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php
index 2d328ea7097..9d986e983bc 100644
--- a/htdocs/core/lib/contract.lib.php
+++ b/htdocs/core/lib/contract.lib.php
@@ -71,7 +71,7 @@ function contract_prepare_head(Contrat $object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php
index 5ba8570ab57..1981ae63d09 100644
--- a/htdocs/core/lib/doleditor.lib.php
+++ b/htdocs/core/lib/doleditor.lib.php
@@ -71,7 +71,7 @@ function show_skin($fuser,$edit=0)
print '';*/
print ' ';
- print '';
+ print ' ';
print ''.$langs->trans("ThemeDir").' ';
print '';
foreach($dirskins as $dirskin)
@@ -81,8 +81,8 @@ function show_skin($fuser,$edit=0)
print ' ';
print ' ';
- //$var=!$var;
- print '';
+ //
+ print ' ';
print '';
diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php
index 51f6858eafd..665ff7cb4e3 100644
--- a/htdocs/core/lib/donation.lib.php
+++ b/htdocs/core/lib/donation.lib.php
@@ -81,7 +81,7 @@ function donation_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->don->dir_output . '/' . get_exdir($filename,2,0,1,$object,'donation'). '/'. dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php
index cc60f9feb13..f253f077243 100644
--- a/htdocs/core/lib/expensereport.lib.php
+++ b/htdocs/core/lib/expensereport.lib.php
@@ -48,7 +48,7 @@ function expensereport_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/expensereport/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php
index 964bbe14b2c..8507a85292a 100644
--- a/htdocs/core/lib/fichinter.lib.php
+++ b/htdocs/core/lib/fichinter.lib.php
@@ -55,14 +55,6 @@ function fichinter_prepare_head($object)
$h++;
}
- if (! empty($conf->global->MAIN_USE_PREVIEW_TABS))
- {
- $head[$h][0] = DOL_URL_ROOT.'/fichinter/apercu.php?id='.$object->id;
- $head[$h][1] = $langs->trans('Preview');
- $head[$h][2] = 'preview';
- $h++;
- }
-
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
@@ -110,7 +102,7 @@ function fichinter_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->ficheinter->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index a2d6da7bdc5..6d90a1afed3 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -45,7 +45,7 @@ function dol_basename($pathfile)
* @param string $types Can be "directories", "files", or "all"
* @param int $recursive Determines whether subdirectories are searched
* @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function. Filter is checked into basename only.
- * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). Exclude is checked into fullpath.
+ * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked into fullpath.
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
@@ -208,7 +208,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
*
* @param string $path Starting path from which to search. Example: 'produit/MYPROD'
* @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
- * @param array|null $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.'))
+ * @param array|null $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.'))
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like description
@@ -772,7 +772,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
}
// Security:
- // On interdit fichiers caches, remontees de repertoire ainsi que les pipes dans les noms de fichiers.
+ // We refuse cache files/dirs, upload using .. and pipes into filenames.
if (preg_match('/^\./',$src_file) || preg_match('/\.\./',$src_file) || preg_match('/[<>|]/',$src_file))
{
dol_syslog("Refused to deliver file ".$src_file, LOG_WARNING);
@@ -845,6 +845,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
* @param int $nohook Disable all hooks
* @param object $object Current object in use
* @return boolean True if no error (file is deleted or if glob is used and there's nothing to delete), False if error
+ * @see dol_delete_dir
*/
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null)
{
@@ -856,6 +857,14 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook);
+ // Security:
+ // We refuse transversal using .. and pipes into filenames.
+ if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file))
+ {
+ dol_syslog("Refused to delete file ".$file, LOG_WARNING);
+ return False;
+ }
+
if (empty($nohook))
{
$hookmanager->initHooks(array('fileslib'));
@@ -943,9 +952,18 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
* @param string $dir Directory to delete
* @param int $nophperrors Disable all PHP output errors
* @return boolean True if success, false if error
+ * @see dol_delete_file
*/
function dol_delete_dir($dir,$nophperrors=0)
{
+ // Security:
+ // We refuse transversal using .. and pipes into filenames.
+ if (preg_match('/\.\./',$dir) || preg_match('/[<>|]/',$dir))
+ {
+ dol_syslog("Refused to delete dir ".$dir, LOG_WARNING);
+ return False;
+ }
+
$dir_osencoded=dol_osencode($dir);
return ($nophperrors?@rmdir($dir_osencoded):rmdir($dir_osencoded));
}
@@ -1531,11 +1549,11 @@ function dol_uncompress($inputfile,$outputdir)
*
* @param string $dir Directory to scan
* @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
- * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
+ * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
* @param int $nohook Disable all hooks
* @return string Full path to most recent file
*/
-function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta|_preview\.png)$','^\.'),$nohook=false)
+function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta|_preview.*\.png)$','^\.'),$nohook=false)
{
$tmparray=dol_dir_list($dir,'files',0,$regexfilter,$excludefilter,'date',SORT_DESC,'',$nohook);
return $tmparray[0];
@@ -1554,7 +1572,8 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta
function dol_check_secure_access_document($modulepart,$original_file,$entity,$fuser='',$refname='')
{
global $user, $conf, $db;
-
+ global $dolibarr_main_data_root;
+
if (! is_object($fuser)) $fuser=$user;
if (empty($modulepart)) return 'ErrorBadParameter';
@@ -1568,141 +1587,140 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
// find the subdirectory name as the reference
if (empty($refname)) $refname=basename(dirname($original_file)."/");
+ $relative_original_file = $original_file;
+
// Wrapping for some images
- if ($modulepart == 'companylogo')
+ if (($modulepart == 'mycompany' || $modulepart == 'companylogo') && !empty($conf->mycompany->dir_output))
{
$accessallowed=1;
$original_file=$conf->mycompany->dir_output.'/logos/'.$original_file;
}
// Wrapping for users photos
- elseif ($modulepart == 'userphoto')
+ elseif ($modulepart == 'userphoto' && !empty($conf->user->dir_output))
{
$accessallowed=1;
$original_file=$conf->user->dir_output.'/'.$original_file;
}
// Wrapping for members photos
- elseif ($modulepart == 'memberphoto')
+ elseif ($modulepart == 'memberphoto' && !empty($conf->adherent->dir_output))
{
$accessallowed=1;
$original_file=$conf->adherent->dir_output.'/'.$original_file;
}
// Wrapping pour les apercu factures
- elseif ($modulepart == 'apercufacture')
+ elseif ($modulepart == 'apercufacture' && !empty($conf->facture->dir_output))
{
if ($fuser->rights->facture->lire) $accessallowed=1;
$original_file=$conf->facture->dir_output.'/'.$original_file;
}
// Wrapping pour les apercu propal
- elseif ($modulepart == 'apercupropal')
+ elseif ($modulepart == 'apercupropal' && !empty($conf->propal->dir_output))
{
if ($fuser->rights->propale->lire) $accessallowed=1;
$original_file=$conf->propal->dir_output.'/'.$original_file;
}
// Wrapping pour les apercu commande
- elseif ($modulepart == 'apercucommande')
+ elseif ($modulepart == 'apercucommande' && !empty($conf->commande->dir_output))
{
if ($fuser->rights->commande->lire) $accessallowed=1;
$original_file=$conf->commande->dir_output.'/'.$original_file;
}
// Wrapping pour les apercu intervention
- elseif ($modulepart == 'apercufichinter')
+ elseif (($modulepart == 'apercufichinter' || $modulepart == 'apercuficheinter') && !empty($conf->ficheinter->dir_output))
{
if ($fuser->rights->ficheinter->lire) $accessallowed=1;
$original_file=$conf->ficheinter->dir_output.'/'.$original_file;
}
// Wrapping pour les images des stats propales
- elseif ($modulepart == 'propalstats')
+ elseif ($modulepart == 'propalstats' && !empty($conf->propal->dir_temp))
{
if ($fuser->rights->propale->lire) $accessallowed=1;
$original_file=$conf->propal->dir_temp.'/'.$original_file;
}
// Wrapping pour les images des stats commandes
- elseif ($modulepart == 'orderstats')
+ elseif ($modulepart == 'orderstats' && !empty($conf->commande->dir_temp))
{
if ($fuser->rights->commande->lire) $accessallowed=1;
$original_file=$conf->commande->dir_temp.'/'.$original_file;
}
- elseif ($modulepart == 'orderstatssupplier')
+ elseif ($modulepart == 'orderstatssupplier' && !empty($conf->fournisseur->dir_output))
{
if ($fuser->rights->fournisseur->commande->lire) $accessallowed=1;
$original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file;
}
// Wrapping pour les images des stats factures
- elseif ($modulepart == 'billstats')
+ elseif ($modulepart == 'billstats' && !empty($conf->facture->dir_temp))
{
if ($fuser->rights->facture->lire) $accessallowed=1;
$original_file=$conf->facture->dir_temp.'/'.$original_file;
}
- elseif ($modulepart == 'billstatssupplier')
+ elseif ($modulepart == 'billstatssupplier' && !empty($conf->fournisseur->dir_output))
{
if ($fuser->rights->fournisseur->facture->lire) $accessallowed=1;
$original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file;
}
// Wrapping pour les images des stats expeditions
- elseif ($modulepart == 'expeditionstats')
+ elseif ($modulepart == 'expeditionstats' && !empty($conf->expedition->dir_temp))
{
if ($fuser->rights->expedition->lire) $accessallowed=1;
$original_file=$conf->expedition->dir_temp.'/'.$original_file;
}
// Wrapping pour les images des stats expeditions
- elseif ($modulepart == 'tripsexpensesstats')
+ elseif ($modulepart == 'tripsexpensesstats' && !empty($conf->deplacement->dir_temp))
{
if ($fuser->rights->deplacement->lire) $accessallowed=1;
$original_file=$conf->deplacement->dir_temp.'/'.$original_file;
}
// Wrapping pour les images des stats expeditions
- elseif ($modulepart == 'memberstats')
+ elseif ($modulepart == 'memberstats' && !empty($conf->adherent->dir_temp))
{
if ($fuser->rights->adherent->lire) $accessallowed=1;
$original_file=$conf->adherent->dir_temp.'/'.$original_file;
}
// Wrapping pour les images des stats produits
- elseif (preg_match('/^productstats_/i',$modulepart))
+ elseif (preg_match('/^productstats_/i',$modulepart) && !empty($conf->product->dir_temp))
{
if ($fuser->rights->produit->lire || $fuser->rights->service->lire) $accessallowed=1;
$original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file;
}
- // Wrapping for products or services
- elseif ($modulepart == 'tax')
+ // Wrapping for taxes
+ elseif ($modulepart == 'tax' && !empty($conf->tax->dir_output))
{
if ($fuser->rights->tax->charges->lire) $accessallowed=1;
$original_file=$conf->tax->dir_output.'/'.$original_file;
}
- // Wrapping for products or services
- elseif ($modulepart == 'actions')
+ // Wrapping for events
+ elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output))
{
if ($fuser->rights->agenda->myactions->read) $accessallowed=1;
$original_file=$conf->agenda->dir_output.'/'.$original_file;
}
// Wrapping for categories
- elseif ($modulepart == 'category')
+ elseif ($modulepart == 'category' && !empty($conf->categorie->dir_output))
{
if ($fuser->rights->categorie->lire) $accessallowed=1;
$original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file;
}
// Wrapping pour les prelevements
- elseif ($modulepart == 'prelevement')
+ elseif ($modulepart == 'prelevement' && !empty($conf->prelevement->dir_output))
{
- if ($fuser->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file))
- {
- $accessallowed=1;
- }
+ if ($fuser->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file)) $accessallowed=1;
$original_file=$conf->prelevement->dir_output.'/'.$original_file;
}
// Wrapping pour les graph energie
- elseif ($modulepart == 'graph_stock')
+ elseif ($modulepart == 'graph_stock' && !empty($conf->stock->dir_temp))
{
$accessallowed=1;
$original_file=$conf->stock->dir_temp.'/'.$original_file;
}
// Wrapping pour les graph fournisseurs
- elseif ($modulepart == 'graph_fourn')
+ elseif ($modulepart == 'graph_fourn' && !empty($conf->fournisseur->dir_temp))
{
$accessallowed=1;
$original_file=$conf->fournisseur->dir_temp.'/'.$original_file;
}
// Wrapping pour les graph des produits
- elseif ($modulepart == 'graph_product')
+ elseif ($modulepart == 'graph_product' && !empty($conf->product->dir_temp))
{
$accessallowed=1;
$original_file=$conf->product->multidir_temp[$entity].'/'.$original_file;
@@ -1711,32 +1729,31 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
elseif ($modulepart == 'barcode')
{
$accessallowed=1;
- // If viewimage is called for barcode, we try to output an image on the fly,
- // with not build of file on disk.
+ // If viewimage is called for barcode, we try to output an image on the fly, with no build of file on disk.
//$original_file=$conf->barcode->dir_temp.'/'.$original_file;
$original_file='';
}
// Wrapping pour les icones de background des mailings
- elseif ($modulepart == 'iconmailing')
+ elseif ($modulepart == 'iconmailing' && !empty($conf->mailing->dir_temp))
{
$accessallowed=1;
$original_file=$conf->mailing->dir_temp.'/'.$original_file;
}
- // Wrapping pour les icones de background des mailings
- elseif ($modulepart == 'scanner_user_temp')
+ // Wrapping pour le scanner
+ elseif ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp))
{
$accessallowed=1;
$original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file;
}
// Wrapping pour les images fckeditor
- elseif ($modulepart == 'fckeditor')
+ elseif ($modulepart == 'fckeditor' && !empty($conf->fckeditor->dir_output))
{
$accessallowed=1;
$original_file=$conf->fckeditor->dir_output.'/'.$original_file;
}
// Wrapping for third parties
- else if ($modulepart == 'company' || $modulepart == 'societe')
+ else if (($modulepart == 'company' || $modulepart == 'societe') && !empty($conf->societe->dir_output))
{
if ($fuser->rights->societe->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1747,7 +1764,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping for contact
- else if ($modulepart == 'contact')
+ else if ($modulepart == 'contact' && !empty($conf->societe->dir_output))
{
if ($fuser->rights->societe->lire)
{
@@ -1757,7 +1774,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping for invoices
- else if ($modulepart == 'facture' || $modulepart == 'invoice')
+ else if (($modulepart == 'facture' || $modulepart == 'invoice') && !empty($conf->facture->dir_output))
{
if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1766,7 +1783,8 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$original_file=$conf->facture->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}
- else if ($modulepart == 'massfilesarea_proposals')
+ // Wrapping for mass actions
+ else if ($modulepart == 'massfilesarea_proposals' && !empty($conf->propal->dir_output))
{
if ($fuser->rights->propal->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1790,9 +1808,49 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
$original_file=$conf->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
+ else if ($modulepart == 'massfilesarea_expensereport')
+ {
+ if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file))
+ {
+ $accessallowed=1;
+ }
+ $original_file=$conf->expensereport->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
+ }
+ else if ($modulepart == 'massfilesarea_interventions')
+ {
+ if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file))
+ {
+ $accessallowed=1;
+ }
+ $original_file=$conf->ficheinter->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
+ }
+ else if ($modulepart == 'massfilesarea_supplier_proposal' && !empty($conf->propal->dir_output))
+ {
+ if ($fuser->rights->supplier_proposal->lire || preg_match('/^specimen/i',$original_file))
+ {
+ $accessallowed=1;
+ }
+ $original_file=$conf->supplier_proposal->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
+ }
+ else if ($modulepart == 'massfilesarea_supplier_order')
+ {
+ if ($fuser->rights->fournisseur->commande->lire || preg_match('/^specimen/i',$original_file))
+ {
+ $accessallowed=1;
+ }
+ $original_file=$conf->fournisseur->commande->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
+ }
+ else if ($modulepart == 'massfilesarea_supplier_invoice')
+ {
+ if ($fuser->rights->fournisseur->facture->lire || preg_match('/^specimen/i',$original_file))
+ {
+ $accessallowed=1;
+ }
+ $original_file=$conf->fournisseur->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
+ }
- // Wrapping pour les fiches intervention
- else if ($modulepart == 'ficheinter')
+ // Wrapping for interventions
+ else if (($modulepart == 'fichinter' || $modulepart == 'ficheinter') && !empty($conf->ficheinter->dir_output))
{
if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1803,7 +1861,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les deplacements et notes de frais
- else if ($modulepart == 'deplacement')
+ else if ($modulepart == 'deplacement' && !empty($conf->deplacement->dir_output))
{
if ($fuser->rights->deplacement->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1813,7 +1871,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}
// Wrapping pour les propales
- else if ($modulepart == 'propal')
+ else if ($modulepart == 'propal' && !empty($conf->propal->dir_output))
{
if ($fuser->rights->propale->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1825,7 +1883,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les commandes
- else if ($modulepart == 'commande' || $modulepart == 'order')
+ else if (($modulepart == 'commande' || $modulepart == 'order') && !empty($conf->commande->dir_output))
{
if ($fuser->rights->commande->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1836,7 +1894,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les projets
- else if ($modulepart == 'project')
+ else if ($modulepart == 'project' && !empty($conf->projet->dir_output))
{
if ($fuser->rights->projet->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1845,7 +1903,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$original_file=$conf->projet->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project', 1).")";
}
- else if ($modulepart == 'project_task')
+ else if ($modulepart == 'project_task' && !empty($conf->projet->dir_output))
{
if ($fuser->rights->projet->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1854,19 +1912,9 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$original_file=$conf->projet->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project', 1).")";
}
- // Wrapping for interventions
- else if ($modulepart == 'fichinter')
- {
- if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file))
- {
- $accessallowed=1;
- }
- $original_file=$conf->ficheinter->dir_output.'/'.$original_file;
- $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
- }
// Wrapping pour les commandes fournisseurs
- else if ($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier')
+ else if (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output))
{
if ($fuser->rights->fournisseur->commande->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1877,7 +1925,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les factures fournisseurs
- else if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier')
+ else if (($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') && !empty($conf->fournisseur->facture->dir_output))
{
if ($fuser->rights->fournisseur->facture->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1898,7 +1946,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les rapport de paiements
- else if ($modulepart == 'facture_paiement')
+ else if ($modulepart == 'facture_paiement' && !empty($conf->facture->dir_output))
{
if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1909,7 +1957,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping for accounting exports
- else if ($modulepart == 'export_compta')
+ else if ($modulepart == 'export_compta' && !empty($conf->accounting->dir_output))
{
if ($fuser->rights->accounting->bind->write || preg_match('/^specimen/i',$original_file))
{
@@ -1919,7 +1967,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les expedition
- else if ($modulepart == 'expedition')
+ else if ($modulepart == 'expedition' && !empty($conf->expedition->dir_output))
{
if ($fuser->rights->expedition->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1927,9 +1975,8 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
$original_file=$conf->expedition->dir_output."/sending/".$original_file;
}
-
// Wrapping pour les bons de livraison
- else if ($modulepart == 'livraison')
+ else if ($modulepart == 'livraison' && !empty($conf->expedition->dir_output))
{
if ($fuser->rights->expedition->livraison->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1939,7 +1986,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les actions
- else if ($modulepart == 'actions')
+ else if ($modulepart == 'actions' && !empty($conf->agenda->dir_output))
{
if ($fuser->rights->agenda->myactions->read || preg_match('/^specimen/i',$original_file))
{
@@ -1949,7 +1996,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les actions
- else if ($modulepart == 'actionsreport')
+ else if ($modulepart == 'actionsreport' && !empty($conf->agenda->dir_temp))
{
if ($fuser->rights->agenda->allactions->read || preg_match('/^specimen/i',$original_file))
{
@@ -1970,7 +2017,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les contrats
- else if ($modulepart == 'contract')
+ else if ($modulepart == 'contract' && !empty($conf->contrat->dir_output))
{
if ($fuser->rights->contrat->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1981,7 +2028,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les dons
- else if ($modulepart == 'donation')
+ else if ($modulepart == 'donation' && !empty($conf->donation->dir_output))
{
if ($fuser->rights->don->lire || preg_match('/^specimen/i',$original_file))
{
@@ -1991,7 +2038,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour les remises de cheques
- else if ($modulepart == 'remisecheque')
+ else if ($modulepart == 'remisecheque' && !empty($conf->banque->dir_output))
{
if ($fuser->rights->banque->lire || preg_match('/^specimen/i',$original_file))
{
@@ -2002,7 +2049,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping for bank
- else if ($modulepart == 'bank')
+ else if ($modulepart == 'bank' && !empty($conf->bank->dir_output))
{
if ($fuser->rights->banque->lire)
{
@@ -2012,7 +2059,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping for export module
- else if ($modulepart == 'export')
+ else if ($modulepart == 'export' && !empty($conf->export->dir_temp))
{
// Aucun test necessaire car on force le rep de download sur
// le rep export qui est propre a l'utilisateur
@@ -2021,47 +2068,42 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping for import module
- else if ($modulepart == 'import')
+ else if ($modulepart == 'import' && !empty($conf->import->dir_temp))
{
$accessallowed=1;
$original_file=$conf->import->dir_temp.'/'.$original_file;
}
// Wrapping pour l'editeur wysiwyg
- else if ($modulepart == 'editor')
+ else if ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output))
{
$accessallowed=1;
$original_file=$conf->fckeditor->dir_output.'/'.$original_file;
}
// Wrapping for miscellaneous medias files
- elseif ($modulepart == 'medias')
+ elseif ($modulepart == 'medias' && !empty($dolibarr_main_data_root))
{
$accessallowed=1;
- global $dolibarr_main_data_root;
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file;
}
// Wrapping for backups
- else if ($modulepart == 'systemtools')
+ else if ($modulepart == 'systemtools' && !empty($conf->admin->dir_output))
{
- if ($fuser->admin)
- {
- $accessallowed=1;
- }
+ if ($fuser->admin) $accessallowed=1;
$original_file=$conf->admin->dir_output.'/'.$original_file;
}
// Wrapping for upload file test
- else if ($modulepart == 'admin_temp')
+ else if ($modulepart == 'admin_temp' && !empty($conf->admin->dir_temp))
{
- if ($fuser->admin)
- $accessallowed=1;
+ if ($fuser->admin) $accessallowed=1;
$original_file=$conf->admin->dir_temp.'/'.$original_file;
}
// Wrapping pour BitTorrent
- else if ($modulepart == 'bittorrent')
+ else if ($modulepart == 'bittorrent' && !empty($conf->bittorrent->dir_output))
{
$accessallowed=1;
$dir='files';
@@ -2070,7 +2112,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping pour Foundation module
- else if ($modulepart == 'member')
+ else if ($modulepart == 'member' && !empty($conf->adherent->dir_output))
{
if ($fuser->rights->adherent->lire || preg_match('/^specimen/i',$original_file))
{
@@ -2080,7 +2122,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
// Wrapping for Scanner
- else if ($modulepart == 'scanner_user_temp')
+ else if ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp))
{
$accessallowed=1;
$original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file;
@@ -2093,20 +2135,38 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
// If modulepart=module Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart
else
{
+ if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a file called specimen. Test must be done before changing $original_file int full path.
+ if ($fuser->admin) $accessallowed=1; // If user is admin
+
// Define $accessallowed
if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg))
{
- if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
+ if (empty($conf->{$reg[1]}->dir_temp)) // modulepart not supported
+ {
+ dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')');
+ exit;
+ }
+ if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
$original_file=$conf->{$reg[1]}->dir_temp.'/'.$fuser->id.'/'.$original_file;
}
else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg))
{
- if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
+ if (empty($conf->{$reg[1]}->dir_temp)) // modulepart not supported
+ {
+ dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')');
+ exit;
+ }
+ if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
$original_file=$conf->{$reg[1]}->dir_temp.'/'.$original_file;
}
else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg))
{
- if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
+ if (empty($conf->{$reg[1]}->dir_output)) // modulepart not supported
+ {
+ dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')');
+ exit;
+ }
+ if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
$original_file=$conf->{$reg[1]}->dir_output.'/'.$fuser->id.'/'.$original_file;
}
else
@@ -2130,8 +2190,6 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$original_file=$conf->$modulepart->dir_output.'/'.$original_file;
}
}
- if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen
- if ($fuser->admin) $accessallowed=1; // If user is admin
// For modules who wants to manage different levels of permissions for documents
$subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS';
@@ -2163,7 +2221,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
/**
- * Store object in file
+ * Store object in file.
*
* @param string $directory Directory of cache
* @param string $filename Name of filecache
@@ -2179,7 +2237,7 @@ function dol_filecache($directory, $filename, $object)
}
/**
- * Test if Refresh needed
+ * Test if Refresh needed.
*
* @param string $directory Directory of cache
* @param string $filename Name of filecache
@@ -2195,7 +2253,7 @@ function dol_cache_refresh($directory, $filename, $cachetime)
}
/**
- * Read object from cachefile
+ * Read object from cachefile.
*
* @param string $directory Directory of cache
* @param string $filename Name of filecache
diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php
index 3ac3cf49a9c..44e7774cae6 100644
--- a/htdocs/core/lib/fourn.lib.php
+++ b/htdocs/core/lib/fourn.lib.php
@@ -74,7 +74,7 @@ function facturefourn_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$object->ref;
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Documents');
@@ -151,7 +151,7 @@ function ordersupplier_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 6a0ffad4149..87039a3d454 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -129,7 +129,7 @@ function getEntity($element=false, $shared=0)
else
{
$out='';
- $addzero = array('user', 'usergroup');
+ $addzero = array('user', 'usergroup', 'email_template', 'default_values');
if (in_array($element, $addzero)) $out.= '0,';
$out.= $conf->entity;
return $out;
@@ -248,7 +248,24 @@ function dol_shutdown()
*/
function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
{
- if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:'');
+ if (empty($method))
+ {
+ $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:'');
+
+ // Management of default values
+ if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
+ {
+ $relativepathstring = preg_replace('/\.[a-z]+$/', '', $_SERVER["PHP_SELF"]);
+ if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring);
+ $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
+ $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
+ $relativepathstring=dol_string_nospecial($relativepathstring, '-');
+ // $relativepathstring is now string that identify the page: '_societe_card', '_agenda_card', ...
+ $keyfordefaultvalue = 'MAIN_DEFAULT_FOR_'.$relativepathstring.'_'.$paramname;
+ global $conf;
+ if (isset($conf->global->$keyfordefaultvalue)) $out = $conf->global->$keyfordefaultvalue;
+ }
+ }
elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:'';
elseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]:'';
elseif ($method==3) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:'');
@@ -257,6 +274,8 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
if (! empty($check))
{
+ // Replace vars like __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__
+ // TODO Add more var like __PREVIOUSDAY__, __PREVIOUSMONTH__, __PREVIOUSYEAR__
if (! is_array($out) && preg_match('/^__([a-z0-9]+)__$/i', $out, $reg))
{
if ($reg[1] == 'DAY')
@@ -279,6 +298,16 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
global $mysoc;
$out = $mysoc->country_id;
}
+ elseif ($reg[1] == 'USERID')
+ {
+ global $user;
+ $out = $user->id;
+ }
+ elseif ($reg[1] == 'ENTITYID')
+ {
+ global $conf;
+ $out = $conf->entity;
+ }
}
switch ($check)
@@ -780,7 +809,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
* @param array $links Array of tabs. Currently initialized by calling a function xxx_admin_prepare_head
* @param string $active Active tab name (document', 'info', 'ldap', ....)
* @param string $title Title
- * @param int $notab 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
+ * @param int $notab -1 or 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
* @param string $picto Add a picto on tab title
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
* @return void
@@ -796,7 +825,7 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
* @param array $links Array of tabs
* @param string $active Active tab name
* @param string $title Title
- * @param int $notab 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
+ * @param int $notab -1 or 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
* @param string $picto Add a picto on tab title
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
* @return string
@@ -833,7 +862,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
$limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD);
$displaytab=0;
$nbintab=0;
- $popuptab=0;
+ $popuptab=0; $outmore='';
for ($i = 0 ; $i <= $maxkey ; $i++)
{
if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2]))
@@ -926,7 +955,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
$out.="
\n";
- if (! $notab) $out.="\n".''."\n";
+ if (! $notab || $notab == -1) $out.="\n".'
'."\n";
$parameters=array('tabname' => $active, 'out' => $out);
$reshook=$hookmanager->executeHooks('printTabsHead',$parameters); // This hook usage is called just before output the head of tabs. Take also a look at "completeTabsHead"
@@ -941,7 +970,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
/**
* Show tab footer of a card
*
- * @param int $notab 0=Add tab footer, 1=no tab footer
+ * @param int $notab -1 or 0=Add tab footer, 1=no tab footer
* @return void
*/
function dol_fiche_end($notab=0)
@@ -952,12 +981,12 @@ function dol_fiche_end($notab=0)
/**
* Return tab footer of a card
*
- * @param int $notab 0=Add tab footer, 1=no tab footer
+ * @param int $notab -1 or 0=Add tab footer, 1=no tab footer
* @return string
*/
function dol_get_fiche_end($notab=0)
{
- if (! $notab) return "\n
\n";
+ if (! $notab || $notab == -1) return "\n
\n";
else return '';
}
@@ -983,18 +1012,24 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
{
global $conf, $form, $user, $langs;
+ $error = 0;
+
$maxvisiblephotos=1;
$showimage=1;
$showbarcode=empty($conf->barcode->enabled)?0:($object->barcode?1:0);
if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0;
$modulepart='unknown';
- if ($object->element == 'societe') $modulepart='societe';
- if ($object->element == 'contact') $modulepart='contact';
- if ($object->element == 'member') $modulepart='memberphoto';
- if ($object->element == 'user') $modulepart='userphoto';
- if ($object->element == 'product') $modulepart='product';
-
+ if ($object->element == 'societe') $modulepart='societe';
+ if ($object->element == 'contact') $modulepart='contact';
+ if ($object->element == 'member') $modulepart='memberphoto';
+ if ($object->element == 'user') $modulepart='userphoto';
+ if ($object->element == 'product') $modulepart='product';
+ if ($object->element == 'propal') $modulepart='propal';
+ if ($object->element == 'commande') $modulepart='commande';
+ if ($object->element == 'facture') $modulepart='facture';
+ if ($object->element == 'fichinter') $modulepart='ficheinter';
+
if ($object->element == 'product')
{
$width=80; $cssclass='photoref';
@@ -1010,7 +1045,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
elseif ($conf->browser->layout != 'phone') { // Show no photo link
$nophoto='/public/theme/common/nophoto.png';
- $morehtmlleft.='';
+ $morehtmlleft.='';
}
}
}
@@ -1020,7 +1055,57 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
{
if ($modulepart != 'unknown')
{
- $phototoshow = $form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos);
+ $phototoshow='';
+
+ // Check if a preview file is available
+ if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter')) && class_exists("Imagick"))
+ {
+ $objectref = dol_sanitizeFileName($object->ref);
+ $dir_output = $conf->$modulepart->dir_output . "/";
+ $filepath = $dir_output . $objectref . "/";
+ $file = $filepath . $objectref . ".pdf";
+ $relativepath = $objectref.'/'.$objectref.'.pdf';
+
+ // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
+ $fileimage = $file.'_preview.png'; // If PDF has 1 page
+ $fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page
+ $relativepathimage = $relativepath.'_preview.png';
+
+ // Si fichier PDF existe
+ if (file_exists($file))
+ {
+ $encfile = urlencode($file);
+ // Conversion du PDF en image png si fichier png non existant
+ if ( (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($file)))
+ && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file)))
+ )
+ {
+ $ret = dol_convert_file($file, 'png', $fileimage);
+ if ($ret < 0) $error++;
+ }
+
+ // Si fichier png PDF d'1 page trouve
+ if (file_exists($fileimage))
+ {
+ $phototoshow = '';
+ $phototoshow.= '
';
+ $phototoshow.= '
';
+ }
+ // Si fichier png PDF de plus d'1 page trouve
+ elseif (file_exists($fileimagebis))
+ {
+ $preview = preg_replace('/\.png/','',$relativepathimage) . "-0.png";
+ $phototoshow = '';
+ $phototoshow.= '
';
+ $phototoshow.= '
';
+ }
+ }
+ }
+ else if (! $phototoshow)
+ {
+ $phototoshow = $form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos);
+ }
+
if ($phototoshow)
{
$morehtmlleft.='';
@@ -1028,28 +1113,38 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$morehtmlleft.='
';
}
}
- elseif ($conf->browser->layout != 'phone') // Show no photo link
+
+ if (! $phototoshow && $conf->browser->layout != 'phone') // Show No photo link (picto of pbject)
{
$morehtmlleft.='';
if ($object->element == 'action')
{
+ $width=80;
$cssclass='photorefcenter';
$nophoto=img_picto('', 'title_agenda', '', false, 1);
- $morehtmlleft.='
';
+ $morehtmlleft.='
';
}
else
{
$width=14; $cssclass='photorefcenter';
- $nophoto=img_picto('', 'object_'.$object->picto, '', false, 1);
- $morehtmlleft.='
';
+ $picto = $object->picto;
+ if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub
+ $nophoto=img_picto('', 'object_'.$picto, '', false, 1);
+ $morehtmlleft.='
';
}
$morehtmlleft.='
';
}
}
}
+
if ($showbarcode) $morehtmlleft.=''.$form->showbarcode($object).'
';
- if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
- $morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
+
+ if ($object->element == 'societe')
+ {
+ if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE))
+ {
+ $morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
+ }
}
elseif ($object->element == 'product')
{
@@ -1067,25 +1162,13 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$morehtmlstatus.=$object->getLibStatut(5,1);
}
}
- elseif ($object->element == 'facture' || $object->element == 'invoice' || $object->element == 'invoice_supplier')
+ elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan')))
{
$tmptxt=$object->getLibStatut(6, $object->totalpaye);
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye);
$morehtmlstatus.=$tmptxt;
}
- elseif ($object->element == 'chargesociales')
- {
- $tmptxt=$object->getLibStatut(6, $object->totalpaye);
- if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye);
- $morehtmlstatus.=$tmptxt;
- }
- elseif ($object->element == 'loan')
- {
- $tmptxt=$object->getLibStatut(6, $object->totalpaye);
- if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye);
- $morehtmlstatus.=$tmptxt;
- }
- elseif ($object->element == 'contrat')
+ elseif ($object->element == 'contrat' || $object->element == 'contract')
{
if ($object->statut==0) $morehtmlstatus.=$object->getLibStatut(2);
else $morehtmlstatus.=$object->getLibStatut(4);
@@ -1097,11 +1180,12 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
if (! empty($object->name_alias)) $morehtmlref.=''.$object->name_alias.'
'; // For thirdparty
- if ($object->element == 'product' || $object->element == 'bank_account')
+ // Add label
+ if ($object->element == 'product' || $object->element == 'bank_account' || $object->element == 'project_task')
{
- if(! empty($object->label)) $morehtmlref.=''.$object->label.'
';
+ if (! empty($object->label)) $morehtmlref.=''.$object->label.'
';
}
-
+
if ($object->element != 'product' && $object->element != 'bookmark')
{
$morehtmlref.='';
@@ -1548,6 +1632,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
*/
function dol_now($mode='gmt')
{
+ $ret='';
// Note that gmmktime and mktime return same value (GMT) when used without parameters
//if ($mode == 'gmt') $ret=gmmktime(); // Strict Standards: gmmktime(): You should be using the time() function instead
if ($mode == 'gmt') $ret=time(); // Time for now at greenwich.
@@ -1959,12 +2044,12 @@ function dol_print_address($address, $htmlid, $mode, $id, $noprint=0, $charfornl
if ($showgmap)
{
$url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1);
- $out.='
';
+ $out.='
';
}
if ($showomap)
{
$url=dol_buildpath('/openstreetmap/maps.php?mode='.$mode.'&id='.$id,1);
- $out.='
';
+ $out.='
';
}
}
}
@@ -2296,14 +2381,14 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
* Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
- * @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
+ * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
* @param int $pictoisfullpath If 1, image path is a full path
* @param int $srconly Return only content of the src attribute of img.
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
* @return string Return img tag
* @see #img_object, #img_picto_common
*/
-function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $srconly=0, $notitle=0)
+function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly=0, $notitle=0)
{
global $conf;
@@ -2355,7 +2440,7 @@ function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $
if (preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
$title=$tmparray[0];
$alt=empty($tmparray[1])?'':$tmparray[1];
- return '
'; // Alt is used for accessibility, title for popup
+ return '
'; // Alt is used for accessibility, title for popup
}
}
@@ -2365,16 +2450,16 @@ function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...)
* For external modules use imagename@mymodule to search into directory "img" of module.
- * @param string $morealt Add more attribute on img tag (ie: class="datecallink")
+ * @param string $moreatt Add more attribute on img tag (ie: class="datecallink")
* @param int $pictoisfullpath If 1, image path is a full path
* @param int $srconly Return only content of the src attribute of img.
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
* @return string Return img tag
* @see #img_picto, #img_picto_common
*/
-function img_object($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $srconly=0, $notitle=0)
+function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly=0, $notitle=0)
{
- return img_picto($titlealt, 'object_'.$picto, $morealt, $pictoisfullpath, $srconly, $notitle);
+ return img_picto($titlealt, 'object_'.$picto, $moreatt, $pictoisfullpath, $srconly, $notitle);
}
/**
@@ -2382,12 +2467,12 @@ function img_object($titlealt, $picto, $morealt = '', $pictoisfullpath = false,
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
- * @param string $morealt Add more attribute on img tag
+ * @param string $moreatt Add more attribute on img tag
* @param int $pictoisfullpath If 1, image path is a full path
* @return string Return img tag
* @see #img_object, #img_picto
*/
-function img_weather($titlealt, $picto, $morealt = '', $pictoisfullpath = 0)
+function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0)
{
global $conf;
@@ -2395,7 +2480,7 @@ function img_weather($titlealt, $picto, $morealt = '', $pictoisfullpath = 0)
$path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto;
- return img_picto($titlealt, $path, $morealt, 1);
+ return img_picto($titlealt, $path, $moreatt, 1);
}
/**
@@ -2403,12 +2488,12 @@ function img_weather($titlealt, $picto, $morealt = '', $pictoisfullpath = 0)
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
- * @param string $morealt Add more attribute on img tag
+ * @param string $moreatt Add more attribute on img tag
* @param int $pictoisfullpath If 1, image path is a full path
* @return string Return img tag
* @see #img_object, #img_picto
*/
-function img_picto_common($titlealt, $picto, $morealt = '', $pictoisfullpath = 0)
+function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0)
{
global $conf;
@@ -2427,7 +2512,7 @@ function img_picto_common($titlealt, $picto, $morealt = '', $pictoisfullpath = 0
}
}
- return img_picto($titlealt, $path, $morealt, 1);
+ return img_picto($titlealt, $path, $moreatt, 1);
}
/**
@@ -2510,7 +2595,7 @@ function img_edit_remove($titlealt = 'default', $other='')
* @param string $other Add more attributes on img
* @return string Return tag img
*/
-function img_edit($titlealt = 'default', $float = 0, $other = '')
+function img_edit($titlealt = 'default', $float = 0, $other = 'class="pictoedit"')
{
global $conf, $langs;
@@ -2533,9 +2618,9 @@ function img_view($titlealt = 'default', $float = 0, $other = '')
if ($titlealt == 'default') $titlealt = $langs->trans('View');
- $morealt = ($float ? 'style="float: right" ' : '').$other;
+ $moreatt = ($float ? 'style="float: right" ' : '').$other;
- return img_picto($titlealt, 'view.png', $morealt);
+ return img_picto($titlealt, 'view.png', $moreatt);
}
/**
@@ -2545,7 +2630,7 @@ function img_view($titlealt = 'default', $float = 0, $other = '')
* @param string $other Add more attributes on img
* @return string Retourne tag img
*/
-function img_delete($titlealt = 'default', $other = '')
+function img_delete($titlealt = 'default', $other = 'class="pictodelete"')
{
global $conf, $langs;
@@ -2568,6 +2653,22 @@ function img_printer($titlealt = "default", $other='')
return img_picto($titlealt,'printer.png',$other);
}
+/**
+ * Show delete logo
+ *
+ * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
+ * @param string $other Add more attributes on img
+ * @return string Retourne tag img
+ */
+function img_split($titlealt = 'default', $other = 'class="pictosplit"')
+{
+ global $conf, $langs;
+
+ if ($titlealt == 'default') $titlealt = $langs->trans('Split');
+
+ return img_picto($titlealt, 'split.png', $other);
+}
+
/**
* Show help logo with cursor "?"
*
@@ -2607,16 +2708,17 @@ function img_info($titlealt = 'default')
* Show warning logo
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
- * @param string $morealt Add more attribute on img tag (For example 'style="float: right"'). If 1
+ * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"'). If 1
* @return string Return img tag
*/
-function img_warning($titlealt = 'default', $morealt = '')
+function img_warning($titlealt = 'default', $moreatt = '')
{
global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Warning');
- return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"'.($morealt ? ($morealt == '1' ? ' style="float: right"' : ' '.$morealt): ''));
+ //return '
'.img_picto($titlealt, 'warning_white.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): '')).'
';
+ return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): ''));
}
/**
@@ -2631,39 +2733,41 @@ function img_error($titlealt = 'default')
if ($titlealt == 'default') $titlealt = $langs->trans('Error');
- return img_picto($titlealt, 'error.png');
+ return img_picto($titlealt, 'error.png', 'class="valigntextbottom"');
}
/**
* Show next logo
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
-* @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
+* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
* @return string Return img tag
*/
-function img_next($titlealt = 'default', $morealt='')
+function img_next($titlealt = 'default', $moreatt='')
{
global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Next');
- return img_picto($titlealt, 'next.png', $morealt);
+ //return img_picto($titlealt, 'next.png', $moreatt);
+ return '
';
}
/**
* Show previous logo
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
- * @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
+ * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
* @return string Return img tag
*/
-function img_previous($titlealt = 'default', $morealt='')
+function img_previous($titlealt = 'default', $moreatt='')
{
global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Previous');
- return img_picto($titlealt, 'previous.png', $morealt);
+ //return img_picto($titlealt, 'previous.png', $moreatt);
+ return '
';
}
/**
@@ -2705,16 +2809,16 @@ function img_up($titlealt = 'default', $selected = 0, $moreclass='')
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param int $selected Selected
- * @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
+ * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
* @return string Return img tag
*/
-function img_left($titlealt = 'default', $selected = 0, $morealt='')
+function img_left($titlealt = 'default', $selected = 0, $moreatt='')
{
global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Left');
- return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $morealt);
+ return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $moreatt);
}
/**
@@ -2722,16 +2826,16 @@ function img_left($titlealt = 'default', $selected = 0, $morealt='')
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param int $selected Selected
- * @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
+ * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
* @return string Return img tag
*/
-function img_right($titlealt = 'default', $selected = 0, $morealt='')
+function img_right($titlealt = 'default', $selected = 0, $moreatt='')
{
global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Right');
- return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $morealt);
+ return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $moreatt);
}
/**
@@ -3023,13 +3127,13 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar
/**
* Get title line of an array
*
- * @param string $name Label of field
+ * @param string $name Translation key of field
* @param int $thead 0=To use with standard table format, 1=To use inside
, 2=To use with
* @param string $file Url used when we click on sort picto
* @param string $field Field to use for new sorting. Empty if this field is not sortable.
* @param string $begin ("" by defaut)
* @param string $moreparam Add more parameters on sort url links ("" by default)
- * @param string $moreattrib Add more attributes on th ("" by defaut)
+ * @param string $moreattrib Add more attributes on th ("" by defaut). To add more css class, use param $prefix.
* @param string $sortfield Current field used to sort
* @param string $sortorder Current sort order
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag.
@@ -3037,7 +3141,7 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar
*/
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="")
{
- global $conf;
+ global $conf, $langs;
//print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder
\n";
$sortorder=strtoupper($sortorder);
@@ -3071,7 +3175,7 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
}
}
- $out.=$name;
+ $out.=$langs->trans($name);
if (empty($thead) && $field) // If this is a sort field
{
@@ -3263,20 +3367,20 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
if ($cpt>=1)
{
- $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page=0'.$options.'">1 ';
- if ($cpt > 2) $pagelist.='
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="inactive"':'data-role="button"').'>... ';
- else if ($cpt == 2) $pagelist.='
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page=1'.$options.'">2 ';
+ $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>1 ';
+ if ($cpt > 2) $pagelist.='
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="inactive"':'').'>... ';
+ else if ($cpt == 2) $pagelist.='
dol_use_jmobile != 4)?' class="pagination"':'').'>2 ';
}
do
{
if ($cpt==$page)
{
- $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="active"':'data-role="button"').'>'.($page+1).' ';
+ $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="active"':'').'>'.($page+1).' ';
}
else
{
- $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page='.$cpt.$options.'">'.($cpt+1).' ';
+ $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>'.($cpt+1).' ';
}
$cpt++;
}
@@ -3284,14 +3388,14 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
if ($cpt<$nbpages)
{
- if ($cpt<$nbpages-2) $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="inactive"':'data-role="button"').'>... ';
- else if ($cpt == $nbpages-2) $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-2).$options.'">'.($nbpages - 1).' ';
- $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-1).$options.'">'.$nbpages.' ';
+ if ($cpt<$nbpages-2) $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="inactive"':'').'>... ';
+ else if ($cpt == $nbpages-2) $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>'.($nbpages - 1).' ';
+ $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>'.$nbpages.' ';
}
}
else
{
- $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="active"':'data-role="button"').'>'.($page+1)." ";
+ $pagelist.= '
dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="active"':'').'>'.($page+1)." ";
}
}
print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtml, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist
@@ -3370,8 +3474,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
}
if ($page > 0)
{
- if (($conf->dol_use_jmobile != 4)) print '';
- else print '
'.$langs->trans("Previous").' ';
+ print '';
}
if ($betweenarrows)
{
@@ -3379,8 +3482,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
}
if ($nextpage > 0)
{
- if (($conf->dol_use_jmobile != 4)) print '';
- else print '
'.$langs->trans("Next").' ';
+ print '';
}
if ($afterarrows)
{
@@ -3767,7 +3869,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'";
$sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
if ($vatratecode) $sql.= " AND t.code ='".$vatratecode."'"; // If we have the code, we use it in priority
- else $sql.= " AND t.recuperableonly ='".$npr."'";
+ else $sql.= " AND t.recuperableonly ='".$vatnpr."'";
dol_syslog("get_localtax", LOG_DEBUG);
$resql=$db->query($sql);
@@ -3886,6 +3988,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local);
$vatratecleaned = $vatrate;
+ $vatratecode = '';
if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)"
{
$vatratecleaned = $reg[1];
@@ -4284,7 +4387,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id
function yn($yesno, $case=1, $color=0)
{
global $langs;
- $result='unknown';
+ $result='unknown'; $classname='';
if ($yesno == 1 || strtolower($yesno) == 'yes' || strtolower($yesno) == 'true') // A mettre avant test sur no a cause du == 0
{
$result=$langs->trans('yes');
@@ -5005,7 +5108,7 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
{
global $conf, $langs;
- $ret='';
+ $ret=0; $return='';
$out='';
$divstart=$divend='';
@@ -5175,7 +5278,8 @@ function dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensiti
$sizearray=count($array);
if (is_array($array) && $sizearray>0)
{
- foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
+ $temp = array();
+ foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
if (!$natsort) ($order=='asc') ? asort($temp) : arsort($temp);
else
@@ -5537,11 +5641,11 @@ function printCommonFooter($zone='private')
if (empty($conf->dol_use_jmobile))
{
- print ''."\n";
+ print ''."\n";
print 'jQuery(".menuhider").click(function() {';
print ' console.log("We click on .menuhider");'."\n";
print " $('.side-nav').toggle();";
- if ($conf->theme == 'md') print " $('.login_block').toggle();";
+ print " $('.login_block').toggle();";
print '});'."\n";
}
@@ -5635,6 +5739,7 @@ function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=')
{
if ($a = explode($delimiter, $string))
{
+ $ka = array();
foreach ($a as $s) { // each part
if ($s) {
if ($pos = strpos($s, $kv)) { // key/value delimiter
@@ -5830,10 +5935,11 @@ function getImageFileNameForSize($file, $extName, $extImgTarget='')
* Return URL we can use for advanced preview links
*
* @param string $modulepart propal, facture, facture_fourn, ...
- * @param string $relativepath Relative path of docs
- * @return string Output string with HTML
+ * @param string $relativepath Relative path of docs.
+ * @param int $alldata Return array with all components (1 is recommended, then use a simple a href link with the class, target and mime attribute added. 'documentpreview' css class is handled by jquery code into main.inc.php)
+ * @return string|array Output string with href link or array with all components of link
*/
-function getAdvancedPreviewUrl($modulepart, $relativepath)
+function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0)
{
global $conf, $langs;
@@ -5843,8 +5949,15 @@ function getAdvancedPreviewUrl($modulepart, $relativepath)
//$mime_preview[]='vnd.oasis.opendocument.presentation';
//$mime_preview[]='archive';
$num_mime = array_search(dol_mimetype($relativepath, '', 1), $mime_preview);
+
+ if ($alldata == 1)
+ {
+ if ($num_mime !== false) return array('target'=>'_blank', 'css'=>'documentpreview', 'url'=>DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath), 'mime'=>dol_mimetype($relativepath), );
+ else return array();
+ }
- if ($num_mime !== false) return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.$relativepath).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js($langs->trans('Preview')).'\')';
+ // old behavior
+ if ($num_mime !== false) return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath)).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js($langs->trans('Preview')).'\')';
else return '';
}
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 2b09e829a6c..dc0541e39ef 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1509,7 +1509,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
$sql.= " WHERE type = '".$type."'";
$sql.= " AND entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
$sql.= " ORDER BY description DESC";
-
+
dol_syslog('/core/lib/function2.lib.php::getListOfModels', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
@@ -1530,7 +1530,6 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
$const=$obj->description;
$dirtoscan.=($dirtoscan?',':'').preg_replace('/[\r\n]+/',',',trim($conf->global->$const));
-
$listoffiles=array();
// Now we add models found in directories scanned
diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php
index 3314aa94631..f4319b7d11a 100644
--- a/htdocs/core/lib/functionsnumtoword.lib.php
+++ b/htdocs/core/lib/functionsnumtoword.lib.php
@@ -96,7 +96,8 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
$max_length = $levels * 3;
$num = substr('00' . $num, -$max_length);
$num_levels = str_split($num, 3);
- for ($i = 0; $i < count($num_levels); $i++) {
+ $nboflevels = count($num_levels);
+ for ($i = 0; $i < $nboflevels; $i++) {
$levels--;
$hundreds = (int) ($num_levels[$i] / 100);
$hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' '.$langs->transnoentities('hundred') . ( $hundreds == 1 ? '' : 's' ) . ' ': '');
diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php
index 605c37520d8..56d19d0e0f1 100644
--- a/htdocs/core/lib/holiday.lib.php
+++ b/htdocs/core/lib/holiday.lib.php
@@ -43,7 +43,7 @@ function holiday_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->holiday->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index f48a248ab14..220cc5aeccc 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -3,6 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2015 Juanjo Menent
+ * Copyright (C) 2017 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
@@ -38,7 +39,7 @@ function facture_prepare_head($object)
$h = 0;
$head = array();
- $head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$object->id;
+ $head[$h][0] = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Card');
$head[$h][2] = 'compta';
$h++;
@@ -53,14 +54,6 @@ function facture_prepare_head($object)
$h++;
}
- if (! empty($conf->global->MAIN_USE_PREVIEW_TABS))
- {
- $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$object->id;
- $head[$h][1] = $langs->trans('Preview');
- $head[$h][2] = 'preview';
- $h++;
- }
-
//if ($fac->mode_reglement_code == 'PRE')
if (! empty($conf->prelevement->enabled))
{
@@ -103,7 +96,7 @@ function facture_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Documents');
@@ -165,4 +158,27 @@ function invoice_admin_prepare_head()
}
+function invoice_rec_prepare_head($object)
+{
+ global $db, $langs, $conf;
+
+ $h = 0;
+ $head = array();
+
+ $head[$h][0] = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?id='.$object->id;
+ $head[$h][1] = $langs->trans("CardBill");
+ $head[$h][2] = 'card';
+ $h++;
+
+ // Show more tabs from modules
+ // Entries must be declared in modules descriptor with line
+ // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec');
+
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec','remove');
+
+ return $head;
+}
+
diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php
index d5a362663b7..d4ef7a2ed7a 100644
--- a/htdocs/core/lib/ldap.lib.php
+++ b/htdocs/core/lib/ldap.lib.php
@@ -147,7 +147,7 @@ function show_ldap_content($result,$level,$count,$var,$hide=0,$subcount=0)
$hide=0;
if (! is_numeric($key))
{
- $var=!$var;
+
print '';
print '';
print $key;
diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php
index f1748a0dfb9..3f7029dd26b 100644
--- a/htdocs/core/lib/loan.lib.php
+++ b/htdocs/core/lib/loan.lib.php
@@ -50,7 +50,7 @@ function loan_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->loan->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$tab][0] = DOL_URL_ROOT.'/loan/document.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Documents");
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index 574f7a5b950..550ec6ad534 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -79,7 +79,7 @@ function member_prepare_head(Adherent $object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->adherent->multidir_output[$object->entity].'/'.get_exdir(0,0,0,1,$object,'member');
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php
index 1458f37fdce..89bbe24ea47 100644
--- a/htdocs/core/lib/order.lib.php
+++ b/htdocs/core/lib/order.lib.php
@@ -60,14 +60,6 @@ function commande_prepare_head(Commande $object)
$h++;
}
- if (! empty($conf->global->MAIN_USE_PREVIEW_TABS))
- {
- $head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$object->id;
- $head[$h][1] = $langs->trans("Preview");
- $head[$h][2] = 'preview';
- $h++;
- }
-
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
@@ -99,7 +91,7 @@ function commande_prepare_head(Commande $object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/parsemd.lib.php b/htdocs/core/lib/parsemd.lib.php
new file mode 100644
index 00000000000..13334fd400c
--- /dev/null
+++ b/htdocs/core/lib/parsemd.lib.php
@@ -0,0 +1,56 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ * or see http://www.gnu.org/
+ */
+
+/**
+ * \file htdocs/core/lib/parsemd.lib.php
+ * \brief This file contains functions dedicated to MD parsind.
+ */
+
+/**
+ * Function to parse MD content into HTML
+ *
+ * @param string $content MD content
+ * @param string $parser 'parsedown' or 'nl2br'
+ * @param string $replaceimagepath Replace path to image with another path. Exemple: ('doc/'=>'xxx/aaa/')
+ * @return string Parsed content
+ */
+function dolMd2Html($content, $parser='parsedown',$replaceimagepath=null)
+{
+ if (is_array($replaceimagepath))
+ {
+ foreach($replaceimagepath as $key => $val)
+ {
+ $keytoreplace = ']('.$key;
+ $valafter = ']('.$val;
+ $content = preg_replace('/'.preg_quote($keytoreplace,'/').'/m', $valafter, $content);
+ }
+ }
+ if ($parser == 'parsedown')
+ {
+ include_once DOL_DOCUMENT_ROOT.'/includes/parsedown/Parsedown.php';
+ $Parsedown = new Parsedown();
+ $content = $Parsedown->text($content);
+ }
+ else
+ {
+ $content = nl2br($content);
+ }
+
+ return $content;
+}
+
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index aaf3ae0bb9d..5aec64f3ce0 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -149,11 +149,11 @@ function product_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
if (! empty($conf->product->enabled) && ($object->type==Product::TYPE_PRODUCT)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
if (! empty($conf->service->enabled) && ($object->type==Product::TYPE_SERVICE)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
if (! empty($conf->product->enabled) && ($object->type==Product::TYPE_PRODUCT)) $upload_dir = $conf->produit->multidir_output[$object->entity].'/'.get_exdir($object->id,2,0,0,$object,'product').$object->id.'/photos';
if (! empty($conf->service->enabled) && ($object->type==Product::TYPE_SERVICE)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir($object->id,2,0,0,$object,'product').$object->id.'/photos';
- $nbFiles += count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles += count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
}
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 173aee8ce26..96bcbaa00c4 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -82,7 +82,7 @@ function project_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
@@ -150,8 +150,23 @@ function task_prepare_head($object)
$head[$h][2] = 'task_contact';
$h++;
+ // Is there timespent ?
+ $nbTimeSpent=0;
+ $sql = "SELECT t.rowid";
+ $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
+ $sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
+ $sql .= " AND t.fk_task =".$object->id;
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ $obj = $db->fetch_object($resql);
+ if ($obj) $nbTimeSpent=1;
+ }
+ else dol_print_error($db);
+
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans("TimeSpent");
+ if ($nbTimeSpent > 0) $head[$h][1].= ' ... ';
$head[$h][2] = 'task_time';
$h++;
@@ -177,7 +192,7 @@ function task_prepare_head($object)
$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
- $nbFiles = count(dol_dir_list($filesdir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($filesdir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][1] = $langs->trans('Documents');
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).' ';
@@ -635,7 +650,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
{
// Thirdparty
- print ' ';
+ print ' ';
$thirdpartystatic->id=$lines[$i]->socid;
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
print $thirdpartystatic->getNomUrl(1, 'project', 10);
@@ -839,10 +854,10 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY))
{
// Thirdparty
- print ' ';
+ print ' ';
$thirdpartystatic->id=$lines[$i]->thirdparty_id;
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
- print $thirdpartystatic->getNomUrl(1, 'project', 10);
+ print $thirdpartystatic->getNomUrl(1, 'project');
print ' ';
}
@@ -919,7 +934,6 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
$tableCell.='';
print $tableCell;
}
- dol_syslog("yyy");
print '';
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject"));
@@ -1135,8 +1149,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
$projectstatic->datee = $db->jdate($objp->datee);
$projectstatic->dateo = $db->jdate($objp->dateo);
- $var=!$var;
- print " ";
+
+ print ' ';
print '';
print $projectstatic->getNomUrl(1);
if (! in_array('projectlabel', $hiddenfields)) print ' '.dol_trunc($objp->title,24);
diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php
index 13fbe06e7d4..f0d42888745 100644
--- a/htdocs/core/lib/propal.lib.php
+++ b/htdocs/core/lib/propal.lib.php
@@ -55,13 +55,6 @@ function propal_prepare_head($object)
$head[$h][2] = 'shipping';
$h++;
}
- if (! empty($conf->global->MAIN_USE_PREVIEW_TABS))
- {
- $head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?id='.$object->id;
- $head[$h][1] = $langs->trans("Preview");
- $head[$h][2] = 'preview';
- $h++;
- }
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
@@ -94,7 +87,7 @@ function propal_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php
index a6c63dc51e4..78cd0af3a12 100644
--- a/htdocs/core/lib/resource.lib.php
+++ b/htdocs/core/lib/resource.lib.php
@@ -70,7 +70,7 @@ function resource_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/resource/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.' ';
diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php
index 2e230ad2302..eaaa90a710e 100644
--- a/htdocs/core/lib/salaries.lib.php
+++ b/htdocs/core/lib/salaries.lib.php
@@ -45,7 +45,7 @@ function salaries_prepare_head($object) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->salaries->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/salaries/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index c20169270bf..7870824285a 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2008-2012 Regis Houssin
+ * Copyright (C) 2008-2017 Regis Houssin
*
* 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
@@ -74,7 +74,7 @@ function dol_decode($chain)
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt.
*
* @param string $chain String to hash
- * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5). Use 3 here, if hash is not needed for security purpose, for security need, prefer 0.
+ * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5, 4:md5 for OpenLdap). Use 3 here, if hash is not needed for security purpose, for security need, prefer 0.
* @return string Hash of string
*/
function dol_hash($chain,$type=0)
@@ -87,6 +87,7 @@ function dol_hash($chain,$type=0)
if ($type == 1) return sha1($chain);
else if ($type == 2) return sha1(md5($chain));
else if ($type == 3) return md5($chain);
+ else if ($type == 4) return '{md5}'.base64_encode(mhash(MHASH_MD5,$chain)); // For OpenLdap with md5
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
@@ -343,7 +344,7 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
* This function is also called by restrictedArea
*
* @param User $user User to check
- * @param array $featuresarray Features/modules to check. Example: ('user','service')
+ * @param array $featuresarray Features/modules to check. Example: ('user','service')
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany modume. Param not used if objectid is null (optional).
* @param string $feature2 Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.
@@ -367,7 +368,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
// For backward compatibility
if ($feature == 'member') $feature='adherent';
-
+
$check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for societe object
$checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...).
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index fc05e2c9194..cadf133169d 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -227,11 +227,11 @@ function dol_loginfunction($langs,$conf,$mysoc)
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
{
- $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small);
+ $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('thumbs/'.$mysoc->logo_small);
}
elseif (! empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo))
{
- $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode($mysoc->logo);
+ $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($mysoc->logo);
$width=128;
}
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'))
diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php
index 488a74b76a3..3455979afbe 100644
--- a/htdocs/core/lib/sendings.lib.php
+++ b/htdocs/core/lib/sendings.lib.php
@@ -233,9 +233,9 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
$var=True;
while ($i < $num)
{
- $var=!$var;
+
$objp = $db->fetch_object($resql);
- print "";
+ print ' ';
// Sending id
print '';
diff --git a/htdocs/core/lib/supplier_proposal.lib.php b/htdocs/core/lib/supplier_proposal.lib.php
index 1e48edcb87d..580fecf0667 100644
--- a/htdocs/core/lib/supplier_proposal.lib.php
+++ b/htdocs/core/lib/supplier_proposal.lib.php
@@ -65,7 +65,7 @@ function supplier_proposal_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->supplier_proposal->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/supplier_proposal/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php
index 0fc401f0280..4764d1bfb65 100644
--- a/htdocs/core/lib/tax.lib.php
+++ b/htdocs/core/lib/tax.lib.php
@@ -55,7 +55,7 @@ function tax_prepare_head(ChargeSociales $object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 1b5fdd69c26..4350edc3797 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -149,7 +149,7 @@ function user_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->user->dir_output . "/" . $object->id;
- $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/user/document.php?userid='.$object->id;
$head[$h][1] = $langs->trans("Documents");
@@ -239,6 +239,11 @@ function user_admin_prepare_head()
$head[$h][2] = 'card';
$h++;
+ $head[$h][0] = DOL_URL_ROOT.'/admin/usergroup.php';
+ $head[$h][1] = $langs->trans("Group");
+ $head[$h][2] = 'usergroupcard';
+ $h++;
+
$head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
@@ -329,25 +334,23 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
$thumbsbyrow=6;
print '';
- $var=false;
-
// Title
if ($foruserprofile)
{
- print ''.$langs->trans("Parameter").' '.$langs->trans("DefaultValue").' ';
+ print ''.$langs->trans("Parameter").' '.$langs->trans("DefaultValue").' ';
print ' ';
print ' ';
- print '';
+ print ' ';
print ''.$langs->trans("DefaultSkin").' ';
print ''.$conf->global->MAIN_THEME.' ';
- print ' '.$langs->trans("UsePersonalValue").' ';
+ print ' '.$langs->trans("UsePersonalValue").' ';
print ' ';
print ' ';
}
else
{
- print ''.$langs->trans("DefaultSkin").' ';
+ print ''.$langs->trans("DefaultSkin").' ';
print '';
$url='https://www.dolistore.com/lang-en/4-skins';
if (preg_match('/fr/i',$langs->defaultlang)) $url='https://www.dolistore.com/fr/4-themes';
@@ -357,7 +360,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '';
print ' ';
- print '';
+ print ' ';
print ''.$langs->trans("ThemeDir").' ';
print '';
foreach($dirthemes as $dirtheme)
@@ -368,8 +371,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print ' ';
}
- //$var=!$var;
- print '';
+ print ' ';
print '';
@@ -405,11 +407,11 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print ' ';
if ($subdir == $selected_theme)
{
- print ' '.$subdir.' ';
+ print ' '.$subdir.' ';
}
else
{
- print ' '.$subdir;
+ print ' '.$subdir;
}
print '
';
@@ -427,8 +429,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
// BackgroundColor
if ($foruserprofile)
{
- /*$var=!$var;
- print '';
+ /*
+ print ' ';
print ''.$langs->trans("TopMenuBackgroundColor").' ';
print ''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).' ';
print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
@@ -450,8 +452,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
}
else
{
- $var=!$var;
- print ' ';
+ print ' ';
print ''.$langs->trans("BackgroundColor").' ';
print '';
//var_dump($conf->global->THEME_ELDY_BACKBODY);
@@ -473,8 +474,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
// TopMenuBackgroundColor
if ($foruserprofile)
{
- /*$var=!$var;
- print ' ';
+ /*
+ print ' ';
print ''.$langs->trans("TopMenuBackgroundColor").' ';
print ''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).' ';
print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
@@ -496,10 +497,10 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
}
else
{
- $default='515870';
- if ($conf->theme == 'md') $default='5A3278';
- $var=!$var;
- print ' ';
+ $default='5a6482';
+ if ($conf->theme == 'md') $default='5a3278';
+
+ print ' ';
print ''.$langs->trans("TopMenuBackgroundColor").' ';
print '';
if ($edit)
@@ -520,8 +521,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
// TopMenuBackgroundColor
if ($foruserprofile)
{
- /*$var=!$var;
- print ' ';
+ /*
+ print ' ';
print ''.$langs->trans("TopMenuBackgroundColor").' ';
print ''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).' ';
print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
@@ -544,8 +545,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else
{
$default=$langs->trans('No');
- $var=!$var;
- print ' ';
+ print ' ';
print ''.$langs->trans("TopMenuDisableImages").' ';
print '';
if ($edit)
@@ -572,8 +572,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
}
else
{
- $var=!$var;
- print ' ';
+ print ' ';
print ''.$langs->trans("BackgroundTableTitleColor").' ';
print '';
if ($edit)
@@ -584,7 +583,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
{
print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default"));
}
- print ' ('.$langs->trans("Default").': e6e6e6 ) ';
+ print ' ('.$langs->trans("Default").': f0f0f0 ) '; // $colorbacktitle1 in CSS
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print ' ';
@@ -599,8 +598,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
}
else
{
- $var=!$var;
- print ' ';
+ print ' ';
print ''.$langs->trans("TextTitleColor").' ';
print '';
if ($edit)
@@ -622,8 +620,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
// Text LinkColor
if ($foruserprofile)
{
- /*$var=!$var;
- print ' ';
+ /*
+ print ' ';
print ''.$langs->trans("TopMenuBackgroundColor").' ';
print ''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).' ';
print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
@@ -645,8 +643,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
}
else
{
- $var=!$var;
- print ' ';
+ print ' ';
print ''.$langs->trans("LinkColor").' ';
print '';
if ($edit)
@@ -665,11 +662,10 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
}
// Use Hover
- $var=!$var;
if ($foruserprofile)
{
/* Must first change option to choose color of highlight instead of yes or no.
- print ' ';
+ print ' ';
print ''.$langs->trans("HighlightLinesOnMouseHover").' ';
print ' global->THEME_ELDY_USE_HOVER?" checked":"").'> ';
print ' '.$langs->trans("UsePersonalValue").' ';
@@ -681,7 +677,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
}
else
{
- print ' ';
+ print ' ';
print ''.$langs->trans("HighlightLinesColor").' ';
print '';
//print ' ';
diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php
index ee162bd9cc8..daf82b2f995 100644
--- a/htdocs/core/login/functions_dolibarr.php
+++ b/htdocs/core/login/functions_dolibarr.php
@@ -47,7 +47,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
{
dol_syslog("functions_dolibarr::check_user_password_dolibarr usertotest=".$usertotest." passwordtotest=".preg_replace('/./','*',$passwordtotest)." entitytotest=".$entitytotest);
- // If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
+ // If test username/password asked, we define $test=false if ko and $login var to login if ok, set also $_SESSION["dol_loginmesg"] if ko
$table = MAIN_DB_PREFIX."user";
$usernamecol1 = 'login';
$usernamecol2 = 'email';
@@ -59,6 +59,9 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
if (preg_match('/@/',$usertotest)) $sql.=' OR '.$usernamecol2." = '".$db->escape($usertotest)."'";
$sql.=') AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")";
$sql.=' AND statut = 1';
+ // Required to first found the user into entity, then the superadmin.
+ // For the case (TODO and that we must avoid) a user has renamed its login with same value than a user in entity 0.
+ $sql.=' ORDER BY entity DESC';
$resql=$db->query($sql);
if ($resql)
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 59886b99f63..54cddfcaa96 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -68,14 +68,14 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 403__+MAX_llx_menu__, '/user/group/card.php?leftmenu=users&action=create', 'NewGroup', 2, 'users', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin', '', 2, 0, __ENTITY__);
-- Third parties
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/soc.php?action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/soc.php?leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/card.php?leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/soc.php?leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/card.php?leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?type=c&leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/soc.php?leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/card.php?leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
-- Third parties - Contacts
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/card.php?leftmenu=contacts&action=create', 'NewContactAddress', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
@@ -171,7 +171,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__);
-- Accountancy - Customer invoice
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__);
@@ -281,20 +281,13 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects', 'Projects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
-
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3610__+MAX_llx_menu__, 'project', 'myprojects', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3611__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&action=create&mode=mine', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3612__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3703__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3800__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects&mode=mine', 'MyActivities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects&mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-- Project - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3200__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index 2c2d2c5ec63..e95359e5683 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/htdocs/core/menus/standard/auguria.lib.php
@@ -257,7 +257,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
{
- $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini);
+ $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('thumbs/'.$mysoc->logo_mini);
}
else
{
diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php
index 5402ac5bbd1..4b19ffd5f3b 100644
--- a/htdocs/core/menus/standard/auguria_menu.php
+++ b/htdocs/core/menus/standard/auguria_menu.php
@@ -150,8 +150,8 @@ class MenuManager
print ''."\n";
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
{
- print '