Merge branch 'develop' into VATGrouped
This commit is contained in:
commit
b554ca2b73
@ -4,10 +4,12 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
|
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
|
||||||
For Users:
|
For Users:
|
||||||
NEW: Module ticket is available as a stable module
|
NEW: Module Ticket is available as a stable module.
|
||||||
NEW: Experimental module "Vendor receptions"
|
NEW: Experimental module "Vendor receptions".
|
||||||
|
NEW: Experimental module "BOM".
|
||||||
|
|
||||||
For Developers:
|
For Developers:
|
||||||
|
NEW: Module DebugBar is available as a stable module.
|
||||||
|
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
@ -21,6 +23,7 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* All methods set_draft() were renamed into setDraft().
|
* All methods set_draft() were renamed into setDraft().
|
||||||
* Removed deprecated function function test_sql_and_script_inject that was replaced with testSqlAndScriptInject.
|
* Removed deprecated function function test_sql_and_script_inject that was replaced with testSqlAndScriptInject.
|
||||||
* Method load_measuring_units were renamed into selectMeasuringUnits and select_measuring_units was deprecated.
|
* Method load_measuring_units were renamed into selectMeasuringUnits and select_measuring_units was deprecated.
|
||||||
|
* Hidden option CHANGE_ORDER_CONCAT_DESCRIPTION were renamed into MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 9.0.1 compared to 9.0.0 *****
|
***** ChangeLog for 9.0.1 compared to 9.0.0 *****
|
||||||
|
|||||||
@ -284,7 +284,7 @@ $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfiel
|
|||||||
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
|
|
||||||
// Line for filters fields
|
// Line for filters fields
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -47,8 +47,9 @@ if ($action == 'set')
|
|||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$result = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOST('DEBUGBAR_LOGS_LINES_NUMBER', 'int'), 'chaine', 0, '', 0);
|
$result1 = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOST('DEBUGBAR_LOGS_LINES_NUMBER', 'int'), 'chaine', 0, '', 0);
|
||||||
if ($result < 0)
|
$result2 = dolibarr_set_const($db, "DEBUGBAR_USE_LOG_FILE", GETPOST('DEBUGBAR_USE_LOG_FILE', 'int'), 'chaine', 0, '', 0);
|
||||||
|
if ($result1 < 0 || $result2 < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -61,7 +62,7 @@ if ($action == 'set')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($error, $errors, 'errors');
|
setEventMessages($error, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +97,12 @@ print '<td colspan="2"><input type="text" class="flat" name="DEBUGBAR_LOGS_LINES
|
|||||||
print ' '.$langs->trans("WarningValueHigherSlowsDramaticalyOutput");
|
print ' '.$langs->trans("WarningValueHigherSlowsDramaticalyOutput");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("DEBUGBAR_USE_LOG_FILE").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $form->selectyesno('DEBUGBAR_USE_LOG_FILE', $conf->global->DEBUGBAR_USE_LOG_FILE, 1);
|
||||||
|
print ' '.$langs->trans("UsingLogFileShowAllRecordOfSubrequestButIsSlower");
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
|||||||
@ -207,7 +207,7 @@ else
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("DefaultValues"), $enabledisablehtml, 'title_setup');
|
print load_fiche_titre($langs->trans("DefaultValues"), $enabledisablehtml, 'title_setup');
|
||||||
|
|
||||||
print $langs->trans("DefaultValuesDesc")."<br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("DefaultValuesDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
|
|||||||
@ -217,7 +217,7 @@ $formadmin=new FormAdmin($db);
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
|
||||||
|
|
||||||
print $langs->trans("DisplayDesc")."<br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("DisplayDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,11 +37,11 @@ $hookmanager->initHooks(array('homesetup'));
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
$wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
|
$wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
|
||||||
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("SetupArea"), '', 'title_setup.png');
|
print load_fiche_titre($langs->trans("SetupArea"), '', 'title_setup.png');
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print $langs->trans("SetupDescription1").' ';
|
print $langs->trans("SetupDescription1");
|
||||||
print $langs->trans("AreaForAdminOnly").' ';
|
print $langs->trans("AreaForAdminOnly").' ';
|
||||||
print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."<br><br>";
|
print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."<br><br>";
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ print $hookmanager->resPrint;
|
|||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
// Show into other
|
// Show into other
|
||||||
print $langs->trans("SetupDescription5")."<br>";
|
print '<span class="opacitymedium">'.$langs->trans("SetupDescription5")."</span><br>";
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
// Show logo
|
// Show logo
|
||||||
|
|||||||
@ -115,7 +115,7 @@ $arraydetailsforpdffoot = array(
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("PDF"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("PDF"), '', 'title_setup');
|
||||||
|
|
||||||
print $langs->trans("PDFDesc")."<br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("PDFDesc")."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$noCountryCode = (empty($mysoc->country_code) ? true : false);
|
$noCountryCode = (empty($mysoc->country_code) ? true : false);
|
||||||
|
|||||||
@ -224,9 +224,7 @@ else
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("Translation"), $enabledisablehtml, 'title_setup');
|
print load_fiche_titre($langs->trans("Translation"), $enabledisablehtml, 'title_setup');
|
||||||
|
|
||||||
//print '<span class="opacitymedium">';
|
print '<span class="opacitymedium">'.$langs->trans("TranslationDesc")."</span><br>\n";
|
||||||
print $langs->trans("TranslationDesc")."<br>\n";
|
|
||||||
//print '</span>';
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$current_language_code=$langs->defaultlang;
|
$current_language_code=$langs->defaultlang;
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if (empty($reshook))
|
|||||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
// conditions de reglement
|
// terms of the settlement
|
||||||
if ($action == 'setconditions' && $user->rights->societe->creer)
|
if ($action == 'setconditions' && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
@ -317,7 +317,7 @@ if ($object->id > 0)
|
|||||||
print $object->tva_intra;
|
print $object->tva_intra;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Conditions de reglement par defaut
|
// default terms of the settlement
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||||
|
|||||||
@ -1039,7 +1039,8 @@ if (empty($reshook))
|
|||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
$desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc;
|
||||||
|
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
// Add dimensions into product description
|
// Add dimensions into product description
|
||||||
/*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM))
|
/*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM))
|
||||||
|
|||||||
7
htdocs/commande/card.php
Normal file → Executable file
7
htdocs/commande/card.php
Normal file → Executable file
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2019 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||||
@ -868,7 +868,8 @@ if (empty($reshook))
|
|||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
$desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc;
|
||||||
|
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
// Add custom code and origin country into description
|
// Add custom code and origin country into description
|
||||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
||||||
@ -1674,7 +1675,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
print $form->selectDate($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1);
|
print $form->selectDate($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Conditions de reglement
|
// terms of the settlement
|
||||||
print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
|
print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
|
||||||
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1);
|
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
|||||||
3
htdocs/compta/facture/card.php
Normal file → Executable file
3
htdocs/compta/facture/card.php
Normal file → Executable file
@ -1844,7 +1844,8 @@ if (empty($reshook))
|
|||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
$desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc;
|
||||||
|
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
// Add custom code and origin country into description
|
// Add custom code and origin country into description
|
||||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -540,7 +540,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$desc=$prod->description;
|
$desc=$prod->description;
|
||||||
$desc=dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
$desc=dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
$fk_unit = $prod->fk_unit;
|
$fk_unit = $prod->fk_unit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -616,6 +616,12 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
|
|||||||
for ($i=0;$i<$num;$i++)
|
for ($i=0;$i<$num;$i++)
|
||||||
{
|
{
|
||||||
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
||||||
|
// If we build one invoice for several order, we must put the invoice of order on the line
|
||||||
|
if (! empty($createbills_onebythird))
|
||||||
|
{
|
||||||
|
$desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs));
|
||||||
|
}
|
||||||
|
|
||||||
if ($lines[$i]->subprice < 0)
|
if ($lines[$i]->subprice < 0)
|
||||||
{
|
{
|
||||||
// Negative line, we create a discount line
|
// Negative line, we create a discount line
|
||||||
|
|||||||
@ -598,6 +598,7 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
// 2 : application de la règle, le N du mois courant ou suivant
|
// 2 : application de la règle, le N du mois courant ou suivant
|
||||||
elseif ($cdr_type == 2 && !empty($cdr_decalage))
|
elseif ($cdr_type == 2 && !empty($cdr_decalage))
|
||||||
{
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
$datelim = $this->date + ($cdr_nbjour * 3600 * 24);
|
$datelim = $this->date + ($cdr_nbjour * 3600 * 24);
|
||||||
|
|
||||||
$date_piece = dol_mktime(0, 0, 0, date('m', $datelim), date('d', $datelim), date('Y', $datelim)); // Sans les heures minutes et secondes
|
$date_piece = dol_mktime(0, 0, 0, date('m', $datelim), date('d', $datelim), date('Y', $datelim)); // Sans les heures minutes et secondes
|
||||||
|
|||||||
@ -1653,7 +1653,7 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
elseif ($type == 'phone')
|
elseif ($type == 'phone')
|
||||||
{
|
{
|
||||||
$value=dol_print_phone($value, '', 0, 0, '', ' ', 1);
|
$value=dol_print_phone($value, '', 0, 0, '', ' ', 'phone');
|
||||||
}
|
}
|
||||||
elseif ($type == 'price')
|
elseif ($type == 'price')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6610,7 +6610,11 @@ class Form
|
|||||||
// Can complete the possiblelink array
|
// Can complete the possiblelink array
|
||||||
$hookmanager->initHooks(array('commonobject'));
|
$hookmanager->initHooks(array('commonobject'));
|
||||||
$parameters=array('listofidcompanytoscan' => $listofidcompanytoscan);
|
$parameters=array('listofidcompanytoscan' => $listofidcompanytoscan);
|
||||||
$reshook=$hookmanager->executeHooks('showLinkToObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
||||||
|
if (! empty($listofidcompanytoscan)) // If empty, we don't have criteria to scan the object we can link to
|
||||||
|
{
|
||||||
|
$reshook=$hookmanager->executeHooks('showLinkToObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1044,7 +1044,7 @@ class FormFile
|
|||||||
* @param int $disablemove 1=Disable move button, 0=Position move is possible.
|
* @param int $disablemove 1=Disable move button, 0=Position move is possible.
|
||||||
* @param int $addfilterfields Add line with filters
|
* @param int $addfilterfields Add line with filters
|
||||||
* @return int <0 if KO, nb of files shown if OK
|
* @return int <0 if KO, nb of files shown if OK
|
||||||
* @see list_of_autoecmfiles
|
* @see list_of_autoecmfiles()
|
||||||
*/
|
*/
|
||||||
public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0)
|
public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -572,12 +572,13 @@ class Utils
|
|||||||
*/
|
*/
|
||||||
public function generateDoc($module)
|
public function generateDoc($module)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user, $mysoc;
|
||||||
global $dirins;
|
global $dirins;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$modulelowercase=strtolower($module);
|
$modulelowercase=strtolower($module);
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
// Dir for module
|
// Dir for module
|
||||||
$dir = $dirins.'/'.$modulelowercase;
|
$dir = $dirins.'/'.$modulelowercase;
|
||||||
@ -688,16 +689,16 @@ class Utils
|
|||||||
|
|
||||||
//var_dump($phpfileval['fullname']);
|
//var_dump($phpfileval['fullname']);
|
||||||
$arrayreplacement=array(
|
$arrayreplacement=array(
|
||||||
'mymodule'=>strtolower($modulename),
|
'mymodule'=>strtolower($module),
|
||||||
'MyModule'=>$modulename,
|
'MyModule'=>$module,
|
||||||
'MYMODULE'=>strtoupper($modulename),
|
'MYMODULE'=>strtoupper($module),
|
||||||
'My module'=>$modulename,
|
'My module'=>$module,
|
||||||
'my module'=>$modulename,
|
'my module'=>$module,
|
||||||
'Mon module'=>$modulename,
|
'Mon module'=>$module,
|
||||||
'mon module'=>$modulename,
|
'mon module'=>$module,
|
||||||
'htdocs/modulebuilder/template'=>strtolower($modulename),
|
'htdocs/modulebuilder/template'=>strtolower($module),
|
||||||
'__MYCOMPANY_NAME__'=>$mysoc->name,
|
'__MYCOMPANY_NAME__'=>$mysoc->name,
|
||||||
'__KEYWORDS__'=>$modulename,
|
'__KEYWORDS__'=>$module,
|
||||||
'__USER_FULLNAME__'=>$user->getFullName($langs),
|
'__USER_FULLNAME__'=>$user->getFullName($langs),
|
||||||
'__USER_EMAIL__'=>$user->email,
|
'__USER_EMAIL__'=>$user->email,
|
||||||
'__YYYY-MM-DD__'=>dol_print_date($now, 'dayrfc'),
|
'__YYYY-MM-DD__'=>dol_print_date($now, 'dayrfc'),
|
||||||
|
|||||||
@ -161,7 +161,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @param string $name name of database (not used for mysql, used for pgsql)
|
* @param string $name name of database (not used for mysql, used for pgsql)
|
||||||
* @param int $port Port of database server
|
* @param int $port Port of database server
|
||||||
* @return false|resource|true Database access handler
|
* @return false|resource|true Database access handler
|
||||||
* @see close
|
* @see close()
|
||||||
*/
|
*/
|
||||||
public function connect($host, $login, $passwd, $name, $port = 0)
|
public function connect($host, $login, $passwd, $name, $port = 0)
|
||||||
{
|
{
|
||||||
@ -216,7 +216,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
* Close database connexion
|
* Close database connexion
|
||||||
*
|
*
|
||||||
* @return bool True if disconnect successfull, false otherwise
|
* @return bool True if disconnect successfull, false otherwise
|
||||||
* @see connect
|
* @see connect()
|
||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
@ -511,7 +511,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
*
|
*
|
||||||
* @param resource $resultset Resulset of requests
|
* @param resource $resultset Resulset of requests
|
||||||
* @return int Nb of lines
|
* @return int Nb of lines
|
||||||
* @see affected_rows
|
* @see affected_rows()
|
||||||
*/
|
*/
|
||||||
public function num_rows($resultset)
|
public function num_rows($resultset)
|
||||||
{
|
{
|
||||||
@ -527,7 +527,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
*
|
*
|
||||||
* @param resource $resultset Curseur de la requete voulue
|
* @param resource $resultset Curseur de la requete voulue
|
||||||
* @return int Nombre de lignes
|
* @return int Nombre de lignes
|
||||||
* @see num_rows
|
* @see num_rows()
|
||||||
*/
|
*/
|
||||||
public function affected_rows($resultset)
|
public function affected_rows($resultset)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -191,7 +191,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
* @param string $name name of database (not used for mysql, used for pgsql)
|
* @param string $name name of database (not used for mysql, used for pgsql)
|
||||||
* @param integer $port Port of database server
|
* @param integer $port Port of database server
|
||||||
* @return mysqli Database access object
|
* @return mysqli Database access object
|
||||||
* @see close
|
* @see close()
|
||||||
*/
|
*/
|
||||||
public function connect($host, $login, $passwd, $name, $port = 0)
|
public function connect($host, $login, $passwd, $name, $port = 0)
|
||||||
{
|
{
|
||||||
@ -228,7 +228,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
* Close database connexion
|
* Close database connexion
|
||||||
*
|
*
|
||||||
* @return bool True if disconnect successfull, false otherwise
|
* @return bool True if disconnect successfull, false otherwise
|
||||||
* @see connect
|
* @see connect()
|
||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
@ -280,6 +280,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
|
|
||||||
if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously
|
if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously
|
||||||
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);
|
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);
|
||||||
|
//var_dump(debug_print_backtrace());
|
||||||
}
|
}
|
||||||
$this->lastquery=$query;
|
$this->lastquery=$query;
|
||||||
$this->_results = $ret;
|
$this->_results = $ret;
|
||||||
@ -324,7 +325,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
* Return datas as an array
|
* Return datas as an array
|
||||||
*
|
*
|
||||||
* @param mysqli_result $resultset Resultset of request
|
* @param mysqli_result $resultset Resultset of request
|
||||||
* @return array|null|0 Array or null if KO or end of cursor or 0 if resultset is bool
|
* @return array|null|int Array or null if KO or end of cursor or 0 if resultset is bool
|
||||||
*/
|
*/
|
||||||
public function fetch_row($resultset)
|
public function fetch_row($resultset)
|
||||||
{
|
{
|
||||||
@ -348,7 +349,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
*
|
*
|
||||||
* @param mysqli_result $resultset Resulset of requests
|
* @param mysqli_result $resultset Resulset of requests
|
||||||
* @return int Nb of lines
|
* @return int Nb of lines
|
||||||
* @see affected_rows
|
* @see affected_rows()
|
||||||
*/
|
*/
|
||||||
public function num_rows($resultset)
|
public function num_rows($resultset)
|
||||||
{
|
{
|
||||||
@ -364,7 +365,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
*
|
*
|
||||||
* @param mysqli_result $resultset Curseur de la requete voulue
|
* @param mysqli_result $resultset Curseur de la requete voulue
|
||||||
* @return int Nombre de lignes
|
* @return int Nombre de lignes
|
||||||
* @see num_rows
|
* @see num_rows()
|
||||||
*/
|
*/
|
||||||
public function affected_rows($resultset)
|
public function affected_rows($resultset)
|
||||||
{
|
{
|
||||||
@ -952,7 +953,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
* Note: if we are connected to databasename, it is same result than using SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "databasename";)
|
* Note: if we are connected to databasename, it is same result than using SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "databasename";)
|
||||||
*
|
*
|
||||||
* @return string Charset
|
* @return string Charset
|
||||||
* @see getDefaultCollationDatabase
|
* @see getDefaultCollationDatabase()
|
||||||
*/
|
*/
|
||||||
public function getDefaultCharacterSetDatabase()
|
public function getDefaultCharacterSetDatabase()
|
||||||
{
|
{
|
||||||
@ -998,7 +999,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
* Return collation used in current database
|
* Return collation used in current database
|
||||||
*
|
*
|
||||||
* @return string Collation value
|
* @return string Collation value
|
||||||
* @see getDefaultCharacterSetDatabase
|
* @see getDefaultCharacterSetDatabase()
|
||||||
*/
|
*/
|
||||||
public function getDefaultCollationDatabase()
|
public function getDefaultCollationDatabase()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -396,7 +396,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
* @param string $name Name of database (not used for mysql, used for pgsql)
|
* @param string $name Name of database (not used for mysql, used for pgsql)
|
||||||
* @param integer $port Port of database server
|
* @param integer $port Port of database server
|
||||||
* @return false|resource Database access handler
|
* @return false|resource Database access handler
|
||||||
* @see close
|
* @see close()
|
||||||
*/
|
*/
|
||||||
public function connect($host, $login, $passwd, $name, $port = 0)
|
public function connect($host, $login, $passwd, $name, $port = 0)
|
||||||
{
|
{
|
||||||
@ -471,7 +471,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
* Close database connexion
|
* Close database connexion
|
||||||
*
|
*
|
||||||
* @return boolean True if disconnect successfull, false otherwise
|
* @return boolean True if disconnect successfull, false otherwise
|
||||||
* @see connect
|
* @see connect()
|
||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
@ -605,7 +605,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
*
|
*
|
||||||
* @param resourse $resultset Resulset of requests
|
* @param resourse $resultset Resulset of requests
|
||||||
* @return int Nb of lines, -1 on error
|
* @return int Nb of lines, -1 on error
|
||||||
* @see affected_rows
|
* @see affected_rows()
|
||||||
*/
|
*/
|
||||||
public function num_rows($resultset)
|
public function num_rows($resultset)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -321,7 +321,7 @@ class DoliDBSqlite3 extends DoliDB
|
|||||||
* @param string $name name of database (not used for mysql, used for pgsql)
|
* @param string $name name of database (not used for mysql, used for pgsql)
|
||||||
* @param integer $port Port of database server
|
* @param integer $port Port of database server
|
||||||
* @return SQLite3 Database access handler
|
* @return SQLite3 Database access handler
|
||||||
* @see close
|
* @see close()
|
||||||
*/
|
*/
|
||||||
public function connect($host, $login, $passwd, $name, $port = 0)
|
public function connect($host, $login, $passwd, $name, $port = 0)
|
||||||
{
|
{
|
||||||
@ -377,7 +377,7 @@ class DoliDBSqlite3 extends DoliDB
|
|||||||
* Close database connexion
|
* Close database connexion
|
||||||
*
|
*
|
||||||
* @return bool True if disconnect successfull, false otherwise
|
* @return bool True if disconnect successfull, false otherwise
|
||||||
* @see connect
|
* @see connect()
|
||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
@ -557,7 +557,7 @@ class DoliDBSqlite3 extends DoliDB
|
|||||||
*
|
*
|
||||||
* @param SQLite3Result $resultset Resulset of requests
|
* @param SQLite3Result $resultset Resulset of requests
|
||||||
* @return int Nb of lines
|
* @return int Nb of lines
|
||||||
* @see affected_rows
|
* @see affected_rows()
|
||||||
*/
|
*/
|
||||||
public function num_rows($resultset)
|
public function num_rows($resultset)
|
||||||
{
|
{
|
||||||
@ -578,7 +578,7 @@ class DoliDBSqlite3 extends DoliDB
|
|||||||
*
|
*
|
||||||
* @param SQLite3Result $resultset Resulset of requests
|
* @param SQLite3Result $resultset Resulset of requests
|
||||||
* @return int Nb of lines
|
* @return int Nb of lines
|
||||||
* @see affected_rows
|
* @see affected_rows()
|
||||||
*/
|
*/
|
||||||
public function affected_rows($resultset)
|
public function affected_rows($resultset)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1823,24 +1823,27 @@ function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
|
|||||||
* @param string $fileinput Input file name
|
* @param string $fileinput Input file name
|
||||||
* @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided).
|
* @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided).
|
||||||
* @param string $fileoutput Output filename
|
* @param string $fileoutput Output filename
|
||||||
|
* @param string $page Page number if we convert a PDF into png
|
||||||
* @return int <0 if KO, 0=Nothing done, >0 if OK
|
* @return int <0 if KO, 0=Nothing done, >0 if OK
|
||||||
*/
|
*/
|
||||||
function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '')
|
function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if (class_exists('Imagick'))
|
if (class_exists('Imagick'))
|
||||||
{
|
{
|
||||||
$image=new Imagick();
|
$image=new Imagick();
|
||||||
try {
|
try {
|
||||||
$ret = $image->readImage($fileinput);
|
$filetoconvert=$fileinput.(($page != '')?'['.$page.']':'');
|
||||||
|
//var_dump($filetoconvert);
|
||||||
|
$ret = $image->readImage($filetoconvert);
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
dol_syslog("Failed to read image using Imagick. Try to install package 'apt-get install ghostscript'.", LOG_WARNING);
|
$ext = pathinfo($fileinput, PATHINFO_EXTENSION);
|
||||||
|
dol_syslog("Failed to read image using Imagick (Try to install package 'apt-get install php-imagick ghostscript' and check there is no policy to disable ".$ext." convertion in /etc/ImageMagick*/policy.xml): ".$e->getMessage(), LOG_WARNING);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ($ret)
|
if ($ret)
|
||||||
{
|
{
|
||||||
$ret = $image->setImageFormat($ext);
|
$ret = $image->setImageFormat($ext);
|
||||||
if ($ret)
|
if ($ret)
|
||||||
{
|
{
|
||||||
if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext;
|
if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext;
|
||||||
|
|||||||
@ -982,7 +982,7 @@ function dol_strtoupper($utf8_string)
|
|||||||
*/
|
*/
|
||||||
function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = '', $restricttologhandler = '')
|
function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = '', $restricttologhandler = '')
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user, $debugbar;
|
||||||
|
|
||||||
// If syslog module enabled
|
// If syslog module enabled
|
||||||
if (empty($conf->syslog->enabled)) return;
|
if (empty($conf->syslog->enabled)) return;
|
||||||
@ -998,8 +998,8 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||||||
if (! empty($message))
|
if (! empty($message))
|
||||||
{
|
{
|
||||||
// Test log level
|
// Test log level
|
||||||
$logLevels = array(LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG);
|
$logLevels = array(LOG_EMERG=>'EMERG', LOG_ALERT=>'ALERT', LOG_CRIT=>'CRITICAL', LOG_ERR=>'ERR', LOG_WARNING=>'WARN', LOG_NOTICE=>'NOTICE', LOG_INFO=>'INFO', LOG_DEBUG=>'DEBUG');
|
||||||
if (!in_array($level, $logLevels, true))
|
if (! array_key_exists($level, $logLevels))
|
||||||
{
|
{
|
||||||
throw new Exception('Incorrect log level');
|
throw new Exception('Incorrect log level');
|
||||||
}
|
}
|
||||||
@ -1008,9 +1008,10 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||||||
$message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
$message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
||||||
|
|
||||||
// If adding log inside HTML page is required
|
// If adding log inside HTML page is required
|
||||||
if (! empty($_REQUEST['logtohtml']) && (! empty($conf->global->MAIN_ENABLE_LOG_TO_HTML) || ! empty($conf->global->MAIN_LOGTOHTML))) // MAIN_LOGTOHTML kept for backward compatibility
|
if ((! empty($_REQUEST['logtohtml']) && ! empty($conf->global->MAIN_ENABLE_LOG_TO_HTML))
|
||||||
|
|| (! empty($user->rights->debugbar->read) && is_object($debugbar)))
|
||||||
{
|
{
|
||||||
$conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".$message;
|
$conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".$logLevels[$level]." ".$message;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output
|
//TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output
|
||||||
@ -1381,53 +1382,46 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||||||
|
|
||||||
$filepath = $dir_output . $subdir . "/";
|
$filepath = $dir_output . $subdir . "/";
|
||||||
|
|
||||||
$file = $filepath . $objectref . ".pdf";
|
$filepdf = $filepath . $objectref . ".pdf";
|
||||||
$relativepath = $subdir.'/'.$objectref.'.pdf';
|
$relativepath = $subdir.'/'.$objectref.'.pdf';
|
||||||
|
|
||||||
// Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
|
// Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
|
||||||
$fileimage = $file.'_preview.png'; // If PDF has 1 page
|
$fileimage = $filepdf.'_preview.png';
|
||||||
$fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page
|
|
||||||
$relativepathimage = $relativepath.'_preview.png';
|
$relativepathimage = $relativepath.'_preview.png';
|
||||||
|
|
||||||
// Si fichier PDF existe
|
$pdfexists = file_exists($filepdf);
|
||||||
if (file_exists($file))
|
|
||||||
|
// If PDF file exists
|
||||||
|
if ($pdfexists)
|
||||||
{
|
{
|
||||||
$encfile = urlencode($file);
|
|
||||||
// Conversion du PDF en image png si fichier png non existant
|
// Conversion du PDF en image png si fichier png non existant
|
||||||
if ( (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($file)))
|
if (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf)))
|
||||||
&& (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file)))
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here.
|
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experience trouble with pdf thumb generation and imagick, you can disable here.
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$ret = dol_convert_file($file, 'png', $fileimage);
|
$ret = dol_convert_file($filepdf, 'png', $fileimage, '0'); // Convert first page of PDF into a file _preview.png
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pdfexists && ! $error)
|
||||||
|
{
|
||||||
$heightforphotref=70;
|
$heightforphotref=70;
|
||||||
if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60;
|
if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60;
|
||||||
// Si fichier png PDF d'1 page trouve
|
// If the preview file is found
|
||||||
if (file_exists($fileimage))
|
if (file_exists($fileimage))
|
||||||
{
|
{
|
||||||
$phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
|
$phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
|
||||||
$phototoshow.= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($relativepathimage).'">';
|
$phototoshow.= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($relativepathimage).'">';
|
||||||
$phototoshow.= '</div></div>';
|
$phototoshow.= '</div></div>';
|
||||||
}
|
}
|
||||||
// Si fichier png PDF de plus d'1 page trouve
|
|
||||||
elseif (file_exists($fileimagebis))
|
|
||||||
{
|
|
||||||
$preview = preg_replace('/\.png/', '', $relativepathimage) . "-0.png";
|
|
||||||
$phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
|
|
||||||
$phototoshow.= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($preview).'"><p>';
|
|
||||||
$phototoshow.= '</div></div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (! $phototoshow)
|
elseif (! $phototoshow)
|
||||||
{
|
{
|
||||||
$phototoshow = $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos);
|
$phototoshow.= $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($phototoshow)
|
if ($phototoshow)
|
||||||
@ -1440,7 +1434,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||||||
|
|
||||||
if (! $phototoshow) // Show No photo link (picto of pbject)
|
if (! $phototoshow) // Show No photo link (picto of pbject)
|
||||||
{
|
{
|
||||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
|
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
|
||||||
if ($object->element == 'action')
|
if ($object->element == 'action')
|
||||||
{
|
{
|
||||||
$width=80;
|
$width=80;
|
||||||
@ -5760,7 +5754,7 @@ function dol_textishtml($msg, $option = 0)
|
|||||||
* @param string $text1 Text 1
|
* @param string $text1 Text 1
|
||||||
* @param string $text2 Text 2
|
* @param string $text2 Text 2
|
||||||
* @param bool $forxml false=Use <br>instead of \n if html content detected, true=Use <br /> instead of \n if html content detected
|
* @param bool $forxml false=Use <br>instead of \n if html content detected, true=Use <br /> instead of \n if html content detected
|
||||||
* @param bool $invert invert order of description lines if CONF CHANGE_ORDER_CONCAT_DESCRIPTION is active
|
* @param bool $invert invert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter)
|
||||||
* @return string Text 1 + new line + Text2
|
* @return string Text 1 + new line + Text2
|
||||||
* @see dol_textishtml()
|
* @see dol_textishtml()
|
||||||
*/
|
*/
|
||||||
@ -7164,7 +7158,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
|
|||||||
*/
|
*/
|
||||||
function printCommonFooter($zone = 'private')
|
function printCommonFooter($zone = 'private')
|
||||||
{
|
{
|
||||||
global $conf, $hookmanager, $user;
|
global $conf, $hookmanager, $user, $debugbar;
|
||||||
global $action;
|
global $action;
|
||||||
global $micro_start_time;
|
global $micro_start_time;
|
||||||
|
|
||||||
@ -7328,11 +7322,17 @@ function printCommonFooter($zone = 'private')
|
|||||||
// Add Xdebug coverage of code
|
// Add Xdebug coverage of code
|
||||||
if (defined('XDEBUGCOVERAGE'))
|
if (defined('XDEBUGCOVERAGE'))
|
||||||
{
|
{
|
||||||
print_r(xdebug_get_code_coverage());
|
print_r(xdebug_get_code_coverage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is some logs in buffer to show
|
// Add DebugBar data
|
||||||
if (count($conf->logbuffer))
|
if (! empty($user->rights->debugbar->read) && is_object($debugbar))
|
||||||
|
{
|
||||||
|
$debugbar['time']->stopMeasure('pageaftermaster');
|
||||||
|
print '<!-- Output debugbar data -->'."\n";
|
||||||
|
print $debugbar->getRenderer()->render();
|
||||||
|
}
|
||||||
|
elseif (count($conf->logbuffer)) // If there is some logs in buffer to show
|
||||||
{
|
{
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Start of log output\n";
|
print "<!-- Start of log output\n";
|
||||||
|
|||||||
@ -207,7 +207,7 @@ function dol_print_object_info($object, $usetable = 0)
|
|||||||
$deltadateforuser=round($deltadateforclient-$deltadateforserver);
|
$deltadateforuser=round($deltadateforclient-$deltadateforserver);
|
||||||
//print "x".$deltadateforserver." - ".$deltadateforclient." - ".$deltadateforuser;
|
//print "x".$deltadateforserver." - ".$deltadateforclient." - ".$deltadateforuser;
|
||||||
|
|
||||||
if ($usetable) print '<table class="border centpercent">';
|
if ($usetable) print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
// Import key
|
// Import key
|
||||||
if (! empty($object->import_key))
|
if (! empty($object->import_key))
|
||||||
|
|||||||
@ -33,7 +33,7 @@ $quality = 80;
|
|||||||
* Return if a filename is file name of a supported image format
|
* Return if a filename is file name of a supported image format
|
||||||
*
|
*
|
||||||
* @param string $file Filename
|
* @param string $file Filename
|
||||||
* @return int -1=Not image filename, 0=Image filename but format not supported by PHP, 1=Image filename with format supported
|
* @return int -1=Not image filename, 0=Image filename but format not supported by PHP, 1=Image filename with format supported by this PHP
|
||||||
*/
|
*/
|
||||||
function image_format_supported($file)
|
function image_format_supported($file)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -104,7 +104,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->product->enabled', __HANDLER__, 'left', 2800__+MAX_llx_menu__, 'products', 'product', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=product&type=0', 'Products', 0, 'products', '$user->rights->produit->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->product->enabled', __HANDLER__, 'left', 2800__+MAX_llx_menu__, 'products', 'product', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=product&type=0', 'Products', 0, 'products', '$user->rights->produit->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->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->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->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->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->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=product&type=0', 'List', 1, 'products', '$user->rights->produit->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->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=product&type=0', 'List', 1, 'products', '$user->rights->produit->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->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&type=0', 'Stocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->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->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->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->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->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->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->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->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __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->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__);
|
||||||
|
|
||||||
|
|||||||
@ -1500,7 +1500,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
$newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
|
$newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
|
||||||
if (! empty($conf->stock->enabled))
|
if (! empty($conf->stock->enabled))
|
||||||
{
|
{
|
||||||
$newmenu->add("/product/reassort.php?type=0", $langs->trans("Stocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
|
$newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
|
||||||
}
|
}
|
||||||
if (! empty($conf->productbatch->enabled))
|
if (! empty($conf->productbatch->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -54,18 +54,7 @@ class modDebugBar extends DolibarrModules
|
|||||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||||
$this->picto='technic';
|
$this->picto='technic';
|
||||||
|
|
||||||
$this->module_parts = array(
|
$this->module_parts = array('moduleforexternal' => 0);
|
||||||
// Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
|
|
||||||
'hooks' => array(
|
|
||||||
'data' => array(
|
|
||||||
'main',
|
|
||||||
'login',
|
|
||||||
),
|
|
||||||
'entity' => '0',
|
|
||||||
),
|
|
||||||
// Set this to 1 if feature of module are opened to external users
|
|
||||||
'moduleforexternal' => 0,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Data directories to create when module is enabled
|
// Data directories to create when module is enabled
|
||||||
$this->dirs = array();
|
$this->dirs = array();
|
||||||
@ -80,9 +69,7 @@ class modDebugBar extends DolibarrModules
|
|||||||
// Constants
|
// Constants
|
||||||
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
|
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
|
||||||
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
|
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
|
||||||
$this->const = array(
|
$this->const = array();
|
||||||
0 => array('DEBUGBAR_LOGS_LINES_NUMBER', 'chaine', '100', 'Number of log lines to show in debug bar', 1)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Boxes
|
// Boxes
|
||||||
$this->boxes = array();
|
$this->boxes = array();
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
/**
|
/**
|
||||||
* @var int number of lines to show
|
* @var int number of lines to show
|
||||||
*/
|
*/
|
||||||
protected $lines;
|
protected $maxnboflines;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -31,8 +31,10 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
|
|
||||||
parent::__construct($name);
|
parent::__construct($name);
|
||||||
|
|
||||||
|
$this->nboflines=0;
|
||||||
|
$this->maxnboflines = empty($conf->global->DEBUGBAR_LOGS_LINES_NUMBER) ? 250 : $conf->global->DEBUGBAR_LOGS_LINES_NUMBER; // High number slows seriously output
|
||||||
|
|
||||||
$this->path = $path ?: $this->getLogsFile();
|
$this->path = $path ?: $this->getLogsFile();
|
||||||
$this->lines = empty($conf->global->DEBUGBAR_LOGS_LINES_NUMBER) ? 250 : $conf->global->DEBUGBAR_LOGS_LINES_NUMBER; // This slow seriously output
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,7 +70,31 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
*/
|
*/
|
||||||
public function collect()
|
public function collect()
|
||||||
{
|
{
|
||||||
$this->getStorageLogs($this->path);
|
global $conf;
|
||||||
|
|
||||||
|
$uselogfile=$conf->global->DEBUGBAR_USE_LOGFILE;
|
||||||
|
|
||||||
|
if ($uselogfile)
|
||||||
|
{
|
||||||
|
$this->getStorageLogs($this->path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$log_levels = $this->getLevels();
|
||||||
|
|
||||||
|
foreach ($conf->logbuffer as $line) {
|
||||||
|
if ($this->nboflines >= $this->maxnboflines)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
foreach ($log_levels as $level_key => $level) {
|
||||||
|
if (strpos(strtolower($line), strtolower($level_key)) == 20) {
|
||||||
|
$this->nboflines++;
|
||||||
|
$this->addMessage($line, $level, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return parent::collect();
|
return parent::collect();
|
||||||
}
|
}
|
||||||
@ -76,14 +102,13 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
/**
|
/**
|
||||||
* Get the path to the logs file
|
* Get the path to the logs file
|
||||||
*
|
*
|
||||||
* @return string Path of log file
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getLogsFile()
|
public function getLogsFile()
|
||||||
{
|
{
|
||||||
// default dolibarr log file
|
// default dolibarr log file
|
||||||
$path = DOL_DATA_ROOT . '/dolibarr.log';
|
$path = DOL_DATA_ROOT . '/dolibarr.log';
|
||||||
|
return $path;
|
||||||
return $path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -94,16 +119,16 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
*/
|
*/
|
||||||
public function getStorageLogs($path)
|
public function getStorageLogs($path)
|
||||||
{
|
{
|
||||||
if (! file_exists($path)) {
|
if (! file_exists($path)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the latest lines
|
// Load the latest lines
|
||||||
$file = implode("", $this->tailFile($path, $this->lines));
|
$file = implode("", $this->tailFile($path, $this->maxnboflines));
|
||||||
|
|
||||||
foreach ($this->getLogs($file) as $log) {
|
foreach ($this->getLogs($file) as $log) {
|
||||||
$this->addMessage($log['line'], $log['level'], false);
|
$this->addMessage($log['line'], $log['level'], false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,32 +140,32 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
*/
|
*/
|
||||||
protected function tailFile($file, $lines)
|
protected function tailFile($file, $lines)
|
||||||
{
|
{
|
||||||
$handle = fopen($file, "r");
|
$handle = fopen($file, "r");
|
||||||
$linecounter = $lines;
|
$linecounter = $lines;
|
||||||
$pos = -2;
|
$pos = -2;
|
||||||
$beginning = false;
|
$beginning = false;
|
||||||
$text = [];
|
$text = [];
|
||||||
while ($linecounter > 0) {
|
while ($linecounter > 0) {
|
||||||
$t = " ";
|
$t = " ";
|
||||||
while ($t != "\n") {
|
while ($t != "\n") {
|
||||||
if (fseek($handle, $pos, SEEK_END) == -1) {
|
if (fseek($handle, $pos, SEEK_END) == -1) {
|
||||||
$beginning = true;
|
$beginning = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$t = fgetc($handle);
|
$t = fgetc($handle);
|
||||||
$pos--;
|
$pos--;
|
||||||
}
|
}
|
||||||
$linecounter--;
|
$linecounter--;
|
||||||
if ($beginning) {
|
if ($beginning) {
|
||||||
rewind($handle);
|
rewind($handle);
|
||||||
}
|
}
|
||||||
$text[$lines - $linecounter - 1] = fgets($handle);
|
$text[$lines - $linecounter - 1] = fgets($handle);
|
||||||
if ($beginning) {
|
if ($beginning) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
return array_reverse($text);
|
return array_reverse($text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -151,21 +176,21 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
*/
|
*/
|
||||||
public function getLogs($file)
|
public function getLogs($file)
|
||||||
{
|
{
|
||||||
$pattern = "/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*/";
|
$pattern = "/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*/";
|
||||||
$log_levels = $this->getLevels();
|
$log_levels = $this->getLevels();
|
||||||
preg_match_all($pattern, $file, $matches);
|
preg_match_all($pattern, $file, $matches);
|
||||||
$log = [];
|
$log = [];
|
||||||
foreach ($matches as $lines) {
|
foreach ($matches as $lines) {
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
foreach ($log_levels as $level_key => $level) {
|
foreach ($log_levels as $level_key => $level) {
|
||||||
if (strpos(strtolower($line), strtolower($level_key)) == 20) {
|
if (strpos(strtolower($line), strtolower($level_key)) == 20) {
|
||||||
$log[] = ['level' => $level, 'line' => $line];
|
$log[] = ['level' => $level, 'line' => $line];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$log = array_reverse($log);
|
$log = array_reverse($log);
|
||||||
return $log;
|
return $log;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -178,6 +203,7 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
$class = new ReflectionClass(new LogLevel());
|
$class = new ReflectionClass(new LogLevel());
|
||||||
$levels = $class->getConstants();
|
$levels = $class->getConstants();
|
||||||
$levels['ERR'] = 'error';
|
$levels['ERR'] = 'error';
|
||||||
|
$levels['WARN'] = 'warning';
|
||||||
|
|
||||||
return $levels;
|
return $levels;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,12 +31,12 @@ class DolibarrDebugBar extends DebugBar
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
//$this->addCollector(new PhpInfoCollector());
|
//$this->addCollector(new PhpInfoCollector());
|
||||||
$this->addCollector(new DolMessagesCollector());
|
//$this->addCollector(new DolMessagesCollector());
|
||||||
$this->addCollector(new DolRequestDataCollector());
|
$this->addCollector(new DolRequestDataCollector());
|
||||||
$this->addCollector(new DolConfigCollector());
|
$this->addCollector(new DolConfigCollector());
|
||||||
$this->addCollector(new DolTimeDataCollector());
|
$this->addCollector(new DolTimeDataCollector());
|
||||||
$this->addCollector(new DolMemoryCollector());
|
$this->addCollector(new DolMemoryCollector());
|
||||||
$this->addCollector(new DolExceptionsCollector());
|
//$this->addCollector(new DolExceptionsCollector());
|
||||||
$this->addCollector(new DolQueryCollector());
|
$this->addCollector(new DolQueryCollector());
|
||||||
$this->addCollector(new DolibarrCollector());
|
$this->addCollector(new DolibarrCollector());
|
||||||
if ($conf->syslog->enabled) {
|
if ($conf->syslog->enabled) {
|
||||||
@ -51,6 +51,10 @@ class DolibarrDebugBar extends DebugBar
|
|||||||
*/
|
*/
|
||||||
public function getRenderer()
|
public function getRenderer()
|
||||||
{
|
{
|
||||||
return parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/DebugBar/Resources');
|
$renderer = parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/DebugBar/Resources');
|
||||||
|
//$renderer->disableVendor('jquery');
|
||||||
|
$renderer->disableVendor('fontawesome');
|
||||||
|
$renderer->disableVendor('highlightjs');
|
||||||
|
return $renderer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,113 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ActionsDebugBar class
|
|
||||||
*/
|
|
||||||
|
|
||||||
class ActionsDebugBar
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Load Debug bar
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function loadDebugBar()
|
|
||||||
{
|
|
||||||
global $conf, $debugbar;
|
|
||||||
|
|
||||||
dol_include_once('/debugbar/class/DebugBar.php');
|
|
||||||
$debugbar = new DolibarrDebugBar();
|
|
||||||
$renderer = $debugbar->getRenderer();
|
|
||||||
$conf->global->MAIN_HTML_HEADER .= $renderer->renderHead();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overloading the afterLogin function
|
|
||||||
*
|
|
||||||
* @param array $parameters Hook metadatas (context, etc...)
|
|
||||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
|
||||||
* @param string $action Current action (if set). Generally create or edit or null
|
|
||||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
|
||||||
* @return int < 0 on error, 0 on success, 1 to replace standard code
|
|
||||||
*/
|
|
||||||
public function afterLogin($parameters, &$object, &$action, $hookmanager)
|
|
||||||
{
|
|
||||||
$error = 0; // Error counter
|
|
||||||
|
|
||||||
if (in_array('login', explode(':', $parameters['context'])))
|
|
||||||
{
|
|
||||||
$this->loadDebugBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
return 0; // or return 1 to replace standard code
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overloading the updateSession function
|
|
||||||
*
|
|
||||||
* @param array $parameters Hook metadatas (context, etc...)
|
|
||||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
|
||||||
* @param string $action Current action (if set). Generally create or edit or null
|
|
||||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
|
||||||
* @return int < 0 on error, 0 on success, 1 to replace standard code
|
|
||||||
*/
|
|
||||||
public function updateSession($parameters, &$object, &$action, $hookmanager)
|
|
||||||
{
|
|
||||||
$error = 0; // Error counter
|
|
||||||
|
|
||||||
if (in_array('main', explode(':', $parameters['context'])))
|
|
||||||
{
|
|
||||||
$this->loadDebugBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
return 0; // or return 1 to replace standard code
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overloading the printCommonFooter function
|
|
||||||
*
|
|
||||||
* @param array $parameters Hook metadatas (context, etc...)
|
|
||||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
|
||||||
* @param string $action Current action (if set). Generally create or edit or null
|
|
||||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
|
||||||
* @return int <0 on error, 0 on success, 1 to replace standard code
|
|
||||||
*/
|
|
||||||
public function printCommonFooter($parameters, &$object, &$action, $hookmanager)
|
|
||||||
{
|
|
||||||
global $user, $debugbar, $langs;
|
|
||||||
|
|
||||||
$error = 0; // Error counter
|
|
||||||
$context = explode(':', $parameters['context']);
|
|
||||||
|
|
||||||
if (in_array('main', $context) || in_array('login', $context))
|
|
||||||
{
|
|
||||||
if ($user->rights->debugbar->read && is_object($debugbar)) {
|
|
||||||
$renderer = $debugbar->getRenderer();
|
|
||||||
echo $renderer->render();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
return 0; // or return 1 to replace standard code
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -26,17 +26,18 @@
|
|||||||
* \brief Page for trip and expense report card
|
* \brief Page for trip and expense report card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$res=0;
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/expensereport.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/expensereport.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/expensereport/modules_expensereport.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/modules/expensereport/modules_expensereport.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
|
||||||
@ -1090,9 +1091,18 @@ if (empty($reshook))
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// First save uploaded file
|
// First save uploaded file
|
||||||
if (! empty($_FILES))
|
$fk_ecm_files = 0;
|
||||||
|
if (GETPOSTISSET('attachfile'))
|
||||||
{
|
{
|
||||||
|
$arrayoffiles=GETPOST('attachfile', 'array');
|
||||||
|
if (is_array($arrayoffiles) && ! empty($arrayoffiles[0]))
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||||
|
$relativepath='expensereport/'.$object->ref.'/'.$arrayoffiles[0];
|
||||||
|
$ecmfiles=new EcmFiles($db);
|
||||||
|
$ecmfiles->fetch(0, '', $relativepath);
|
||||||
|
$fk_ecm_files = $ecmfiles->id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
|
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
|
||||||
@ -1111,7 +1121,7 @@ if (empty($reshook))
|
|||||||
$qty = GETPOST('qty', 'int');
|
$qty = GETPOST('qty', 'int');
|
||||||
if (empty($qty)) $qty=1;
|
if (empty($qty)) $qty=1;
|
||||||
|
|
||||||
if (! $fk_c_type_fees > 0)
|
if (! ($fk_c_type_fees > 0))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
||||||
@ -1144,13 +1154,12 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans("WarningDateOfLineMustBeInExpenseReportRange"), null, 'warnings');
|
setEventMessages($langs->trans("WarningDateOfLineMustBeInExpenseReportRange"), null, 'warnings');
|
||||||
}
|
}
|
||||||
|
|
||||||
// S'il y'a eu au moins une erreur
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$type = 0; // TODO What if service ? We should take the type product/service from the type of expense report llx_c_type_fees
|
$type = 0; // TODO What if service ? We should take the type product/service from the type of expense report llx_c_type_fees
|
||||||
|
|
||||||
// Insert line
|
// Insert line
|
||||||
$result = $object->addline($qty, $value_unit, $fk_c_type_fees, $vatrate, $date, $comments, $fk_projet, $fk_c_exp_tax_cat, $type);
|
$result = $object->addline($qty, $value_unit, $fk_c_type_fees, $vatrate, $date, $comments, $fk_projet, $fk_c_exp_tax_cat, $type, $fk_ecm_files);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$ret = $object->fetch($object->id); // Reload to get new records
|
$ret = $object->fetch($object->id); // Reload to get new records
|
||||||
@ -1340,6 +1349,7 @@ $formproject = new FormProjets($db);
|
|||||||
$projecttmp = new Project($db);
|
$projecttmp = new Project($db);
|
||||||
$paymentexpensereportstatic=new PaymentExpenseReport($db);
|
$paymentexpensereportstatic=new PaymentExpenseReport($db);
|
||||||
$bankaccountstatic = new Account($db);
|
$bankaccountstatic = new Account($db);
|
||||||
|
$ecmfilesstatic = new EcmFiles($db);
|
||||||
|
|
||||||
// Create
|
// Create
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
@ -1709,7 +1719,7 @@ else
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
// Author
|
// Author
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@ -1853,7 +1863,7 @@ else
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@ -2020,7 +2030,7 @@ else
|
|||||||
if (! empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$langs->trans('Project').'</td>';
|
if (! empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$langs->trans('Project').'</td>';
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print '<td>'.$langs->trans('CarCategory').'</td>';
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print '<td>'.$langs->trans('CarCategory').'</td>';
|
||||||
print '<td class="center">'.$langs->trans('Type').'</td>';
|
print '<td class="center">'.$langs->trans('Type').'</td>';
|
||||||
print '<td class="left">'.$langs->trans('Description').'</td>';
|
print '<td>'.$langs->trans('Description').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('VAT').'</td>';
|
print '<td class="right">'.$langs->trans('VAT').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('PriceUTTC').'</td>';
|
print '<td class="right">'.$langs->trans('PriceUTTC').'</td>';
|
||||||
@ -2030,6 +2040,9 @@ else
|
|||||||
print '<td class="right">'.$langs->trans('AmountHT').'</td>';
|
print '<td class="right">'.$langs->trans('AmountHT').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('AmountTTC').'</td>';
|
print '<td class="right">'.$langs->trans('AmountTTC').'</td>';
|
||||||
}
|
}
|
||||||
|
// Picture
|
||||||
|
print '<td>';
|
||||||
|
print '</td>';
|
||||||
// Ajout des boutons de modification/suppression
|
// Ajout des boutons de modification/suppression
|
||||||
if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer)
|
if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
@ -2102,6 +2115,80 @@ else
|
|||||||
print '<td class="right">'.price($line->total_ttc).'</td>';
|
print '<td class="right">'.price($line->total_ttc).'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Column with preview
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($line->fk_ecm_files > 0)
|
||||||
|
{
|
||||||
|
$modulepart='expensereport';
|
||||||
|
$maxheightmini=32;
|
||||||
|
|
||||||
|
$result = $ecmfilesstatic->fetch($line->fk_ecm_files);
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
$relativepath=preg_replace('/expensereport\//', '', $ecmfilesstatic->filepath);
|
||||||
|
$fileinfo = pathinfo($ecmfilesstatic->filepath.'/'.$ecmfilesstatic->filename);
|
||||||
|
if (image_format_supported($fileinfo['basename']) > 0)
|
||||||
|
{
|
||||||
|
$minifile=getImageFileNameForSize($fileinfo['basename'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original
|
||||||
|
if (! dol_is_file($conf->expensereport->dir_output.'/'.$relativepath.'/'.$minifile)) $minifile=getImageFileNameForSize($fileinfo['basename'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
|
||||||
|
//print $file['path'].'/'.$minifile.'<br>';
|
||||||
|
$urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.'/'.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity));
|
||||||
|
if (empty($urlforhref)) {
|
||||||
|
$urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
|
||||||
|
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">';
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
|
||||||
|
}
|
||||||
|
print '<img class="photo" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.'/'.$minifile).'" title="">';
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$modulepart='expensereport';
|
||||||
|
$thumbshown=0;
|
||||||
|
if (preg_match('/\.pdf$/i', $ecmfilesstatic->filename))
|
||||||
|
{
|
||||||
|
$filepdf = $conf->expensereport->dir_output.'/'.$relativepath.'/'.$ecmfilesstatic->filename;
|
||||||
|
$fileimage = $conf->expensereport->dir_output.'/'.$relativepath.'/'.$ecmfilesstatic->filename.'_preview.png';
|
||||||
|
$relativepathimage = $relativepath.'/'.$ecmfilesstatic->filename.'_preview.png';
|
||||||
|
|
||||||
|
$pdfexists = file_exists($filepdf);
|
||||||
|
if ($pdfexists)
|
||||||
|
{
|
||||||
|
// Conversion du PDF en image png si fichier png non existant
|
||||||
|
if (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf)))
|
||||||
|
{
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experience trouble with pdf thumb generation and imagick, you can disable here.
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
$ret = dol_convert_file($filepdf, 'png', $fileimage, '0'); // Convert first page of PDF into a file _preview.png
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pdfexists && ! $error)
|
||||||
|
{
|
||||||
|
$heightforphotref=70;
|
||||||
|
if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60;
|
||||||
|
// If the preview file is found
|
||||||
|
if (file_exists($fileimage))
|
||||||
|
{
|
||||||
|
$thumbshown=1;
|
||||||
|
print '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($relativepathimage).'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $thumbshown)
|
||||||
|
{
|
||||||
|
print img_mime($ecmfilesstatic->filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Ajout des boutons de modification/suppression
|
// Ajout des boutons de modification/suppression
|
||||||
if (($object->fk_statut < ExpenseReport::STATUS_VALIDATED || $object->fk_statut == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer)
|
if (($object->fk_statut < ExpenseReport::STATUS_VALIDATED || $object->fk_statut == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
@ -2122,72 +2209,77 @@ else
|
|||||||
|
|
||||||
if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int'))
|
if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int'))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
|
||||||
// Select date
|
// Select date
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $form->selectDate($line->date, 'date');
|
print $form->selectDate($line->date, 'date');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Select project
|
// Select project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
print '<td>';
|
|
||||||
$formproject->select_projects(-1, $line->fk_project, 'fk_projet', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
|
||||||
{
|
|
||||||
print '<td class="fk_c_exp_tax_cat">';
|
|
||||||
$params = array('fk_expense' => $object->id, 'fk_expense_det' => $line->rowid, 'date' => $line->dates);
|
|
||||||
print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params);
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Select type
|
|
||||||
print '<td class="center">';
|
|
||||||
select_type_fees_id($line->fk_c_type_fees, 'fk_c_type_fees');
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Add comments
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<textarea name="comments" class="flat_ndf centpercent">'.dol_escape_htmltag($line->comments, 0, 1).'</textarea>';
|
$formproject->select_projects(-1, $line->fk_project, 'fk_projet', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// VAT
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||||
print '<td class="right">';
|
{
|
||||||
print $form->load_tva('vatrate', (isset($_POST["vatrate"])?$_POST["vatrate"]:$line->vatrate), $mysoc, '', 0, 0, '', false, 1);
|
print '<td class="fk_c_exp_tax_cat">';
|
||||||
|
$params = array('fk_expense' => $object->id, 'fk_expense_det' => $line->rowid, 'date' => $line->dates);
|
||||||
|
print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Unit price
|
// Select type
|
||||||
print '<td class="right">';
|
print '<td class="center">';
|
||||||
print '<input type="text" min="0" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag(price2num($line->value_unit_ht)).'" />';
|
select_type_fees_id($line->fk_c_type_fees, 'fk_c_type_fees');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Unit price with tax
|
// Add comments
|
||||||
print '<td class="right">';
|
print '<td>';
|
||||||
print '<input type="text" min="0" class="right maxwidth50" id="value_unit" name="value_unit" value="'.dol_escape_htmltag(price2num($line->value_unit)).'" />';
|
print '<textarea name="comments" class="flat_ndf centpercent">'.dol_escape_htmltag($line->comments, 0, 1).'</textarea>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Quantity
|
// VAT
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print '<input type="number" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($line->qty).'" />';
|
print $form->load_tva('vatrate', (isset($_POST["vatrate"])?$_POST["vatrate"]:$line->vatrate), $mysoc, '', 0, 0, '', false, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($action != 'editline')
|
// Unit price
|
||||||
{
|
print '<td class="right">';
|
||||||
print '<td class="right">'.$langs->trans('AmountHT').'</td>';
|
print '<input type="text" min="0" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag(price2num($line->value_unit_ht)).'" />';
|
||||||
print '<td class="right">'.$langs->trans('AmountTTC').'</td>';
|
print '</td>';
|
||||||
}
|
|
||||||
|
|
||||||
print '<td class="center">';
|
// Unit price with tax
|
||||||
print '<input type="hidden" name="rowid" value="'.$line->rowid.'">';
|
print '<td class="right">';
|
||||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans('Save').'">';
|
print '<input type="text" min="0" class="right maxwidth50" id="value_unit" name="value_unit" value="'.dol_escape_htmltag(price2num($line->value_unit)).'" />';
|
||||||
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
|
print '</td>';
|
||||||
print '</td>';
|
|
||||||
|
// Quantity
|
||||||
|
print '<td class="right">';
|
||||||
|
print '<input type="number" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($line->qty).'" />';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
if ($action != 'editline')
|
||||||
|
{
|
||||||
|
print '<td class="right">'.$langs->trans('AmountHT').'</td>';
|
||||||
|
print '<td class="right">'.$langs->trans('AmountTTC').'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Picture
|
||||||
|
print '<td class="center">';
|
||||||
|
//print $line->fk_ecm_files;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="center">';
|
||||||
|
print '<input type="hidden" name="rowid" value="'.$line->rowid.'">';
|
||||||
|
print '<input type="submit" class="button" name="save" value="'.$langs->trans('Save').'">';
|
||||||
|
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -2197,7 +2289,7 @@ else
|
|||||||
// Add a line
|
// Add a line
|
||||||
if (($object->fk_statut == ExpenseReport::STATUS_DRAFT || $object->fk_statut == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer)
|
if (($object->fk_statut == ExpenseReport::STATUS_DRAFT || $object->fk_statut == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$colspan = 10;
|
$colspan = 11;
|
||||||
if (! empty($conf->global->MAIN_USE_EXPENSE_IK)) $colspan++;
|
if (! empty($conf->global->MAIN_USE_EXPENSE_IK)) $colspan++;
|
||||||
if (! empty($conf->projet->enabled)) $colspan++;
|
if (! empty($conf->projet->enabled)) $colspan++;
|
||||||
if ($action != 'editline') $colspan++;
|
if ($action != 'editline') $colspan++;
|
||||||
@ -2232,10 +2324,12 @@ else
|
|||||||
print '$(document).ready(function() {
|
print '$(document).ready(function() {
|
||||||
$( ".auploadnewfilenow" ).click(function() {
|
$( ".auploadnewfilenow" ).click(function() {
|
||||||
jQuery(".truploadnewfilenow").toggle();
|
jQuery(".truploadnewfilenow").toggle();
|
||||||
|
jQuery(".trattachnewfilenow").hide();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$( ".aattachtodoc" ).click(function() {
|
$( ".aattachtodoc" ).click(function() {
|
||||||
jQuery(".trattachnewfilenow").toggle();
|
jQuery(".trattachnewfilenow").toggle();
|
||||||
|
jQuery(".truploadnewfilenow").hide();
|
||||||
return false;
|
return false;
|
||||||
});';
|
});';
|
||||||
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array')))
|
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array')))
|
||||||
@ -2249,14 +2343,12 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Add line to upload new file
|
// Add line to upload new file
|
||||||
print '<tr class="oddeven truploadnewfilenow"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display: none"':'').'>';
|
print '<tr class="oddeven nohover truploadnewfilenow"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display: none"':'').'>';
|
||||||
print '<td colspan="'.$colspan.'">';
|
print '<td colspan="'.$colspan.'">';
|
||||||
|
|
||||||
$modulepart = 'expensereport';
|
$modulepart = 'expensereport';
|
||||||
$permission = $user->rights->expensereport->creer;
|
$permission = $user->rights->expensereport->creer;
|
||||||
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
|
|
||||||
// We define var to enable the feature to add prefix of uploaded files
|
// We define var to enable the feature to add prefix of uploaded files
|
||||||
$savingdocmask='';
|
$savingdocmask='';
|
||||||
if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
|
if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
|
||||||
@ -2266,10 +2358,6 @@ else
|
|||||||
{
|
{
|
||||||
$savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
|
$savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
|
||||||
}
|
}
|
||||||
/*if (in_array($modulepart,array('member')))
|
|
||||||
{
|
|
||||||
$savingdocmask=$object->login.'___file__';
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show upload form (document and links)
|
// Show upload form (document and links)
|
||||||
@ -2305,7 +2393,7 @@ else
|
|||||||
$nbLinks=Link::count($db, $object->element, $object->id);
|
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||||
if ($nbFiles >= 0)
|
if ($nbFiles >= 0)
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven trattachnewfilenow"'.(! GETPOSTISSET('sendit') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display: none"':'').'>';
|
print '<tr class="oddeven nohover trattachnewfilenow"'.(! GETPOSTISSET('sendit') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display: none"':'').'>';
|
||||||
print '<td colspan="'.$colspan.'">';
|
print '<td colspan="'.$colspan.'">';
|
||||||
//print '<span class="opacitymedium">'.$langs->trans("AttachTheNewLineToTheDocument").'</span><br>';
|
//print '<span class="opacitymedium">'.$langs->trans("AttachTheNewLineToTheDocument").'</span><br>';
|
||||||
$modulepart='expensereport';$maxheightmini=48;
|
$modulepart='expensereport';$maxheightmini=48;
|
||||||
@ -2316,8 +2404,7 @@ else
|
|||||||
$fileinfo = pathinfo($file['name']);
|
$fileinfo = pathinfo($file['name']);
|
||||||
if (image_format_supported($file['name']) > 0)
|
if (image_format_supported($file['name']) > 0)
|
||||||
{
|
{
|
||||||
$minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original
|
$minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case however) than original
|
||||||
//if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
|
|
||||||
//print $file['path'].'/'.$minifile.'<br>';
|
//print $file['path'].'/'.$minifile.'<br>';
|
||||||
$urlforhref=getAdvancedPreviewUrl($modulepart, $fileinfo['relativename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity));
|
$urlforhref=getAdvancedPreviewUrl($modulepart, $fileinfo['relativename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity));
|
||||||
if (empty($urlforhref)) {
|
if (empty($urlforhref)) {
|
||||||
@ -2326,10 +2413,57 @@ else
|
|||||||
} else {
|
} else {
|
||||||
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
|
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
|
||||||
}
|
}
|
||||||
print '<img class="photo" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">';
|
print '<div class="photoref">';
|
||||||
|
print '<img class="photoexpensereport photorefcenter" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">';
|
||||||
|
print '</div>';
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
else print ' ';
|
else
|
||||||
|
{
|
||||||
|
$modulepart='expensereport';
|
||||||
|
print '<a href=""><div class="photoref">';
|
||||||
|
$thumbshown=0;
|
||||||
|
if (preg_match('/\.pdf$/i', $file['name']))
|
||||||
|
{
|
||||||
|
$filepdf = $conf->expensereport->dir_output.'/'.$relativepath.$file['name'];
|
||||||
|
$fileimage = $conf->expensereport->dir_output.'/'.$relativepath.$file['name'].'_preview.png';
|
||||||
|
$relativepathimage = $relativepath.$file['name'].'_preview.png';
|
||||||
|
|
||||||
|
$pdfexists = file_exists($filepdf);
|
||||||
|
|
||||||
|
if ($pdfexists)
|
||||||
|
{
|
||||||
|
// Conversion du PDF en image png si fichier png non existant
|
||||||
|
if (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf)))
|
||||||
|
{
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experience trouble with pdf thumb generation and imagick, you can disable here.
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
$ret = dol_convert_file($filepdf, 'png', $fileimage, '0'); // Convert first page of PDF into a file _preview.png
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pdfexists && ! $error)
|
||||||
|
{
|
||||||
|
$heightforphotref=70;
|
||||||
|
if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60;
|
||||||
|
// If the preview file is found
|
||||||
|
if (file_exists($fileimage))
|
||||||
|
{
|
||||||
|
$thumbshown=1;
|
||||||
|
print '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($relativepathimage).'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $thumbshown)
|
||||||
|
{
|
||||||
|
print img_mime($minifile);
|
||||||
|
}
|
||||||
|
print '</div></a>';
|
||||||
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$checked='';
|
$checked='';
|
||||||
//var_dump(GETPOST($file['relativename'])); var_dump($file['relativename']); var_dump($_FILES['userfile']['name']);
|
//var_dump(GETPOST($file['relativename'])); var_dump($file['relativename']); var_dump($_FILES['userfile']['name']);
|
||||||
@ -2345,7 +2479,7 @@ else
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<input type="checkbox"'.$checked.' name="attachfile[]" value="'.$file['relativename'].'"> '.$file['relativename'];
|
print '<div class="margintoponly"><input type="radio"'.$checked.' name="attachfile[]" value="'.$file['relativename'].'"> '.$file['relativename'].'</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -2363,7 +2497,10 @@ else
|
|||||||
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('PriceUTTC').'</td>';
|
print '<td class="right">'.$langs->trans('PriceUTTC').'</td>';
|
||||||
print '<td class="right">'.$langs->trans('Qty').'</td>';
|
print '<td class="right">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td colspan="3"></td>';
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -2424,6 +2561,9 @@ else
|
|||||||
print '<input type="text" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($qty?$qty:1).'">'; // We must be able to enter decimal qty
|
print '<input type="text" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($qty?$qty:1).'">'; // We must be able to enter decimal qty
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Picture
|
||||||
|
print '<td></td>';
|
||||||
|
|
||||||
if ($action != 'editline')
|
if ($action != 'editline')
|
||||||
{
|
{
|
||||||
print '<td class="right"></td>';
|
print '<td class="right"></td>';
|
||||||
@ -2649,7 +2789,6 @@ if (GETPOST('modelselected', 'alpha')) {
|
|||||||
|
|
||||||
if ($action != 'presend')
|
if ($action != 'presend')
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generate documents
|
* Generate documents
|
||||||
*/
|
*/
|
||||||
@ -2669,11 +2808,15 @@ if ($action != 'presend')
|
|||||||
$somethingshown = $formfile->numoffiles;
|
$somethingshown = $formfile->numoffiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disabled for expensereport, there is no thirdparty on expensereport, so nothing to define the list of other object we can suggest to link to
|
||||||
|
/*
|
||||||
if ($action != 'create' && $action != 'edit' && ($id || $ref))
|
if ($action != 'create' && $action != 'edit' && ($id || $ref))
|
||||||
{
|
{
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('expensereport'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('expensereport'));
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||||
|
|||||||
@ -971,7 +971,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$this->lines=array();
|
$this->lines=array();
|
||||||
|
|
||||||
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,';
|
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,';
|
||||||
$sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_c_exp_tax_cat, de.fk_projet as fk_project, de.tva_tx,';
|
$sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_c_exp_tax_cat, de.fk_projet as fk_project, de.tva_tx, de.fk_ecm_files,';
|
||||||
$sql.= ' de.total_ht, de.total_tva, de.total_ttc,';
|
$sql.= ' de.total_ht, de.total_tva, de.total_ttc,';
|
||||||
$sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,';
|
$sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,';
|
||||||
$sql.= ' p.ref as ref_projet, p.title as title_projet';
|
$sql.= ' p.ref as ref_projet, p.title as title_projet';
|
||||||
@ -1010,8 +1010,9 @@ class ExpenseReport extends CommonObject
|
|||||||
$deplig->fk_expensereport = $objp->fk_expensereport;
|
$deplig->fk_expensereport = $objp->fk_expensereport;
|
||||||
$deplig->fk_c_type_fees = $objp->fk_c_type_fees;
|
$deplig->fk_c_type_fees = $objp->fk_c_type_fees;
|
||||||
$deplig->fk_c_exp_tax_cat = $objp->fk_c_exp_tax_cat;
|
$deplig->fk_c_exp_tax_cat = $objp->fk_c_exp_tax_cat;
|
||||||
$deplig->fk_projet = $objp->fk_project;
|
$deplig->fk_projet = $objp->fk_project; // deprecated
|
||||||
$deplig->fk_project = $objp->fk_project;
|
$deplig->fk_project = $objp->fk_project;
|
||||||
|
$deplig->fk_ecm_files = $objp->fk_ecm_files;
|
||||||
|
|
||||||
$deplig->total_ht = $objp->total_ht;
|
$deplig->total_ht = $objp->total_ht;
|
||||||
$deplig->total_tva = $objp->total_tva;
|
$deplig->total_tva = $objp->total_tva;
|
||||||
@ -1687,20 +1688,21 @@ class ExpenseReport extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* addline
|
* addline
|
||||||
*
|
*
|
||||||
* @param float $qty Qty
|
* @param float $qty Qty
|
||||||
* @param double $up Value init
|
* @param double $up Value init
|
||||||
* @param int $fk_c_type_fees Type payment
|
* @param int $fk_c_type_fees Type payment
|
||||||
* @param string $vatrate Vat rate (Can be '10' or '10 (ABC)')
|
* @param string $vatrate Vat rate (Can be '10' or '10 (ABC)')
|
||||||
* @param string $date Date
|
* @param string $date Date
|
||||||
* @param string $comments Description
|
* @param string $comments Description
|
||||||
* @param int $fk_project Project id
|
* @param int $fk_project Project id
|
||||||
* @param int $fk_c_exp_tax_cat Car category id
|
* @param int $fk_c_exp_tax_cat Car category id
|
||||||
* @param int $type Type line
|
* @param int $type Type line
|
||||||
* @return int <0 if KO, >0 if OK
|
* @param int $fk_ecm_files Id of ECM file to link to this expensereport line
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function addline($qty = 0, $up = 0, $fk_c_type_fees = 0, $vatrate = 0, $date = '', $comments = '', $fk_project = 0, $fk_c_exp_tax_cat = 0, $type = 0)
|
public function addline($qty = 0, $up = 0, $fk_c_type_fees = 0, $vatrate = 0, $date = '', $comments = '', $fk_project = 0, $fk_c_exp_tax_cat = 0, $type = 0, $fk_ecm_files = 0)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::addline qty=$qty, up=$up, fk_c_type_fees=$fk_c_type_fees, vatrate=$vatrate, date=$date, fk_project=$fk_project, type=$type, comments=$comments", LOG_DEBUG);
|
dol_syslog(get_class($this)."::addline qty=$qty, up=$up, fk_c_type_fees=$fk_c_type_fees, vatrate=$vatrate, date=$date, fk_project=$fk_project, type=$type, comments=$comments", LOG_DEBUG);
|
||||||
|
|
||||||
@ -1750,7 +1752,10 @@ class ExpenseReport extends CommonObject
|
|||||||
$this->line->fk_c_type_fees = $fk_c_type_fees;
|
$this->line->fk_c_type_fees = $fk_c_type_fees;
|
||||||
$this->line->fk_c_exp_tax_cat = $fk_c_exp_tax_cat;
|
$this->line->fk_c_exp_tax_cat = $fk_c_exp_tax_cat;
|
||||||
$this->line->comments = $comments;
|
$this->line->comments = $comments;
|
||||||
$this->line->fk_projet = $fk_project;
|
$this->line->fk_projet = $fk_project; // deprecated
|
||||||
|
$this->line->fk_project = $fk_project;
|
||||||
|
|
||||||
|
$this->line->fk_ecm_files = $fk_ecm_files;
|
||||||
|
|
||||||
$this->applyOffset();
|
$this->applyOffset();
|
||||||
$this->checkRules($type, $seller);
|
$this->checkRules($type, $seller);
|
||||||
@ -2497,6 +2502,12 @@ class ExpenseReportLine
|
|||||||
public $total_tva;
|
public $total_tva;
|
||||||
public $total_ttc;
|
public $total_ttc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int ID into llx_ecm_files table to link line to attached file
|
||||||
|
*/
|
||||||
|
public $fk_ecm_files;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -2516,7 +2527,7 @@ class ExpenseReportLine
|
|||||||
public function fetch($rowid)
|
public function fetch($rowid)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet as fk_project, fde.date,';
|
$sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet as fk_project, fde.date,';
|
||||||
$sql.= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,';
|
$sql.= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc, fde.fk_ecm_files,';
|
||||||
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
|
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
|
||||||
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
|
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
|
||||||
@ -2531,8 +2542,8 @@ class ExpenseReportLine
|
|||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$this->rowid = $objp->rowid;
|
$this->rowid = $objp->rowid;
|
||||||
$this->id = $obj->rowid;
|
$this->id = $objp->rowid;
|
||||||
$this->ref = $obj->ref;
|
$this->ref = $objp->ref;
|
||||||
$this->fk_expensereport = $objp->fk_expensereport;
|
$this->fk_expensereport = $objp->fk_expensereport;
|
||||||
$this->comments = $objp->comments;
|
$this->comments = $objp->comments;
|
||||||
$this->qty = $objp->qty;
|
$this->qty = $objp->qty;
|
||||||
@ -2552,6 +2563,7 @@ class ExpenseReportLine
|
|||||||
$this->total_ht = $objp->total_ht;
|
$this->total_ht = $objp->total_ht;
|
||||||
$this->total_tva = $objp->total_tva;
|
$this->total_tva = $objp->total_tva;
|
||||||
$this->total_ttc = $objp->total_ttc;
|
$this->total_ttc = $objp->total_ttc;
|
||||||
|
$this->fk_ecm_files = $objp->fk_ecm_files;
|
||||||
|
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
} else {
|
} else {
|
||||||
@ -2585,7 +2597,7 @@ class ExpenseReportLine
|
|||||||
|
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'expensereport_det';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'expensereport_det';
|
||||||
$sql.= ' (fk_expensereport, fk_c_type_fees, fk_projet,';
|
$sql.= ' (fk_expensereport, fk_c_type_fees, fk_projet,';
|
||||||
$sql.= ' tva_tx, vat_src_code, comments, qty, value_unit, total_ht, total_tva, total_ttc, date, rule_warning_message, fk_c_exp_tax_cat)';
|
$sql.= ' tva_tx, vat_src_code, comments, qty, value_unit, total_ht, total_tva, total_ttc, date, rule_warning_message, fk_c_exp_tax_cat, fk_ecm_files)';
|
||||||
$sql.= " VALUES (".$this->db->escape($this->fk_expensereport).",";
|
$sql.= " VALUES (".$this->db->escape($this->fk_expensereport).",";
|
||||||
$sql.= " ".$this->db->escape($this->fk_c_type_fees).",";
|
$sql.= " ".$this->db->escape($this->fk_c_type_fees).",";
|
||||||
$sql.= " ".$this->db->escape($this->fk_project>0?$this->fk_project:($this->fk_projet>0?$this->fk_projet:'null')).",";
|
$sql.= " ".$this->db->escape($this->fk_project>0?$this->fk_project:($this->fk_projet>0?$this->fk_projet:'null')).",";
|
||||||
@ -2599,7 +2611,8 @@ class ExpenseReportLine
|
|||||||
$sql.= " ".$this->db->escape($this->total_ttc).",";
|
$sql.= " ".$this->db->escape($this->total_ttc).",";
|
||||||
$sql.= "'".$this->db->idate($this->date)."',";
|
$sql.= "'".$this->db->idate($this->date)."',";
|
||||||
$sql.= " '".$this->db->escape($this->rule_warning_message)."',";
|
$sql.= " '".$this->db->escape($this->rule_warning_message)."',";
|
||||||
$sql.= " ".$this->db->escape($this->fk_c_exp_tax_cat);
|
$sql.= " ".$this->db->escape($this->fk_c_exp_tax_cat).",";
|
||||||
|
$sql.= " ".($this->fk_ecm_files > 0 ? $this->fk_ecm_files : 'null');
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@ -2645,7 +2658,7 @@ class ExpenseReportLine
|
|||||||
* @param ExpenseReportRule $rule object rule to check
|
* @param ExpenseReportRule $rule object rule to check
|
||||||
* @param int $fk_user user author id
|
* @param int $fk_user user author id
|
||||||
* @param string $mode day|EX_DAY / month|EX_MON / year|EX_YEA to get amount
|
* @param string $mode day|EX_DAY / month|EX_MON / year|EX_YEA to get amount
|
||||||
* @return amount Amount
|
* @return float Amount
|
||||||
*/
|
*/
|
||||||
public function getExpAmount(ExpenseReportRule $rule, $fk_user, $mode = 'day')
|
public function getExpAmount(ExpenseReportRule $rule, $fk_user, $mode = 'day')
|
||||||
{
|
{
|
||||||
@ -2682,7 +2695,7 @@ class ExpenseReportLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* update
|
* Update line
|
||||||
*
|
*
|
||||||
* @param User $user User
|
* @param User $user User
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
|
|||||||
@ -90,7 +90,7 @@ if (empty($reshook))
|
|||||||
$mesg=join(',', $object->errors);
|
$mesg=join(',', $object->errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// conditions de reglement
|
// terms of the settlement
|
||||||
if ($action == 'setconditions' && $user->rights->societe->creer)
|
if ($action == 'setconditions' && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
@ -225,7 +225,7 @@ if ($object->id > 0)
|
|||||||
print $object->tva_intra;
|
print $object->tva_intra;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Conditions de reglement par defaut
|
// Default terms of the settlement
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
|
|||||||
@ -200,6 +200,69 @@ if (empty($reshook))
|
|||||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Edit Thirdparty
|
||||||
|
if (! empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && $action == 'set_thirdparty' && $user->rights->fournisseur->commande->creer && $object->statut == CommandeFournisseur::STATUS_DRAFT)
|
||||||
|
{
|
||||||
|
$new_socid = GETPOST('new_socid', 'int');
|
||||||
|
if(! empty($new_socid) && $new_socid != $object->thirdparty->id) {
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
// Update supplier
|
||||||
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur';
|
||||||
|
$sql .= ' SET fk_soc='.$new_socid;
|
||||||
|
$sql.= ' WHERE fk_soc='.$object->thirdparty->id;
|
||||||
|
$sql.= ' AND rowid='.$object->id;
|
||||||
|
|
||||||
|
$res = $db->query($sql);
|
||||||
|
|
||||||
|
if(! $res) $db->rollback();
|
||||||
|
else {
|
||||||
|
$db->commit();
|
||||||
|
|
||||||
|
// Replace prices for each lines by new supplier prices
|
||||||
|
foreach($object->lines as $l) {
|
||||||
|
$sql = 'SELECT price, unitprice, tva_tx, ref_fourn';
|
||||||
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
|
||||||
|
$sql.= ' WHERE fk_product='.$l->fk_product;
|
||||||
|
$sql.= ' AND fk_soc='.$new_socid;
|
||||||
|
$sql.= ' ORDER BY unitprice ASC';
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if($resql) {
|
||||||
|
$num_row = $db->num_rows($resql);
|
||||||
|
if(empty($num_row)) {
|
||||||
|
// No product price for this supplier !
|
||||||
|
$l->subprice = 0;
|
||||||
|
$l->total_ht = 0;
|
||||||
|
$l->total_tva = 0;
|
||||||
|
$l->total_ttc = 0;
|
||||||
|
$l->ref_supplier = '';
|
||||||
|
$l->update();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// No need for loop to keep best supplier price
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$l->subprice = $obj->unitprice;
|
||||||
|
$l->total_ht = $obj->price;
|
||||||
|
$l->tva_tx = $obj->tva_tx;
|
||||||
|
$l->total_tva = $l->total_ht * ($obj->tva_tx/100);
|
||||||
|
$l->total_ttc = $l->total_ht + $l->total_tva;
|
||||||
|
$l->ref_supplier = $obj->ref_fourn;
|
||||||
|
$l->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
}
|
||||||
|
$object->update_price();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$result = $object->set_remise($user, $_POST['remise_percent']);
|
$result = $object->set_remise($user, $_POST['remise_percent']);
|
||||||
@ -404,7 +467,7 @@ if (empty($reshook))
|
|||||||
$desc = $productsupplier->desc_supplier;
|
$desc = $productsupplier->desc_supplier;
|
||||||
} else $desc = $productsupplier->description;
|
} else $desc = $productsupplier->description;
|
||||||
|
|
||||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
$type = $productsupplier->type;
|
$type = $productsupplier->type;
|
||||||
$price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT');
|
$price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT');
|
||||||
@ -1826,40 +1889,57 @@ elseif (! empty($object->id))
|
|||||||
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty');
|
||||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->thirdparty->id.'&search_company='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
|
if(! empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && ! empty($user->rights->fournisseur->commande->creer) && $action == 'edit_thirdparty') {
|
||||||
|
$morehtmlref .= ' : ';
|
||||||
|
$morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
|
||||||
|
$morehtmlref .= '<input type="hidden" name="action" value="set_thirdparty">';
|
||||||
|
$morehtmlref .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
|
$morehtmlref .= $form->select_company($object->thirdparty->id, 'new_socid', 's.fournisseur = 1', '', 0, 0, array(), 0, 'minwidth300');
|
||||||
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
|
||||||
|
$morehtmlref .= '</form>';
|
||||||
|
}
|
||||||
|
if(empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) || $action != 'edit_thirdparty') {
|
||||||
|
if(! empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && $object->statut == CommandeFournisseur::STATUS_DRAFT) {
|
||||||
|
$morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=edit_thirdparty&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetThirdParty')) . '</a>';
|
||||||
|
}
|
||||||
|
$morehtmlref .= ' : '.$object->thirdparty->getNomUrl(1);
|
||||||
|
if(empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/fourn/commande/list.php?socid=' . $object->thirdparty->id . '&search_company=' . urlencode($object->thirdparty->name) . '">' . $langs->trans("OtherOrders") . '</a>)';
|
||||||
|
}
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if(!empty($conf->projet->enabled)) {
|
||||||
{
|
$langs->load("projects");
|
||||||
$langs->load("projects");
|
$morehtmlref .= '<br>' . $langs->trans('Project') . ' ';
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
if($user->rights->fournisseur->commande->creer) {
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if($action != 'classify')
|
||||||
{
|
$morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action != 'classify')
|
if($action == 'classify') {
|
||||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
if ($action == 'classify') {
|
$morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
|
||||||
$morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref .= '</form>';
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
}
|
||||||
$morehtmlref.='</form>';
|
else {
|
||||||
} else {
|
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
}
|
||||||
}
|
}
|
||||||
} else {
|
else {
|
||||||
if (! empty($object->fk_project)) {
|
if(!empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
$morehtmlref .= '<a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
$morehtmlref.=$proj->ref;
|
$morehtmlref .= $proj->ref;
|
||||||
$morehtmlref.='</a>';
|
$morehtmlref .= '</a>';
|
||||||
} else {
|
}
|
||||||
$morehtmlref.='';
|
else {
|
||||||
}
|
$morehtmlref .= '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
|
||||||
@ -1916,7 +1996,7 @@ elseif (! empty($object->id))
|
|||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Conditions de reglement par defaut
|
// Default terms of the settlement
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
||||||
|
|||||||
@ -1247,7 +1247,7 @@ if (empty($reshook))
|
|||||||
$desc = $productsupplier->desc_supplier;
|
$desc = $productsupplier->desc_supplier;
|
||||||
} else $desc = $productsupplier->description;
|
} else $desc = $productsupplier->description;
|
||||||
|
|
||||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
$type = $productsupplier->type;
|
$type = $productsupplier->type;
|
||||||
$price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT');
|
$price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT');
|
||||||
@ -2495,7 +2495,7 @@ else
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Conditions de reglement par defaut
|
// Default terms of the settlement
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
|
|||||||
@ -1105,7 +1105,7 @@ else
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
|
|
||||||
// User
|
// User
|
||||||
@ -1213,7 +1213,7 @@ else
|
|||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
// Info workflow
|
// Info workflow
|
||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border tableforfield centpercent">'."\n";
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
|
|
||||||
if (! empty($object->fk_user_create))
|
if (! empty($object->fk_user_create))
|
||||||
|
|||||||
@ -38,11 +38,12 @@ if (! $user->admin)
|
|||||||
$action=GETPOST('action', 'aZ09');
|
$action=GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'setproductionmode')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
$status = GETPOST('status', 'alpha');
|
$res1 = dolibarr_set_const($db, 'IFTTT_SERVICE_KEY', GETPOST('IFTTT_SERVICE_KEY', 'alpha'), 'chaine', 0, '', 0);
|
||||||
|
$res2 = dolibarr_set_const($db, 'IFTTT_DOLIBARR_ENDPOINT_SECUREKEY', GETPOST('IFTTT_DOLIBARR_ENDPOINT_SECUREKEY', 'alpha'), 'chaine', 0, '', 0);
|
||||||
|
|
||||||
if (dolibarr_set_const($db, 'IFTTT_PRODUCTION_MODE', $status, 'chaine', 0, '', 0) > 0)
|
if ($res1 > 0 && $res2)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
@ -66,38 +67,44 @@ print load_fiche_titre($langs->trans("IFTTTSetup"), $linkback, 'title_setup');
|
|||||||
print $langs->trans("IFTTTDesc")."<br>\n";
|
print $langs->trans("IFTTTDesc")."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
//print '<form name="apisetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form name="apisetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="set">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print "<td>".$langs->trans("Parameter")."</td>";
|
print "<td>".$langs->trans("Parameter")."</td>";
|
||||||
print '<td class="center">'.$langs->trans("Value")."</td>";
|
print '<td>'.$langs->trans("Value")."</td>";
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
print '<tr class="impair">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("ProductionMode").'</td>';
|
print '<td>'.$langs->trans("IFTTT_SERVICE_KEY").'</td>';
|
||||||
$production_mode=(empty($conf->global->IFTTT_PRODUCTION_MODE)?false:true);
|
print '<td>';
|
||||||
if ($production_mode)
|
print '<input type="text" name="IFTTT_SERVICE_KEY" value="'.$conf->global->IFTTT_SERVICE_KEY.'">';
|
||||||
{
|
print '</td>';
|
||||||
print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setproductionmode&value='.($i+1).'&status=0">';
|
print '<td>'.$langs->trans("YouWillFindItOnYourIFTTTAccount").'</td>';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print '</tr>';
|
||||||
print '</a></td>';
|
|
||||||
}
|
print '<tr class="oddeven">';
|
||||||
else
|
print '<td>'.$langs->trans("IFTTT_DOLIBARR_ENDPOINT_SECUREKEY").'</td>';
|
||||||
{
|
print '<td>';
|
||||||
print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setproductionmode&value='.($i+1).'&status=1">';
|
print '<input type="text" name="IFTTT_DOLIBARR_ENDPOINT_SECUREKEY" value="'.$conf->global->IFTTT_DOLIBARR_ENDPOINT_SECUREKEY.'">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print '</td>';
|
||||||
print '</a></td>';
|
print '<td>'.$langs->trans("DefineAValueOfYourChoice").'</td>';
|
||||||
}
|
|
||||||
print '<td> </td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||||
@ -106,26 +113,13 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
|
|||||||
|
|
||||||
// Show message
|
// Show message
|
||||||
$message='';
|
$message='';
|
||||||
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
|
$url=$urlwithroot.'/ifttt/index.php?securekey='.$conf->global->IFTTT_DOLIBARR_ENDPOINT_SECUREKEY;
|
||||||
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
|
$message.=$langs->trans("UrlForIFTTT").':<br>';
|
||||||
$message.=img_picto('', 'object_globe.png').' '.$url;
|
$message.=img_picto('', 'object_globe.png').' '.$url;
|
||||||
print $message;
|
print $message;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Explorer
|
|
||||||
print '<u>'.$langs->trans("ApiExporerIs").':</u><br>';
|
|
||||||
if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/explorer'))
|
|
||||||
{
|
|
||||||
$url=DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
|
|
||||||
print img_picto('', 'object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $langs->trans("NotAvailableWithThisDistribution");
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -189,7 +189,7 @@ ALTER TABLE llx_socpeople ADD COLUMN linkedin varchar(255) after whatsapp;
|
|||||||
ALTER TABLE llx_adherent ADD COLUMN linkedin varchar(255) after whatsapp;
|
ALTER TABLE llx_adherent ADD COLUMN linkedin varchar(255) after whatsapp;
|
||||||
ALTER TABLE llx_user ADD COLUMN linkedin varchar(255) after whatsapp;
|
ALTER TABLE llx_user ADD COLUMN linkedin varchar(255) after whatsapp;
|
||||||
|
|
||||||
ALTER TABLE llx_expensereport_det ADD COLUMN fk_expensereport_line integer DEFAULT NULL;
|
ALTER TABLE llx_expensereport_det ADD COLUMN fk_ecm_files integer DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE llx_bom_bom(
|
CREATE TABLE llx_bom_bom(
|
||||||
|
|||||||
@ -51,7 +51,7 @@ CREATE TABLE llx_expensereport_det
|
|||||||
multicurrency_total_tva double(24,8) DEFAULT 0,
|
multicurrency_total_tva double(24,8) DEFAULT 0,
|
||||||
multicurrency_total_ttc double(24,8) DEFAULT 0,
|
multicurrency_total_ttc double(24,8) DEFAULT 0,
|
||||||
fk_facture integer DEFAULT 0, -- ID of customer invoice line if expense is rebilled to a customer
|
fk_facture integer DEFAULT 0, -- ID of customer invoice line if expense is rebilled to a customer
|
||||||
fk_expensereport_line integer DEFAULT NULL, -- ID of ECM file that is source document of expense report
|
fk_ecm_files integer DEFAULT NULL, -- ID of ECM file that is source document of expense report
|
||||||
fk_code_ventilation integer DEFAULT 0,
|
fk_code_ventilation integer DEFAULT 0,
|
||||||
rang integer DEFAULT 0, -- position of line
|
rang integer DEFAULT 0, -- position of line
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
|
|||||||
@ -57,3 +57,4 @@ DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
|
|||||||
TakeposNeedsCategories=TakePOS needs product categories to work
|
TakeposNeedsCategories=TakePOS needs product categories to work
|
||||||
OrderNotes=Order Notes
|
OrderNotes=Order Notes
|
||||||
TicketVatGrouped=Group VAT by rate in tickets
|
TicketVatGrouped=Group VAT by rate in tickets
|
||||||
|
AutoPrintTickets=Automatically print tickets
|
||||||
@ -965,3 +965,4 @@ YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
|
|||||||
Inventory=Inventory
|
Inventory=Inventory
|
||||||
AnalyticCode=Analytic code
|
AnalyticCode=Analytic code
|
||||||
TMenuMRP=MRP
|
TMenuMRP=MRP
|
||||||
|
ShowMoreInfos=Show More Infos
|
||||||
@ -42,6 +42,7 @@ LastRecordedServices=Latest %s recorded services
|
|||||||
CardProduct0=Product card
|
CardProduct0=Product card
|
||||||
CardProduct1=Service card
|
CardProduct1=Service card
|
||||||
Stock=Stock
|
Stock=Stock
|
||||||
|
MenuStocks=Stocks
|
||||||
Stocks=Stocks and location (warehouse) of products
|
Stocks=Stocks and location (warehouse) of products
|
||||||
Movements=Movements
|
Movements=Movements
|
||||||
Sell=Sell
|
Sell=Sell
|
||||||
|
|||||||
@ -237,8 +237,7 @@ ModuleSalaryToDefineHourlyRateMustBeEnabled=Module 'Salaries' must be enabled to
|
|||||||
NewTaskRefSuggested=Task ref already used, a new task ref is required
|
NewTaskRefSuggested=Task ref already used, a new task ref is required
|
||||||
TimeSpentInvoiced=Time spent billed
|
TimeSpentInvoiced=Time spent billed
|
||||||
TimeSpentForInvoice=Time spent
|
TimeSpentForInvoice=Time spent
|
||||||
GenerateInvoice=Generate invoice
|
|
||||||
OneLinePerUser=One line per user
|
OneLinePerUser=One line per user
|
||||||
ServiceToUseOnLines=Service to use on lines
|
ServiceToUseOnLines=Service to use on lines
|
||||||
InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project
|
InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project
|
||||||
ProjectBillTimeDescription=Check if you enter timesheet on tasks of project and plan to generate invoice(s) from the timesheet to invoice the customer of project.
|
ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets).
|
||||||
@ -50,3 +50,4 @@ TheoricalAmount=Montant théorique
|
|||||||
RealAmount=Montant réel
|
RealAmount=Montant réel
|
||||||
CashFenceDone=Clôture de caisse faite pour la période
|
CashFenceDone=Clôture de caisse faite pour la période
|
||||||
TicketVatGrouped=Grouper la TVA par taux dans les tickets
|
TicketVatGrouped=Grouper la TVA par taux dans les tickets
|
||||||
|
AutoPrintTickets=Imprimet les tickets automatiquement
|
||||||
@ -194,7 +194,7 @@ if (! empty($_SERVER['DOCUMENT_ROOT']) && substr($_SERVER['DOCUMENT_ROOT'], -6)
|
|||||||
set_include_path($_SERVER['DOCUMENT_ROOT'] . '/htdocs');
|
set_include_path($_SERVER['DOCUMENT_ROOT'] . '/htdocs');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include the conf.php and functions.lib.php
|
// Include the conf.php and functions.lib.php. This defined the constants like DOL_DOCUMENT_ROOT, DOL_DATA_ROOT, DOL_URL_ROOT...
|
||||||
require_once 'filefunc.inc.php';
|
require_once 'filefunc.inc.php';
|
||||||
|
|
||||||
// If there is a POST parameter to tell to save automatically some POST parameters into cookies, we do it.
|
// If there is a POST parameter to tell to save automatically some POST parameters into cookies, we do it.
|
||||||
@ -242,12 +242,24 @@ if (! defined('NOSESSION'))
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init the 5 global objects, this include will make the new and set properties for: $conf, $db, $langs, $user, $mysoc
|
// Init the 5 global objects, this include will make the 'new Xxx()' and set properties for: $conf, $db, $langs, $user, $mysoc
|
||||||
require_once 'master.inc.php';
|
require_once 'master.inc.php';
|
||||||
|
|
||||||
// Activate end of page function
|
// Activate end of page function
|
||||||
register_shutdown_function('dol_shutdown');
|
register_shutdown_function('dol_shutdown');
|
||||||
|
|
||||||
|
// Load debugbar
|
||||||
|
if (! empty($conf->debugbar->enabled))
|
||||||
|
{
|
||||||
|
global $debugbar;
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/debugbar/class/DebugBar.php';
|
||||||
|
$debugbar = new DolibarrDebugBar();
|
||||||
|
$renderer = $debugbar->getRenderer();
|
||||||
|
$conf->global->MAIN_HTML_HEADER .= $renderer->renderHead();
|
||||||
|
|
||||||
|
$debugbar['time']->startMeasure('pageaftermaster', 'Page generation (after environment init)');
|
||||||
|
}
|
||||||
|
|
||||||
// Detection browser
|
// Detection browser
|
||||||
if (isset($_SERVER["HTTP_USER_AGENT"]))
|
if (isset($_SERVER["HTTP_USER_AGENT"]))
|
||||||
{
|
{
|
||||||
@ -1582,7 +1594,10 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="login_block">'."\n";
|
$loginBlockMoreClass = '';
|
||||||
|
if (!empty($conf->global->MAIN_TOP_MENU_DROPDOWN)) { $loginBlockMoreClass = 'usedropdown'; }
|
||||||
|
|
||||||
|
print '<div class="login_block '.$loginBlockMoreClass.'">'."\n";
|
||||||
|
|
||||||
// Add login user link
|
// Add login user link
|
||||||
$toprightmenu.='<div class="login_block_user">';
|
$toprightmenu.='<div class="login_block_user">';
|
||||||
@ -1590,7 +1605,13 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||||||
// Login name with photo and tooltip
|
// Login name with photo and tooltip
|
||||||
$mode=-1;
|
$mode=-1;
|
||||||
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
|
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
|
||||||
$toprightmenu.=$user->getNomUrl($mode, '', 1, 0, 11, 0, ($user->firstname ? 'firstname' : -1), 'atoplogin');
|
|
||||||
|
if (empty($conf->global->MAIN_TOP_MENU_DROPDOWN)){
|
||||||
|
$toprightmenu.= $user->getNomUrl($mode, '', 1, 0, 11, 0, ($user->firstname ? 'firstname' : -1), 'atoplogin');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$toprightmenu.= top_menu_user($user, $langs);
|
||||||
|
}
|
||||||
$toprightmenu.='</div></div>';
|
$toprightmenu.='</div></div>';
|
||||||
|
|
||||||
$toprightmenu.='</div>'."\n";
|
$toprightmenu.='</div>'."\n";
|
||||||
@ -1683,8 +1704,9 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Logout link
|
// Logout link
|
||||||
$toprightmenu.=@Form::textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem', 2);
|
$toprightmenu.=@Form::textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem logout-btn', 2);
|
||||||
|
|
||||||
$toprightmenu.='</div>';
|
$toprightmenu.='</div>';
|
||||||
|
|
||||||
@ -1702,6 +1724,147 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the tooltip on user login
|
||||||
|
*
|
||||||
|
* @param user $user User object
|
||||||
|
* @param Translate $langs Language object
|
||||||
|
* @return string HTML content
|
||||||
|
*/
|
||||||
|
function top_menu_user(User $user, Translate $langs)
|
||||||
|
{
|
||||||
|
global $langs, $conf, $db, $hookmanager, $user;
|
||||||
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
|
global $menumanager;
|
||||||
|
|
||||||
|
$userImage = $userDropDownImage = '';
|
||||||
|
if (! empty($user->photo))
|
||||||
|
{
|
||||||
|
$userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1);
|
||||||
|
$userDropDownImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'dropdown-user-image', 'small', 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$dropdownBody = '';
|
||||||
|
$dropdownBody.= '<span id="topmenuloginmoreinfo-btn"><i class="fa fa-caret-right"></i> '.$langs->trans("ShowMoreInfos").'</span>';
|
||||||
|
$dropdownBody.= '<div id="topmenuloginmoreinfo" >';
|
||||||
|
|
||||||
|
// login infos
|
||||||
|
if (!empty($user->admin)) {
|
||||||
|
$dropdownBody.= '<br><b>' . $langs->trans("Administrator").'</b>: '.yn($user->admin);
|
||||||
|
}
|
||||||
|
if (! empty($user->socid)) // Add thirdparty for external users
|
||||||
|
{
|
||||||
|
$thirdpartystatic = new Societe($db);
|
||||||
|
$thirdpartystatic->fetch($user->socid);
|
||||||
|
$companylink = ' '.$thirdpartystatic->getNomUrl(2); // picto only of company
|
||||||
|
$company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')';
|
||||||
|
}
|
||||||
|
$type=($user->socid?$langs->trans("External").$company:$langs->trans("Internal"));
|
||||||
|
$dropdownBody.= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type;
|
||||||
|
$dropdownBody.= '<br><b>' . $langs->trans("Status").'</b>: '.$user->getLibStatut(0);
|
||||||
|
$dropdownBody.= '<br>';
|
||||||
|
|
||||||
|
$dropdownBody.= '<br><u>'.$langs->trans("Connection").'</u>';
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
|
||||||
|
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $dropdownBody.= '<br><b>'.$langs->trans("ConnectedOnMultiCompany").':</b> '.$conf->entity.' (user entity '.$user->entity.')';
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("AuthenticationMode").':</b> '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("ConnectedSince").':</b> '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser');
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("PreviousConnexion").':</b> '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser');
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("CurrentTheme").':</b> '.$conf->theme;
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("CurrentMenuManager").':</b> '.$menumanager->name;
|
||||||
|
$langFlag=picto_from_langcode($langs->getDefaultLang());
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("CurrentUserLanguage").':</b> '.($langFlag?$langFlag.' ':'').$langs->getDefaultLang();
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("Browser").':</b> '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("Layout").':</b> '.$conf->browser->layout;
|
||||||
|
$dropdownBody.= '<br><b>'.$langs->trans("Screen").':</b> '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
||||||
|
if ($conf->browser->layout == 'phone') $dropdownBody.= '<br><b>'.$langs->trans("Phone").':</b> '.$langs->trans("Yes");
|
||||||
|
if (! empty($_SESSION["disablemodules"])) $dropdownBody.= '<br><b>'.$langs->trans("DisabledModules").':</b> <br>'.join(', ', explode(',', $_SESSION["disablemodules"]));
|
||||||
|
$dropdownBody.= '</div>';
|
||||||
|
|
||||||
|
// Execute hook
|
||||||
|
$parameters=array('user'=>$user, 'langs' => $langs);
|
||||||
|
$result=$hookmanager->executeHooks('printTopRightMenuLoginDropdownBody', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (is_numeric($result))
|
||||||
|
{
|
||||||
|
if ($result == 0){
|
||||||
|
$dropdownBody.= $hookmanager->resPrint; // add
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$dropdownBody = $hookmanager->resPrint; // replace
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$logoutLink ='<a accesskey="l" href="'.DOL_URL_ROOT.'/user/logout.php" class="button-top-menu-dropdown" ><i class="fa fa-sign-out-alt"></i> '.$langs->trans("Logout").'</a>';
|
||||||
|
$profilLink ='<a accesskey="l" href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="button-top-menu-dropdown" ><i class="fa fa-user"></i> '.$langs->trans("Card").'</a>';
|
||||||
|
|
||||||
|
|
||||||
|
$profilName = $user->getFullName($langs).' ('.$user->login.')';
|
||||||
|
|
||||||
|
if($user->admin){
|
||||||
|
$profilName = '<i class="far fa-star classfortooltip" title="'.$langs->trans("Administrator").'" ></i> '.$profilName;
|
||||||
|
}
|
||||||
|
|
||||||
|
$btnUser = '
|
||||||
|
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu">
|
||||||
|
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle" data-toggle="dropdown">
|
||||||
|
'.$userImage.'
|
||||||
|
<span class="hidden-xs maxwidth200">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 11).'</span>
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<!-- User image -->
|
||||||
|
<div class="user-header">
|
||||||
|
'.$userDropDownImage.'
|
||||||
|
|
||||||
|
<p>
|
||||||
|
'.$profilName.'
|
||||||
|
<br/><small class="classfortooltip" title="'.$langs->trans("PreviousConnexion").'" ><i class="fa fa-user-clock"></i> '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser').'</small>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Menu Body -->
|
||||||
|
<div class="user-body">'.$dropdownBody.'</div>
|
||||||
|
|
||||||
|
<!-- Menu Footer-->
|
||||||
|
<div class="user-footer">
|
||||||
|
<div class="pull-left">
|
||||||
|
'.$profilLink.'
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
'.$logoutLink.'
|
||||||
|
</div>
|
||||||
|
<div style="clear:both;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
$(document).on("click", function(event) {
|
||||||
|
if (!$(event.target).closest("#topmenu-login-dropdown").length) {
|
||||||
|
// Hide the menus.
|
||||||
|
$("#topmenu-login-dropdown").removeClass("open");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
$("#topmenu-login-dropdown").toggleClass("open");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#topmenuloginmoreinfo-btn").on("click", function() {
|
||||||
|
$("#topmenuloginmoreinfo").slideToggle();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
return $btnUser;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show left menu bar
|
* Show left menu bar
|
||||||
*
|
*
|
||||||
|
|||||||
@ -115,8 +115,6 @@ $helpurl='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
|||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
$htmlother=new FormOther($db);
|
$htmlother=new FormOther($db);
|
||||||
|
|
||||||
$title=$langs->trans("ProductsAndServices");
|
|
||||||
|
|
||||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
|
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
|
||||||
$sql.= ' p.fk_product_type, p.tms as datem,';
|
$sql.= ' p.fk_product_type, p.tms as datem,';
|
||||||
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
||||||
@ -191,22 +189,22 @@ if ($resql)
|
|||||||
} else {
|
} else {
|
||||||
$texte = $langs->trans("ProductsAndServices");
|
$texte = $langs->trans("ProductsAndServices");
|
||||||
}
|
}
|
||||||
$texte.=' ('.$langs->trans("Stocks").')';
|
$texte.=' ('.$langs->trans("MenuStocks").')';
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||||
if ($sall) $param.="&sall=".$sall;
|
if ($sall) $param.="&sall=".urlencode($sall);
|
||||||
if ($tosell) $param.="&tosell=".$tosell;
|
if ($tosell) $param.="&tosell=".urlencode($tosell);
|
||||||
if ($tobuy) $param.="&tobuy=".$tobuy;
|
if ($tobuy) $param.="&tobuy=".urlencode($tobuy);
|
||||||
if ($type) $param.="&type=".$type;
|
if ($type) $param.="&type=".urlencode($type);
|
||||||
if ($fourn_id) $param.="&fourn_id=".$fourn_id;
|
if ($fourn_id) $param.="&fourn_id=".urlencode($fourn_id);
|
||||||
if ($snom) $param.="&snom=".$snom;
|
if ($snom) $param.="&snom=".urlencode($snom);
|
||||||
if ($sref) $param.="&sref=".$sref;
|
if ($sref) $param.="&sref=".urlencode($sref);
|
||||||
if ($search_sale) $param.="&search_sale=".$search_sale;
|
if ($search_sale) $param.="&search_sale=".urlencode($search_sale);
|
||||||
if ($search_categ) $param.="&search_categ=".$search_categ;
|
if ($search_categ) $param.="&search_categ=".urlencode($search_categ);
|
||||||
if ($toolowstock) $param.="&toolowstock=".$toolowstock;
|
if ($toolowstock) $param.="&toolowstock=".urlencode($toolowstock);
|
||||||
if ($sbarcode) $param.="&sbarcode=".$sbarcode;
|
if ($sbarcode) $param.="&sbarcode=".urlencode($sbarcode);
|
||||||
if ($catid) $param.="&catid=".$catid;
|
if ($catid) $param.="&catid=".urlencode($catid);
|
||||||
|
|
||||||
llxHeader("", $texte, $helpurl);
|
llxHeader("", $texte, $helpurl);
|
||||||
|
|
||||||
|
|||||||
@ -180,7 +180,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||||
@ -233,7 +233,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
|
|||||||
@ -157,7 +157,7 @@ print '<div class="fichecenter">';
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||||
@ -210,7 +210,7 @@ print '<div class="fichehalfright">';
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
|
|||||||
@ -356,7 +356,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||||
@ -409,7 +409,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
|
|||||||
@ -220,7 +220,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||||
@ -254,7 +254,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
|
|||||||
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->load('projects');
|
$langs->loadLangs(array('projects','bills','orders'));
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||||
@ -149,47 +149,61 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
if ($id || $ref)
|
if ($id || $ref)
|
||||||
{
|
{
|
||||||
$object->fetch($id, $ref);
|
$object->fetch($id, $ref);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$object->fetch(GETPOST('taskid', 'int'));
|
if (! GETPOST('taskid', 'int') || GETPOST('taskid', 'int') < 0)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), null, 'errors');
|
||||||
|
$action='createtime';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->fetch(GETPOST('taskid', 'int'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$object->fetch_projet();
|
|
||||||
|
|
||||||
if (empty($object->project->statut))
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ProjectMustBeValidatedFirst"), null, 'errors');
|
$object->fetch_projet();
|
||||||
$error++;
|
|
||||||
}
|
if (empty($object->project->statut))
|
||||||
else
|
{
|
||||||
{
|
setEventMessages($langs->trans("ProjectMustBeValidatedFirst"), null, 'errors');
|
||||||
$object->timespent_note = $_POST["timespent_note"];
|
$action='createtime';
|
||||||
if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value
|
$error++;
|
||||||
$object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds
|
}
|
||||||
$object->timespent_duration+= ($_POST["timespent_durationmin"]?$_POST["timespent_durationmin"]:0)*60; // We store duration in seconds
|
else
|
||||||
if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) // If hour was entered
|
{
|
||||||
{
|
$object->timespent_note = $_POST["timespent_note"];
|
||||||
$object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
|
if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value
|
||||||
$object->timespent_withhour = 1;
|
$object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds
|
||||||
}
|
$object->timespent_duration+= ($_POST["timespent_durationmin"]?$_POST["timespent_durationmin"]:0)*60; // We store duration in seconds
|
||||||
else
|
if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) // If hour was entered
|
||||||
{
|
{
|
||||||
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
|
$object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
|
||||||
}
|
$object->timespent_withhour = 1;
|
||||||
$object->timespent_fk_user = $_POST["userid"];
|
}
|
||||||
$result=$object->addTimeSpent($user);
|
else
|
||||||
if ($result >= 0)
|
{
|
||||||
{
|
$object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
|
||||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
}
|
||||||
}
|
$object->timespent_fk_user = $_POST["userid"];
|
||||||
else
|
$result=$object->addTimeSpent($user);
|
||||||
{
|
if ($result >= 0)
|
||||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
{
|
||||||
$error++;
|
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -488,7 +502,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||||
@ -522,7 +536,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
@ -809,7 +823,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
|||||||
if (! empty($withproject) && $projectstatic->bill_time)
|
if (! empty($withproject) && $projectstatic->bill_time)
|
||||||
{
|
{
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'generateinvoice'=>$langs->trans("GenerateInvoice"),
|
'generateinvoice'=>$langs->trans("GenerateBill"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if ($user->rights->projet->creer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
//if ($user->rights->projet->creer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||||
@ -901,7 +915,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoice').'"> ';
|
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> ';
|
||||||
print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
|
print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -1109,7 +1123,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
|||||||
$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
|
|||||||
88
htdocs/public/ifttt/index.php
Normal file
88
htdocs/public/ifttt/index.php
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/public/ifttt/index.php
|
||||||
|
* \ingroup ifttt
|
||||||
|
* \brief Page to IFTTT endpoint agenda
|
||||||
|
* http://127.0.0.1/dolibarr/public/ifttt/index.php?securekey=...
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
|
||||||
|
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no menu to show
|
||||||
|
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
|
||||||
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||||
|
if (! defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged.
|
||||||
|
if (! defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
|
||||||
|
|
||||||
|
// This is a wrapper, so header is empty
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header function
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function llxHeaderVierge()
|
||||||
|
{
|
||||||
|
print '<html><title>IFTTT API</title><body>';
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Footer function
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function llxFooterVierge()
|
||||||
|
{
|
||||||
|
print '</body></html>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (empty($conf->ifttt->enabled)) accessforbidden('', 0, 0, 1);
|
||||||
|
|
||||||
|
// Check config
|
||||||
|
if (empty($conf->global->IFTTT_DOLIBARR_ENDPOINT_SECUREKEY))
|
||||||
|
{
|
||||||
|
$user->getrights();
|
||||||
|
|
||||||
|
llxHeaderVierge();
|
||||||
|
print '<div class="error">Module Agenda was not configured properly.</div>';
|
||||||
|
llxFooterVierge();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check exportkey
|
||||||
|
if (empty($_GET["securekey"]) || $conf->global->IFTTT_DOLIBARR_ENDPOINT_SECUREKEY != $_GET["securekey"])
|
||||||
|
{
|
||||||
|
$user->getrights();
|
||||||
|
|
||||||
|
llxHeaderVierge();
|
||||||
|
print '<div class="error">Bad value for securekey.</div>';
|
||||||
|
llxFooterVierge();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
||||||
|
$hookmanager->initHooks(array('iftttapi'));
|
||||||
|
|
||||||
|
|
||||||
|
llxHeaderVierge();
|
||||||
|
print '<div class="error">TODO</div>';
|
||||||
|
llxFooterVierge();
|
||||||
@ -630,7 +630,7 @@ if (empty($reshook))
|
|||||||
$desc = $productsupplier->desc_supplier;
|
$desc = $productsupplier->desc_supplier;
|
||||||
} else $desc = $productsupplier->description;
|
} else $desc = $productsupplier->description;
|
||||||
|
|
||||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
$pu_ht = $productsupplier->fourn_pu;
|
$pu_ht = $productsupplier->fourn_pu;
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,7 @@ if (GETPOST('action', 'alpha') == 'set')
|
|||||||
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
@ -124,6 +125,13 @@ if (! empty($conf->service->enabled))
|
|||||||
print $form->selectyesno("CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1);
|
print $form->selectyesno("CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $langs->trans("AutoPrintTickets");
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AUTO_PRINT_TICKETS, 1);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
|
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
|
||||||
|
|||||||
@ -376,7 +376,8 @@ if ($action=="valid")
|
|||||||
{
|
{
|
||||||
print '<p style="font-size:120%;" class="center"><b>'.$invoice->ref." ".$langs->trans('BillShortStatusValidated').'</b></p>';
|
print '<p style="font-size:120%;" class="center"><b>'.$invoice->ref." ".$langs->trans('BillShortStatusValidated').'</b></p>';
|
||||||
if ($conf->global->TAKEPOSCONNECTOR) print '<center><button type="button" onclick="TakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button><center>';
|
if ($conf->global->TAKEPOSCONNECTOR) print '<center><button type="button" onclick="TakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button><center>';
|
||||||
else print '<center><button type="button" onclick="Print('.$placeid.');">'.$langs->trans('PrintTicket').'</button><center>';
|
else print '<center><button id="buttonprint" type="button" onclick="Print('.$placeid.');">'.$langs->trans('PrintTicket').'</button><center>';
|
||||||
|
if($conf->global->TAKEPOS_AUTO_PRINT_TICKETS) print '<script language="javascript">$("#buttonprint").click();</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "search")
|
if ($action == "search")
|
||||||
|
|||||||
169
htdocs/theme/eldy/dropdown.css.php
Normal file
169
htdocs/theme/eldy/dropdown.css.php
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||||
|
/* <style type="text/css" > */
|
||||||
|
/*
|
||||||
|
Dropdown
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
.open>.dropdown-menu{ /*, #topmenu-login-dropdown:hover .dropdown-menu*/
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu {
|
||||||
|
box-shadow: none;
|
||||||
|
border-color: #eee;
|
||||||
|
}
|
||||||
|
.dropdown-menu {
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
display: none;
|
||||||
|
float: left;
|
||||||
|
min-width: 160px;
|
||||||
|
padding: 5px 0;
|
||||||
|
margin: 2px 0 0;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: left;
|
||||||
|
list-style: none;
|
||||||
|
background-color: #fff;
|
||||||
|
-webkit-background-clip: padding-box;
|
||||||
|
background-clip: padding-box;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||||
|
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MENU Dropdown
|
||||||
|
*/
|
||||||
|
.login_block.usedropdown .logout-btn{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tmenu .open.dropdown, .login_block .open.dropdown, .tmenu .open.dropdown, .login_block .dropdown:hover{
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.tmenu .dropdown-menu, .login_block .dropdown-menu {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
left: auto;
|
||||||
|
line-height:1.3em;
|
||||||
|
}
|
||||||
|
.tmenu .dropdown-menu, .login_block .dropdown-menu .user-body {
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
}
|
||||||
|
.user-body {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.side-nav-vert .user-menu .dropdown-menu {
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
padding: 1px 0 0 0;
|
||||||
|
border-top-width: 0;
|
||||||
|
width: 280px;
|
||||||
|
}
|
||||||
|
.side-nav-vert .user-menu .dropdown-menu {
|
||||||
|
margin-top: 0;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-nav-vert .user-menu .dropdown-menu > .user-header {
|
||||||
|
height: 175px;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-user-image {
|
||||||
|
border-radius: 50%;
|
||||||
|
vertical-align: middle;
|
||||||
|
z-index: 5;
|
||||||
|
height: 90px;
|
||||||
|
width: 90px;
|
||||||
|
border: 3px solid;
|
||||||
|
border-color: transparent;
|
||||||
|
border-color: rgba(255, 255, 255, 0.2);
|
||||||
|
max-width: 100%;
|
||||||
|
max-height :100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu > .user-header{
|
||||||
|
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu > .user-footer {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-footer:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu > .user-body {
|
||||||
|
padding: 15px;
|
||||||
|
border-bottom: 1px solid #f4f4f4;
|
||||||
|
border-top: 1px solid #dddddd;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
#topmenu-login-dropdown{
|
||||||
|
padding: 0 5px 0 5px;
|
||||||
|
}
|
||||||
|
#topmenu-login-dropdown a:hover{
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#topmenuloginmoreinfo-btn{
|
||||||
|
display: block;
|
||||||
|
text-aling: right;
|
||||||
|
color:#666;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#topmenuloginmoreinfo{
|
||||||
|
display: none;
|
||||||
|
clear: both;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-top-menu-dropdown {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 6px 12px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.42857143;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
vertical-align: middle;
|
||||||
|
-ms-touch-action: manipulation;
|
||||||
|
touch-action: manipulation;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
background-image: none;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-footer .button-top-menu-dropdown {
|
||||||
|
color: #666666;
|
||||||
|
border-radius: 0;
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
border-width: 1px;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
border-color: #ddd;
|
||||||
|
}
|
||||||
@ -263,7 +263,7 @@ hr { border: 0; border-top: 1px solid #ccc; }
|
|||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
font-family: <?php print $fontlist ?>;
|
font-family: <?php print $fontlist ?>;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 4px 14px;
|
padding: 4px 14px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -363,6 +363,9 @@ th .button {
|
|||||||
textarea.centpercent {
|
textarea.centpercent {
|
||||||
width: 96%;
|
width: 96%;
|
||||||
}
|
}
|
||||||
|
.small, small {
|
||||||
|
font-size: 85%;
|
||||||
|
}
|
||||||
.center {
|
.center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px auto;
|
margin: 0px auto;
|
||||||
@ -376,6 +379,12 @@ textarea.centpercent {
|
|||||||
.justify {
|
.justify {
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
}
|
}
|
||||||
|
.pull-left {
|
||||||
|
float: left!important;
|
||||||
|
}
|
||||||
|
.pull-right {
|
||||||
|
float: right!important;
|
||||||
|
}
|
||||||
.nowrap {
|
.nowrap {
|
||||||
white-space: <?php print ($dol_optimize_smallscreen?'normal':'nowrap'); ?>;
|
white-space: <?php print ($dol_optimize_smallscreen?'normal':'nowrap'); ?>;
|
||||||
}
|
}
|
||||||
@ -1312,6 +1321,16 @@ div#tmenu_tooltip {
|
|||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
padding-<?php echo $right; ?>: <?php echo ($maxwidthloginblock - 10); ?>px;
|
padding-<?php echo $right; ?>: <?php echo ($maxwidthloginblock - 10); ?>px;
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
-webkit-touch-callout: none; /* iOS Safari */
|
||||||
|
-webkit-user-select: none; /* Safari */
|
||||||
|
-khtml-user-select: none; /* Konqueror HTML */
|
||||||
|
-moz-user-select: none; /* Firefox */
|
||||||
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||||
|
user-select: none; /* Non-prefixed version, currently
|
||||||
|
supported by Chrome and Opera */
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div.topmenuimage {
|
div.topmenuimage {
|
||||||
@ -1810,13 +1829,15 @@ div.login_block {
|
|||||||
<?php print $right; ?>: 0;
|
<?php print $right; ?>: 0;
|
||||||
top: <?php print $disableimages?'4px':'0'; ?>;
|
top: <?php print $disableimages?'4px':'0'; ?>;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
<?php echo (empty($disableimages) && $maxwidthloginblock)?'max-width: '.$maxwidthloginblock.'px;':''; ?>
|
line-height: 10px;
|
||||||
|
<?php // echo (empty($disableimages) && $maxwidthloginblock)?'max-width: '.$maxwidthloginblock.'px;':''; ?>
|
||||||
<?php if (GETPOST('optioncss', 'aZ09') == 'print') { ?>
|
<?php if (GETPOST('optioncss', 'aZ09') == 'print') { ?>
|
||||||
display: none;
|
display: none;
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
}
|
}
|
||||||
div.login_block a {
|
div.login_block a {
|
||||||
color: #<?php echo $colortextbackvmenu; ?>;
|
color: #<?php echo $colortextbackhmenu; ?>;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
div.login_block table {
|
div.login_block table {
|
||||||
display: inline;
|
display: inline;
|
||||||
@ -1838,21 +1859,19 @@ div.login a:hover {
|
|||||||
}
|
}
|
||||||
div.login_block_user {
|
div.login_block_user {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-top: 3px;
|
|
||||||
<?php if (empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { ?>
|
|
||||||
min-width: 120px;
|
|
||||||
<?php } ?>
|
|
||||||
}
|
}
|
||||||
div.login_block_other {
|
div.login_block_other {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
clear: <?php echo $disableimages?'none':'both'; ?>;
|
clear: <?php echo $disableimages?'none':'both'; ?>;
|
||||||
}
|
}
|
||||||
div.login_block_other { padding-top: 3px; text-align: right; }
|
div.login_block_other { padding-top: 0; text-align: right; }
|
||||||
.login_block_elem {
|
.login_block_elem {
|
||||||
float: right;
|
float: right;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
padding: 0px 3px 0px 4px !important;
|
padding: 0px 3px 0px 4px !important;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
line-height: 50px;
|
||||||
|
height: 50px;
|
||||||
}
|
}
|
||||||
.atoplogin, .atoplogin:hover {
|
.atoplogin, .atoplogin:hover {
|
||||||
color: #<?php echo $colortextbackhmenu; ?> !important;
|
color: #<?php echo $colortextbackhmenu; ?> !important;
|
||||||
@ -1865,6 +1884,7 @@ div.login_block_other { padding-top: 3px; text-align: right; }
|
|||||||
}
|
}
|
||||||
.login_block_getinfo .atoplogin, .login_block_getinfo .atoplogin:hover {
|
.login_block_getinfo .atoplogin, .login_block_getinfo .atoplogin:hover {
|
||||||
color: #333 !important;
|
color: #333 !important;
|
||||||
|
font-weight: normal !important;
|
||||||
}
|
}
|
||||||
.alogin, .alogin:hover {
|
.alogin, .alogin:hover {
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
@ -1885,9 +1905,10 @@ img.login, img.printer, img.entity {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto { /* size for user photo in login bar */
|
.userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto { /* size for user photo in login bar */
|
||||||
width: 16px;
|
width: 32px;
|
||||||
height: 16px;
|
height: 32px;
|
||||||
border-radius: 8px;
|
border-radius: 50%;
|
||||||
|
background-size: contain;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
}
|
}
|
||||||
img.userphoto { /* size for user photo in lists */
|
img.userphoto { /* size for user photo in lists */
|
||||||
@ -3022,6 +3043,9 @@ table.tableforservicepart1 tr td {
|
|||||||
border-top: none !important;
|
border-top: none !important;
|
||||||
margin: 0px 0px 0px 0px !important;
|
margin: 0px 0px 0px 0px !important;
|
||||||
}
|
}
|
||||||
|
table.noborder.paymenttable {
|
||||||
|
border-bottom: none !important;
|
||||||
|
}
|
||||||
.paymenttable tr td:first-child, .margintable tr td:first-child
|
.paymenttable tr td:first-child, .margintable tr td:first-child
|
||||||
{
|
{
|
||||||
padding-left: 2px;
|
padding-left: 2px;
|
||||||
@ -5688,6 +5712,7 @@ div.tabsElem a.tab {
|
|||||||
}
|
}
|
||||||
.login_block_elem {
|
.login_block_elem {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
|
height: 38px;
|
||||||
}
|
}
|
||||||
li.tmenu, li.tmenusel {
|
li.tmenu, li.tmenusel {
|
||||||
min-width: 32px;
|
min-width: 32px;
|
||||||
@ -5719,3 +5744,6 @@ div.tabsElem a.tab {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<?php
|
||||||
|
include dol_buildpath($path.'/theme/'.$theme.'/dropdown.css.php', 0);
|
||||||
|
|||||||
@ -1243,6 +1243,7 @@ div.login_block {
|
|||||||
/* border-right: none ! important; */
|
/* border-right: none ! important; */
|
||||||
top: inherit !important;
|
top: inherit !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.side-nav {
|
.side-nav {
|
||||||
<?php if (in_array($conf->browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
|
<?php if (in_array($conf->browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
@ -2003,6 +2004,10 @@ table.login_table_securitycode tr td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.atoplogin.dropdown .dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
div.login_block {
|
div.login_block {
|
||||||
border-right: 1px solid rgba(0,0,0,0.3);
|
border-right: 1px solid rgba(0,0,0,0.3);
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
|
|||||||
@ -399,7 +399,7 @@ if ($projectid > 0) {
|
|||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
|
print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
|
||||||
|
|||||||
@ -72,9 +72,19 @@ class UserGroup extends CommonObject
|
|||||||
|
|
||||||
public $globalgroup; // Global group
|
public $globalgroup; // Global group
|
||||||
|
|
||||||
public $datec; // Creation date of group
|
/**
|
||||||
|
* Date creation record (datec)
|
||||||
|
*
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
public $datec;
|
||||||
|
|
||||||
public $datem; // Modification date of group
|
/**
|
||||||
|
* Date modification record (tms)
|
||||||
|
*
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
public $datem;
|
||||||
|
|
||||||
public $note; // Description
|
public $note; // Description
|
||||||
|
|
||||||
@ -100,7 +110,7 @@ class UserGroup extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Charge un objet group avec toutes ces caracteristiques (except ->members array)
|
* Charge un objet group avec toutes ses caracteristiques (except ->members array)
|
||||||
*
|
*
|
||||||
* @param int $id Id of group to load
|
* @param int $id Id of group to load
|
||||||
* @param string $groupname Name of group to load
|
* @param string $groupname Name of group to load
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user