Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop_new_task_progress_bar

This commit is contained in:
ATM john 2019-08-10 15:41:49 +02:00
commit 527e4dcf46
46 changed files with 629 additions and 175 deletions

109
ChangeLog
View File

@ -17,6 +17,115 @@ Following changes may create regressions for some external modules, but were nec
* Removed the method liste_array() of project class. It was not used by core code.
***** ChangeLog for 10.0.1 compared to 10.0.0 *****
FIX: #10930
FIX: #10984
FIX: reposition on "Build backup" button
FIX: #11400
FIX: #11412
FIX: #11460
FIX: #11463
FIX: #11466
FIX: #11492
FIX: #11498
FIX: #11505
FIX: #11506
FIX: #11507
FIX: #11509
FIX: #11537
FIX: #11543
FIX: #11553
FIX: #11576
FIX: #11584
FIX: #11590
FIX: accounting mode must be taken from global conf, because there's no way to choose a mode with interface
FIX: Add message from public interface
FIX: add missing hook calls
FIX: Add warning when setup is strange
FIX: ajax call for line positioning when CSRFCHECK_WITH_TOKEN is on
FIX: API return 404 sometimes even if API exists
FIX: Attachment was lost when we validate an expense report
FIX: avoid conflict with "$classname" in card.php
FIX: Bad sql request
FIX: better compatibility with multicompany transverse mode
FIX: Better PHP compatibility
FIX: Block to link with tickets
FIX: Can't submit a ticket from public interface
FIX: categories import: prevent mismatch between category type and object type
FIX: Closing ticket from public interface
FIX: Column 'paid' missing in expense report
FIX: compatibility mysql 8. rank is reserved
FIX: Computed field were not calculated into lists.
FIX: Content of email for subscription
FIX: correct error in files with multiple spaces
FIX: CVE-2019-11199
FIX: delete of links between objects
FIX: div not balanced
FIX: do not return formatted prices in json string
FIX: duplicate on the check (TODO field $onetrtd not used ?)
FIX: element name in update_price
FIX: empty product_use_units in product configuration
FIX: expedition card: infinite loop for printObjectLine hook if return > 0
FIX: extrafield loading bug due to assumption that an object is a third party while it may be a contact if MAIN_USE_COMPANY_NAME_OF_CONTACT is set.
FIX: Fatal error on dol_htmloutput_mesg with corrupted array
FIX: Fatal situation if payment removed on expense report. Action
FIX: FEC Format - Missing date_creation in general ledger when you add a new transaction
FIX: FEC Format - Save translation of the journal label in database & nowrap on amount
FIX: floating point precision errors in the triggers of the workflow module
FIX: for #11232
FIX: format of field with type timestamp
FIX: fournrprice log for insert
FIX: help text
FIX: import filter error
FIX: __INFOS__ tag not exists
FIX: issue #9300: install error with PostgreSQL when using custom table prefix
FIX: Language key
FIX: Limit of uploaded files (max_post_size was not used)
FIX: list of balance of leaves
FIX: minor spelling issues
FIX: missing "dropdown-icon" replacement
FIX: Missing field "Conciliated" into bank transaction export
FIX: missing filter by current contact
FIX: missing token
FIX: Missing where on entity
FIX: move sql request in INNER JOIN
FIX: name was able to be in field but went back to new line
FIX: Nowrap on amount
FIX: Online payment
FIX: on shipment delete confirm dialog, a new checkbox allows the user to choose if they want their stock re-incremented after the deletion.
FIX: option EXPORT_LABEL_FOR_SELECT to restore compatibility in export
FIX: Option THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION
FIX: outdated phpdoc
FIX: Permission for BOM menu
FIX: permission to delete a draft purchase order
FIX: phpcs
FIX: Position was lost when we edit the line of template invoice
FIX: product_use_units was set to 0 each time a conf in block other was set
FIX: propal createFrom hook: undefined parameter attached
FIX: Responsive of public interface of ticket
FIX: search by phone pro
FIX: Setup of TakePos was not possible after a clean install
FIX: Show list of events on tickets
FIX: socpeople assigned list in action com list
FIX: SQL problem on donation & nowrap on amount
FIX: stock increase on shipment deletion if STOCK_CALCULATE_ON_SHIPMENT_NEW: is set
FIX: stripe webhook ID constant set
FIX: summary of time spent in preview tab of projects
FIX: the feature to bill time spent was not enabled.
FIX: The new feature to attach document on lines was not correclty
FIX: The proposed new supplier code does not work
FIX: this function can not be private
FIX: tk9877 - PDF rouget requires product.lib.php (otherwise measuring_units_string() is not defined)
FIX: Update the file index table when we validate/rename a ref.
FIX: use rounding to compare the amounts
FIX: We must save code instead of value in database for template invoice modelpdf
FIX: we need to be able to add freeline with qty between 0 & 1 in supplierorder line
FIX: We should remove property comments only for project and task api.
FIX: When saving an action it didn't save the label based on the type of event if the label is empty and the type is customized
FIX: when STOCK_CALCULATE_ON_SHIPMENT_NEW: is set, deleting a "closed" shipment now increases stock as expected
FIX: wrong path sociales/index.php doesnt exist anymore
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
For Users:
NEW: Module "Ticket" is available as a stable module.

View File

@ -368,7 +368,7 @@ class Documents extends DolibarrApi
throw new RestException(404, 'Product not found');
}
$upload_dir = $conf->product->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'product');
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
}
elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
{

View File

@ -530,11 +530,11 @@ class Propal extends CommonObject
$pu_ht_devise = $tabprice[19];
// Rang to use
$rangtouse = $rang;
if ($rangtouse == -1)
$ranktouse = $rang;
if ($ranktouse == -1)
{
$rangmax = $this->line_max($fk_parent_line);
$rangtouse = $rangmax + 1;
$ranktouse = $rangmax + 1;
}
// TODO A virer
@ -568,7 +568,7 @@ class Propal extends CommonObject
$this->line->fk_remise_except=$fk_remise_except;
$this->line->remise_percent=$remise_percent;
$this->line->subprice=$pu_ht;
$this->line->rang=$rangtouse;
$this->line->rang=$ranktouse;
$this->line->info_bits=$info_bits;
$this->line->total_ht=$total_ht;
$this->line->total_tva=$total_tva;

View File

@ -168,6 +168,7 @@ $arrayfields=array(
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'p.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500),
'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
);
// Extra fields
@ -269,7 +270,7 @@ $sql.= " typent.code as typent_code,";
$sql.= " ava.rowid as availability,";
$sql.= " state.code_departement as state_code, state.nom as state_name,";
$sql.= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
$sql.= ' p.datec as date_creation, p.tms as date_update,';
$sql.= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
$sql.= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
$sql.= ' u.login';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
@ -688,6 +689,12 @@ if ($resql)
print '<td class="liste_titre">';
print '</td>';
}
// Date cloture
if (! empty($arrayfields['p.date_cloture']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// Status
if (! empty($arrayfields['p.fk_statut']['checked']))
{
@ -735,6 +742,7 @@ if ($resql)
print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['p.date_cloture']['checked'])) print_liste_field_titre($arrayfields['p.date_cloture']['label'], $_SERVER["PHP_SELF"], "p.date_cloture", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
print '</tr>'."\n";
@ -1073,6 +1081,14 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date cloture
if (! empty($arrayfields['p.date_cloture']['checked']))
{
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_cloture), 'dayhour', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Status
if (! empty($arrayfields['p.fk_statut']['checked']))
{

View File

@ -1457,11 +1457,11 @@ class Commande extends CommonOrder
$pu_ht_devise = $tabprice[19];
// Rang to use
$rangtouse = $rang;
if ($rangtouse == -1)
$ranktouse = $rang;
if ($ranktouse == -1)
{
$rangmax = $this->line_max($fk_parent_line);
$rangtouse = $rangmax + 1;
$ranktouse = $rangmax + 1;
}
// TODO A virer
@ -1495,7 +1495,7 @@ class Commande extends CommonOrder
$this->line->fk_remise_except=$fk_remise_except;
$this->line->remise_percent=$remise_percent;
$this->line->subprice=$pu_ht;
$this->line->rang=$rangtouse;
$this->line->rang=$ranktouse;
$this->line->info_bits=$info_bits;
$this->line->total_ht=$total_ht;
$this->line->total_tva=$total_tva;

View File

@ -143,6 +143,7 @@ $arrayfields=array(
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500),
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>1000, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
);
@ -247,7 +248,7 @@ $sql.= " typent.code as typent_code,";
$sql.= " state.code_departement as state_code, state.nom as state_name,";
$sql.= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
$sql.= ' c.date_creation as date_creation, c.tms as date_update,';
$sql.= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
$sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields
@ -693,6 +694,12 @@ if ($resql)
print '<td class="liste_titre">';
print '</td>';
}
// Date cloture
if (! empty($arrayfields['c.date_cloture']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// Status
if (! empty($arrayfields['c.fk_statut']['checked']))
{
@ -748,7 +755,8 @@ if ($resql)
print $hookmanager->resPrint;
if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['c.date_cloture']['checked'])) print_liste_field_titre($arrayfields['c.date_cloture']['label'], $_SERVER["PHP_SELF"], "c.date_cloture", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ');
print '</tr>'."\n";
@ -1092,6 +1100,14 @@ if ($resql)
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date cloture
if (! empty($arrayfields['c.date_cloture']['checked']))
{
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_cloture), 'dayhour', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Status
if (! empty($arrayfields['c.fk_statut']['checked']))
{

View File

@ -0,0 +1 @@

View File

@ -2825,11 +2825,11 @@ class Facture extends CommonInvoice
$pu_ht_devise = $tabprice[19];
// Rank to use
$rangtouse = $rang;
if ($rangtouse == -1)
$ranktouse = $rang;
if ($ranktouse == -1)
{
$rangmax = $this->line_max($fk_parent_line);
$rangtouse = $rangmax + 1;
$ranktouse = $rangmax + 1;
}
// Insert line
@ -2863,7 +2863,7 @@ class Facture extends CommonInvoice
$this->line->date_start=$date_start;
$this->line->date_end=$date_end;
$this->line->ventil=$ventil;
$this->line->rang=$rangtouse;
$this->line->rang=$ranktouse;
$this->line->info_bits=$info_bits;
$this->line->fk_remise_except=$fk_remise_except;

View File

@ -74,6 +74,9 @@ class box_graph_invoices_permonth extends ModeleBoxes
//include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
//$facturestatic=new Facture($db);
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
$text = $langs->trans("BoxCustomersInvoicesPerMonth", $max);
$this->info_box_head = array(
'text' => $text,
@ -129,7 +132,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($shownb)
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$endyear.'.png';
@ -146,7 +149,14 @@ class box_graph_invoices_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px1->SetLegend($legend);
@ -167,7 +177,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showtot)
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$endyear.'.png';
@ -184,7 +194,14 @@ class box_graph_invoices_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px2->SetLegend($legend);

View File

@ -73,6 +73,9 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
$text = $langs->trans("BoxSuppliersInvoicesPerMonth", $max);
$this->info_box_head = array(
'text' => $text,
@ -126,7 +129,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($shownb)
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$year.'.png';
@ -143,7 +146,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px1->SetLegend($legend);
@ -164,7 +174,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showtot)
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$year.'.png';
@ -181,7 +191,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px2->SetLegend($legend);

View File

@ -74,6 +74,9 @@ class box_graph_orders_permonth extends ModeleBoxes
//include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
//$commandestatic=new Commande($db);
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
$text = $langs->trans("BoxCustomersOrdersPerMonth", $max);
$this->info_box_head = array(
'text' => $text,
@ -129,7 +132,7 @@ class box_graph_orders_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($shownb)
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
@ -144,7 +147,14 @@ class box_graph_orders_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px1->SetLegend($legend);
@ -165,7 +175,7 @@ class box_graph_orders_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showtot)
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
@ -180,7 +190,14 @@ class box_graph_orders_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px2->SetLegend($legend);

View File

@ -73,6 +73,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
$text = $langs->trans("BoxSuppliersOrdersPerMonth", $max);
$this->info_box_head = array(
'text' => $text,
@ -128,7 +131,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($shownb)
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
@ -143,7 +146,14 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px1->SetLegend($legend);
@ -164,7 +174,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showtot)
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
@ -179,7 +189,14 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px2->SetLegend($legend);

View File

@ -74,6 +74,9 @@ class box_graph_propales_permonth extends ModeleBoxes
//include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
//$propalstatic=new Propal($db);
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
$langs->load("propal");
$text = $langs->trans("BoxProposalsPerMonth", $max);
@ -128,7 +131,7 @@ class box_graph_propales_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($shownb)
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars');
$filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png";
@ -144,7 +147,14 @@ class box_graph_propales_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px1->SetLegend($legend);
@ -165,7 +175,7 @@ class box_graph_propales_permonth extends ModeleBoxes
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showtot)
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$datatype2 = array_pad(array(), ($endyear-$startyear+1), 'bars');
//$datatype2 = array('lines','bars');
@ -183,7 +193,14 @@ class box_graph_propales_permonth extends ModeleBoxes
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
if ($startmonth != 1)
{
$legend[]=sprintf("%d/%d", $i-2001, $i-2000);
}
else
{
$legend[]=$i;
}
$i++;
}
$px2->SetLegend($legend);

View File

@ -1094,7 +1094,7 @@ class DolGraph
$i++;
}
// shadowSize: 0 -> Drawing is faster without shadows
$this->stringtoshow.="\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n";
$this->stringtoshow.="\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6, fillColor: { colors: [{opacity: 0.9 }, {opacity: 0.85}] }} }'."\n";
// Xaxis
$this->stringtoshow.=', xaxis: { ticks: ['."\n";

View File

@ -39,10 +39,12 @@ abstract class Stats
* @param int $endyear Start year
* @param int $startyear End year
* @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save)
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array of values
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @param int $startmonth month of the fiscal year start min 1 max 12 ; if 1 = january
* @return array Array of values
*/
public function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0)
public function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0, $startmonth = 1)
{
global $conf,$user,$langs;
@ -86,6 +88,8 @@ abstract class Stats
else
{
$year=$startyear;
$sm = $startmonth - 1;
if ($sm != 0) $year = $year - 1;
while ($year <= $endyear)
{
$datay[$year] = $this->getNbByMonth($year, $format);
@ -96,11 +100,11 @@ abstract class Stats
for ($i = 0 ; $i < 12 ; $i++)
{
$data[$i][]=$datay[$endyear][$i][0];
$data[$i][]=$datay[$endyear][($i+$sm)%12][0];
$year=$startyear;
while($year <= $endyear)
{
$data[$i][]=$datay[$year][$i][1];
$data[$i][]=$datay[$year - (1 - ((int) ($i+$sm)/12)) + ($sm == 0 ? 1 : 0)][($i+$sm)%12][1];
$year++;
}
}
@ -134,9 +138,10 @@ abstract class Stats
* @param int $startyear End year
* @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save)
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @param int $startmonth month of the fiscal year start min 1 max 12 ; if 1 = january
* @return array Array of values
*/
public function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0)
public function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0, $startmonth = 1)
{
global $conf,$user,$langs;
@ -181,6 +186,8 @@ abstract class Stats
else
{
$year=$startyear;
$sm = $startmonth - 1;
if ($sm != 0) $year = $year - 1;
while($year <= $endyear)
{
$datay[$year] = $this->getAmountByMonth($year, $format);
@ -191,11 +198,11 @@ abstract class Stats
// $data = array('xval'=>array(0=>xlabel,1=>yval1,2=>yval2...),...)
for ($i = 0 ; $i < 12 ; $i++)
{
$data[$i][]=$datay[$endyear][$i][0]; // set label
$data[$i][]=$datay[$endyear][($i+$sm)%12][0]; // set label
$year=$startyear;
while($year <= $endyear)
{
$data[$i][]=$datay[$year][$i][1]; // set yval for x=i
$data[$i][]=$datay[$year - (1 - ((int) ($i+$sm)/12)) + ($sm == 0 ? 1 : 0)][($i+$sm)%12][1]; // set yval for x=i
$year++;
}
}
@ -411,7 +418,8 @@ abstract class Stats
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Renvoie le nombre de proposition par mois pour une annee donnee
* Renvoie le nombre de documents par mois pour une annee donnee
* Return number of documents per month for a given year
*
* @param int $year Year
* @param string $sql SQL
@ -470,7 +478,8 @@ abstract class Stats
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Renvoie le nombre d'element par mois pour une annee donnee
* Renvoie le montant totalise par mois pour une annee donnee
* Return the amount per month for a given year
*
* @param int $year Year
* @param string $sql SQL
@ -527,6 +536,7 @@ abstract class Stats
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Renvoie le montant moyen par mois pour une annee donnee
* Return the amount average par month for a given year
*
* @param int $year Year
* @param string $sql SQL

View File

@ -947,5 +947,44 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false)
*/
}
// Use MAIN_OPTIMIZEFORTEXTBROWSER
if ($foruserprofile)
{
//$default=yn($conf->global->MAIN_OPTIMIZEFORCOLORBLIND);
$default=$langs->trans('No');
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_OPTIMIZEFORCOLORBLIND").'</td>';
print '<td colspan="'.($colspan-1).'">';
$colorBlindOptions = array(
0 => $langs->trans('No'),
'protanopia' => $langs->trans('Protanopia'),
'deuteranopes' => $langs->trans('Deuteranopes'),
'tritanopes' => $langs->trans('Tritanopes'),
);
if ($edit)
{
print $form->selectArray('MAIN_OPTIMIZEFORCOLORBLIND', $colorBlindOptions, $fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND, 0);
}
else
{
if (!empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND) && isset($colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND])){
print $colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND];
}
else{
print yn(0);
}
}
print ' &nbsp; ('.$langs->trans("Default").': <strong>'.$default.'</strong>) ';
print $form->textwithpicto('', $langs->trans("MAIN_OPTIMIZEFORCOLORBLINDDesc"));
print '</td>';
print '</tr>';
}
else
{
}
print '</table>';
}

View File

@ -1227,7 +1227,7 @@ class pdf_einstein extends ModelePDFCommandes
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @param string $titlekey Translation key to show as title of document
* @return void
* @return int Return topshift value
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle")
{

View File

@ -67,13 +67,13 @@ class pdf_proforma extends pdf_einstein
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @param string $titlekey Translation key to show as title of document
* @return void
* @return int Return topshift value
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "InvoiceProForma")
{
// phpcs:enable
global $conf,$langs,$hookmanager;
parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey);
return parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey);
}
}

View File

@ -581,8 +581,27 @@ class ImportCsv extends ModeleImports
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
$newval=$defaultref;
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='compute')
{
$file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']);
$class=$objimport->array_import_convertvalue[0][$val]['class'];
$method=$objimport->array_import_convertvalue[0][$val]['method'];
$resultload = dol_include_once($file);
if (empty($resultload))
{
dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method);
break;
}
$classinstance=new $class($this->db);
$res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord));
if ($res<0) {
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
else $this->errors[$error]['lib']='ErrorFieldValueNotIn';
$this->errors[$error]['type']='FOREIGNKEY';
$errorforthistable++;
$error++;
}
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
{
$newval = price2num($newval);

View File

@ -608,8 +608,27 @@ class ImportXlsx extends ModeleImports
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
$newval=$defaultref;
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='compute')
{
$file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']);
$class=$objimport->array_import_convertvalue[0][$val]['class'];
$method=$objimport->array_import_convertvalue[0][$val]['method'];
$resultload = dol_include_once($file);
if (empty($resultload))
{
dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method);
break;
}
$classinstance=new $class($this->db);
$res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord));
if ($res<0) {
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
else $this->errors[$error]['lib']='ErrorFieldValueNotIn';
$this->errors[$error]['type']='FOREIGNKEY';
$errorforthistable++;
$error++;
}
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
{
$newval = price2num($newval);

View File

@ -209,7 +209,10 @@ if ($captcha) {
<div id="login_line2" style="clear: both">
<!-- Button Connection -->
<br><input type="submit" class="button" value="&nbsp; <?php echo $langs->trans('Connection'); ?> &nbsp;" tabindex="5" />
<br>
<div id="login-submit-wrapper">
<input type="submit" class="button" value="&nbsp; <?php echo $langs->trans('Connection'); ?> &nbsp;" tabindex="5" />
</div>
<?php
if ($forgetpasslink || $helpcenterlink)
@ -221,7 +224,7 @@ if ($forgetpasslink || $helpcenterlink)
if ($dol_use_jmobile) $moreparam.=(strpos($moreparam, '?')===false?'?':'&').'dol_use_jmobile='.$dol_use_jmobile;
echo '<br>';
echo '<div class="center" style="margin-top: 15px;">';
echo '<div class="center" style="margin-top: 5px;">';
if ($forgetpasslink) {
$url=DOL_URL_ROOT.'/user/passwordforgotten.php'.$moreparam;
if (! empty($conf->global->MAIN_PASSWORD_FORGOTLINK)) $url=$conf->global->MAIN_PASSWORD_FORGOTLINK;

View File

@ -130,7 +130,8 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if ($action == 'BILL_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$ret = 0;
// First classify billed the order to allow the proposal classify process
if (! empty($conf->commande->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER))
{
@ -151,7 +152,6 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
}
return $ret;
}
// Second classify billed the proposal.
@ -174,8 +174,9 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
}
return $ret;
}
return $ret;
}
// classify billed order & billed propososal

View File

@ -143,7 +143,7 @@ class TraceableDB extends DoliDB
*/
public static function convertSQLFromMysql($line, $type = 'ddl')
{
return $this->db->convertSQLFromMysql($line);
return self::$db->convertSQLFromMysql($line);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View File

@ -353,7 +353,7 @@ class Expedition extends CommonObject
{
if (! isset($this->lines[$i]->detail_batch))
{ // no batch management
if (! $this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->array_options) > 0)
if (! $this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) > 0)
{
$error++;
}
@ -441,10 +441,11 @@ class Expedition extends CommonObject
* @param int $entrepot_id Id of warehouse
* @param int $origin_line_id Id of source line
* @param int $qty Quantity
* @param int $rang Rang
* @param array $array_options extrafields array
* @return int <0 if KO, line_id if OK
*/
public function create_line($entrepot_id, $origin_line_id, $qty, $array_options = 0)
public function create_line($entrepot_id, $origin_line_id, $qty, $rang, $array_options = 0)
{
//phpcs:enable
global $user;
@ -454,6 +455,7 @@ class Expedition extends CommonObject
$expeditionline->entrepot_id = $entrepot_id;
$expeditionline->fk_origin_line = $origin_line_id;
$expeditionline->qty = $qty;
$expeditionline->rang = $rang;
$expeditionline->array_options = $array_options;
if (($lineId = $expeditionline->insert($user)) < 0)
@ -490,7 +492,7 @@ class Expedition extends CommonObject
// create shipment lines
foreach ($stockLocationQty as $stockLocation => $qty)
{
if (($line_id = $this->create_line($stockLocation, $line_ext->origin_line_id, $qty, $array_options)) < 0)
if (($line_id = $this->create_line($stockLocation, $line_ext->origin_line_id, $qty, $line_ext->rang, $array_options)) < 0)
{
$error++;
}
@ -926,6 +928,9 @@ class Expedition extends CommonObject
$orderline = new OrderLine($this->db);
$orderline->fetch($id);
// Copy the rang of the order line to the expedition line
$line->rang = $orderline->rang;
if (! empty($conf->stock->enabled) && ! empty($orderline->fk_product))
{
$fk_product = $orderline->fk_product;
@ -1383,7 +1388,7 @@ class Expedition extends CommonObject
$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type";
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
$sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.info_bits, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
$sql.= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc";
$sql.= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc, cd.rang";
$sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
$sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch";
@ -1452,6 +1457,7 @@ class Expedition extends CommonObject
$line->label = $obj->custom_label;
$line->description = $obj->description;
$line->qty_asked = $obj->qty_asked;
$line->rang = $obj->rang;
$line->weight = $obj->weight;
$line->weight_units = $obj->weight_units;
$line->length = $obj->length;
@ -2459,6 +2465,11 @@ class ExpeditionLigne extends CommonObjectLine
*/
public $product_desc;
/**
* @var int rang of line
*/
public $rang;
/**
* @var float weight
*/
@ -2579,16 +2590,28 @@ class ExpeditionLigne extends CommonObjectLine
$this->db->begin();
if (empty($this->rang)) $this->rang = 0;
// Rank to use
$ranktouse = $this->rang;
if ($ranktouse == -1)
{
$rangmax = $this->line_max($fk_expedition);
$ranktouse = $rangmax + 1;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."expeditiondet (";
$sql.= "fk_expedition";
$sql.= ", fk_entrepot";
$sql.= ", fk_origin_line";
$sql.= ", qty";
$sql.= ", rang";
$sql.= ") VALUES (";
$sql.= $this->fk_expedition;
$sql.= ", ".(empty($this->entrepot_id) ? 'NULL' : $this->entrepot_id);
$sql.= ", ".$this->fk_origin_line;
$sql.= ", ".$this->qty;
$sql.= ", ".$ranktouse;
$sql.= ")";
dol_syslog(get_class($this)."::insert", LOG_DEBUG);

View File

@ -1024,6 +1024,34 @@ if (empty($reshook))
}
}
if ($action == 'set_unpaid' && $id > 0 && $user->rights->expensereport->to_paid)
{
$object = new ExpenseReport($db);
$object->fetch($id);
$result = $object->set_unpaid($user);
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
}
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
{
$object = new ExpenseReport($db);

View File

@ -98,7 +98,7 @@ class EvalMath
'sin','sinh','arcsin','asin','arcsinh','asinh',
'cos','cosh','arccos','acos','arccosh','acosh',
'tan','tanh','arctan','atan','arctanh','atanh',
'sqrt','abs','ln','log');
'sqrt','abs','ln','log','intval');
/**
* Constructor

View File

@ -71,4 +71,6 @@ create table llx_payment_salary_extrafields
ALTER TABLE llx_payment_salary_extrafields ADD INDEX idx_payment_salary_extrafields (fk_object);
ALTER TABLE llx_c_price_expression MODIFY COLUMN expression varchar(255) NOT NULL;
UPDATE llx_bank_url set url = REPLACE( url, 'compta/salaries/', 'salaries/');

View File

@ -20,5 +20,5 @@ create table llx_c_price_expression
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
title varchar(20) NOT NULL,
expression varchar(80) NOT NULL
expression varchar(255) NOT NULL
)ENGINE=innodb;

View File

@ -400,6 +400,7 @@ OldVATRates=Old VAT rate
NewVATRates=New VAT rate
PriceBaseTypeToChange=Modify on prices with base reference value defined on
MassConvert=Launch bulk conversion
PriceFormatInCurrentLanguage=Price Format In Current Language
String=String
TextLong=Long text
HtmlText=Html text
@ -1900,6 +1901,11 @@ OnMobileOnly=On small screen (smartphone) only
DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both)
MAIN_OPTIMIZEFORTEXTBROWSER=Simplify interface for blind person
MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or if you use the application from a text browser like Lynx or Links.
MAIN_OPTIMIZEFORCOLORBLIND=Change interface's color for color blind person
MAIN_OPTIMIZEFORCOLORBLINDDesc=Enable this option if you are a color blind person, in some case interface will change color setup to increase contrast.
Protanopia=Protanopia
Deuteranopes=Deuteranopes
Tritanopes=Tritanopes
ThisValueCanOverwrittenOnUserLevel=This value can be overwritten by each user from its user page - tab '%s'
DefaultCustomerType=Default thirdparty type for "New customer" creation form
ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working.

View File

@ -568,7 +568,7 @@ else
}
// Other attributes
if ($action = 'create_delivery') {
if ($action == 'create_delivery') {
// copy from expedition
$expeditionExtrafields = new Extrafields($db);
$expeditionExtrafieldLabels = $expeditionExtrafields->fetch_name_optionals_label($expedition->table_element);
@ -681,7 +681,7 @@ else
$mode = ($object->statut == 0) ? 'edit' : 'view';
$line = new LivraisonLigne($db);
$line->fetch_optionals($object->lines[$i]->id);
if ($action = 'create_delivery') {
if ($action == 'create_delivery') {
$srcLine = new ExpeditionLigne($db);
$expeditionLineExtrafields = new Extrafields($db);
$expeditionLineExtrafieldLabels = $expeditionLineExtrafields->fetch_name_optionals_label($srcLine->table_element);

View File

@ -902,6 +902,9 @@ elseif (! empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER))
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER=$user->conf->MAIN_OPTIMIZEFORTEXTBROWSER;
}
// set MAIN_OPTIMIZEFORCOLORBLIND
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND=$user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
// Set terminal output option according to conf->browser.
if (GETPOST('dol_hide_leftmenu', 'int') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
if (GETPOST('dol_hide_topmenu', 'int') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1;
@ -1087,6 +1090,10 @@ if (! function_exists("llxHeader"))
if ($mainmenu != 'website') $tmpcsstouse=$morecssonbody; // We do not use sidebar-collpase by default to have menuhider open by default.
}
if(!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)){
$tmpcsstouse.= ' colorblind-'.strip_tags($conf->global->MAIN_OPTIMIZEFORCOLORBLIND);
}
print '<body id="mainbody" class="'.$tmpcsstouse.'">' . "\n";
// top menu and left menu area

View File

@ -556,7 +556,14 @@ if (! empty($conf->fournisseur->enabled)) $rowspan++;
print '<tr class="oddeven">';
print '<td>'.$langs->trans("PricingRule").'</td>';
if (empty($conf->multicompany->enabled))
{
print '<td>'.$langs->trans("PricingRule").'</td>';
}
else
{
print '<td>'.$form->textwithpicto($langs->trans("PricingRule"), $langs->trans("SamePriceAlsoForSharedCompanies"), 1).'</td>';
}
print '<td width="60" class="right">';
$current_rule = 'PRODUCT_PRICE_UNIQ';
if (!empty($conf->global->PRODUIT_MULTIPRICES)) $current_rule='PRODUIT_MULTIPRICES';
@ -564,10 +571,6 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) $current_rule='PRODUI
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES';
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
print $form->selectarray("princingrule", $select_pricing_rules, $current_rule);
if ( empty($conf->multicompany->enabled))
{
print $langs->trans("SamePriceAlsoForSharedCompanies");
}
print '</td><td rowspan="'.$rowspan.'" class="nohover right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</td>';

View File

@ -1028,7 +1028,7 @@ else
if ($type == 1)
{
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
print '<input name="surface" size="4" value="'.GETPOST('duration_value', 'int').'">';
print '<input name="duration_value" size="4" value="'.GETPOST('duration_value', 'int').'">';
print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOST('duration_value', 'alpha'), 0, 1);
print '</td></tr>';
}

View File

@ -262,24 +262,29 @@ class PriceParser
return -1;
}
//Get the supplier min
$productFournisseur = new ProductFournisseur($this->db);
$supplier_min_price = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0);
//Get the supplier min price
$productFournisseur = new ProductFournisseur($this->db);
$res = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0);
if ($res < 1) {
$this->error_parser = array(25, null);
return -1;
}
$supplier_min_price = $productFournisseur->fourn_unitprice;
//Accessible values by expressions
$extra_values = array_merge($extra_values, array(
"supplier_min_price" => $supplier_min_price,
));
$extra_values = array_merge($extra_values, array(
"supplier_min_price" => $supplier_min_price,
));
//Parse the expression and return the price, if not error occurred check if price is higher than min
$result = $this->parseExpression($product, $price_expression->expression, $extra_values);
if (empty($this->error_parser)) {
if ($result < $product->price_min) {
$result = $product->price_min;
}
}
return $result;
}
//Parse the expression and return the price, if not error occurred check if price is higher than min
$result = $this->parseExpression($product, $price_expression->expression, $extra_values);
if (empty($this->error_parser)) {
if ($result < $product->price_min) {
$result = $product->price_min;
}
}
return $result;
}
/**
* Calculates supplier product price based on product supplier price and associated expression

View File

@ -236,7 +236,8 @@ if ($id > 0 || ! empty($ref))
$objp = $db->fetch_object($result);
if ($objp->type == Facture::TYPE_CREDIT_NOTE) $objp->qty=-($objp->qty);
$total_ht+=$objp->total_ht;
$total_ht+=$objp->total_ht;
$total_qty+=$objp->qty;
$invoicestatic->id=$objp->facid;

View File

@ -2167,8 +2167,8 @@ class Societe extends CommonObject
{
$label.= '<br><b>' . $langs->trans('Name') . ':</b> '. $this->name;
if (! empty($this->name_alias)) $label.=' ('.$this->name_alias.')';
$label.= '<br><b>' . $langs->trans('Email') . ':</b> '. $this->email;
}
$label.= '<br><b>' . $langs->trans('Email') . ':</b> '. $this->email;
if (! empty($this->country_code))
$label.= '<br><b>' . $langs->trans('Country') . ':</b> '. $this->country_code;
if (! empty($this->tva_intra) || (! empty($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP) && strpos($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP, 'vatnumber') !== false))

View File

@ -826,7 +826,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print '<br>';
// List of Stripe payment modes
if (! (empty($conf->stripe->enabled)))
if (! (empty($conf->stripe->enabled)) && $object->client)
{
$morehtmlright='';
if (! empty($conf->global->STRIPE_ALLOW_LOCAL_CARD))
@ -1188,11 +1188,10 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
}
print "</table>";
print "</div>";
print '<br>';
}
// List of bank accounts
print '<br>';
$morehtmlright= dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&amp;action=create');

View File

@ -254,7 +254,7 @@ if (empty($conf->stripeconnect->enabled))
print price($conf->global->STRIPE_APPLICATION_FEE_PERCENT);
print '% + ';
print price($conf->global->STRIPE_APPLICATION_FEE);
print ' '.$langs->getCurrencySymbol($conf->currency).' '.$langs->trans("minimum").' '.price($conf->global->STRIPE_APPLICATION_FEE_MINIMAL).' '.$langs->getCurrencySymbol($conf->currency).' </td></tr>';
print ' '.$langs->getCurrencySymbol($conf->currency).' '.$langs->trans("minimum").' '.price($conf->global->STRIPE_APPLICATION_FEE_MINIMAL).' '.$langs->getCurrencySymbol($conf->currency);
print '</td><td></td></tr>';
}

View File

@ -121,6 +121,30 @@ if (!$rowid)
//print $list;
foreach ($list->data as $charge)
{
if ($charge->refunded=='1'){
$status = img_picto($langs->trans("refunded"), 'statut6');
} elseif ($charge->paid=='1'){
$status = img_picto($langs->trans("".$charge->status.""), 'statut4');
} else {
$label="Message: ".$charge->failure_message."<br>";
$label.="Réseau: ".$charge->outcome->network_status."<br>";
$label.="Statut: ".$langs->trans("".$charge->outcome->seller_message."");
$status = $form->textwithpicto(img_picto($langs->trans("".$charge->status.""), 'statut8'), $label, 1);
}
if ($charge->payment_method_details->type=='card')
{
$type = $langs->trans("card");
} elseif ($charge->source->type=='card'){
$type = $langs->trans("card");
} elseif ($charge->payment_method_details->type=='three_d_secure'){
$type = $langs->trans("card3DS");
}
if (! empty($charge->payment_intent)) {
$charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent);
}
// The metadata FULLTAG is defined by the online payment page
$FULLTAG=$charge->metadata->FULLTAG;
@ -205,31 +229,13 @@ if (!$rowid)
print '<td class="center">'.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."</td>\n";
// Type
print '<td>';
if ($charge->source->object=='card')
{
print $langs->trans("card");
}
elseif ($charge->source->type=='card'){
print $langs->trans("card");
} elseif ($charge->source->type=='three_d_secure'){
print $langs->trans("card3DS");
}
print $type;
print '</td>';
// Amount
print '<td class="right">'.price(($charge->amount-$charge->amount_refunded)/100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."</td>";
// Status
print '<td class="right">';
if ($charge->refunded=='1'){
print img_picto($langs->trans("refunded"), 'statut6');
} elseif ($charge->paid=='1'){
print img_picto($langs->trans("".$charge->status.""), 'statut4');
} else {
$label="Message: ".$charge->failure_message."<br>";
$label.="Réseau: ".$charge->outcome->network_status."<br>";
$label.="Statut: ".$langs->trans("".$charge->outcome->seller_message."");
print $form->textwithpicto(img_picto($langs->trans("".$charge->status.""), 'statut8'), $label, 1);
}
print $status;
print "</td>\n";
print "</tr>\n";

View File

@ -321,14 +321,14 @@ class Stripe extends CommonObject
if (! in_array($currency_code, $arrayzerounitcurrency)) $stripeamount = $amount * 100;
else $stripeamount = $amount;
$fee = round($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE);
$fee = $amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE;
if ($fee >= $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL > $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL);
$fee = $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL;
} elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL);
$fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL;
}
if (! in_array($currency_code, $arrayzerounitcurrency)) $stripefee = $fee * 100;
else $stripefee = $fee;
if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100);
else $stripefee = round($fee);
$paymentintent = null;
@ -710,15 +710,14 @@ class Stripe extends CommonObject
$charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$description"));
}
} else {
$fee = round($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE);
if ($fee >= $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL > $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL);
}
elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL);
}
if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = $fee * 100;
else $stripefee = $fee;
$fee = $amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE;
if ($fee >= $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL > $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
$fee = $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL;
} elseif ($fee < $conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
$fee = $conf->global->STRIPE_APPLICATION_FEE_MINIMAL;
}
if (! in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100);
else $stripefee = round($fee);
$paymentarray = array(
"amount" => "$stripeamount",

View File

@ -55,4 +55,4 @@ else
\Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
\Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version
\Stripe\Stripe::setApiVersion("2019-03-14"); // force version API
\Stripe\Stripe::setApiVersion("2019-05-16"); // force version API

View File

@ -524,11 +524,11 @@ class SupplierProposal extends CommonObject
$pu_ht_devise = $tabprice[19];
// Rang to use
$rangtouse = $rang;
if ($rangtouse == -1)
$ranktouse = $rang;
if ($ranktouse == -1)
{
$rangmax = $this->line_max($fk_parent_line);
$rangtouse = $rangmax + 1;
$ranktouse = $rangmax + 1;
}
// TODO A virer
@ -556,7 +556,7 @@ class SupplierProposal extends CommonObject
$this->line->fk_product=$fk_product;
$this->line->remise_percent=$remise_percent;
$this->line->subprice=$pu_ht;
$this->line->rang=$rangtouse;
$this->line->rang=$ranktouse;
$this->line->info_bits=$info_bits;
$this->line->total_ht=$total_ht;
$this->line->total_tva=$total_tva;

View File

@ -115,6 +115,17 @@ a.badge-warning:focus, a.badge-warning:hover {
background-color: <?php print colorDarker($badgeWarning, 10); ?>;
}
/* WARNING colorblind */
body[class^="colorblind-"] .badge-warning {
background-color: <?php print $colorblind_deuteranopes_badgeWarning; ?>;
}
body[class^="colorblind-"] a.badge-warning.focus,body[class^="colorblind-"] a.badge-warning:focus {
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($colorblind_deuteranopes_badgeWarning, 0.5); ?>;
}
body[class^="colorblind-"] a.badge-warning:focus, a.badge-warning:hover {
background-color: <?php print colorDarker($colorblind_deuteranopes_badgeWarning, 10); ?>;
}
/* INFO */
.badge-info {
color: #fff !important;
@ -160,44 +171,66 @@ a.badge-dark:focus, a.badge-dark:hover {
/*
* STATUS BADGES
*/
/* Default Status */
<?php for ($i = 0; $i <= 9; $i++){
/* Default Status */
_createStatusBadgeCss($i, '', "STATUS".$i);
print "\n/* STATUS".$i." */\n";
$thisBadgeBackgroundColor = $thisBadgeBorderColor = ${'badgeStatus'.$i};
$TBadgeBorderOnly = array(0,3,5,7);
$thisBadgeTextColor = colorIsLight(${'badgeStatus'.$i})?'#212529':'#ffffff';
if(in_array($i, $TBadgeBorderOnly)){
$thisBadgeTextColor = '#212529';
$thisBadgeBackgroundColor = "#fff";
}
print ".badge-status".$i." {\n";
print " color: ".$thisBadgeTextColor." !important;\n";
if(in_array($i, $TBadgeBorderOnly)){
print " border-color: ".$thisBadgeBorderColor.";\n";
}
print " background-color: ".$thisBadgeBackgroundColor.";\n";
print "}\n";
print ".badge-status".$i.".focus, .badge-status".$i.":focus {\n";
print " outline: 0;\n";
print " box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5).";\n";
print "}\n";
print ".badge-status".$i.":focus, .badge-status".$i.":hover {\n";
print " color: ".$thisBadgeTextColor." !important;\n";
print " background-color: ".colorDarker($thisBadgeBackgroundColor, 10).";\n";
if(in_array($i, $TBadgeBorderOnly)){
print " border-color: ".colorDarker($thisBadgeBorderColor, 10).";\n";
}
print "}\n";
// create status for accessibility
_createStatusBadgeCss($i, 'colorblind_deuteranopes_', "COLORBLIND STATUS".$i, 'body[class*="colorblind-"] ');
}
/**
* create status badge
* @param string $statusName name of status
* @param string $statusVarNamePrefix a prefix for var ${$statusVarNamePrefix.'badgeStatus'.$statusName}
* @param string $commentLabel a comment label
* @param string $cssPrefix a css prefix
* @return void
*/
function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentLabel = '', $cssPrefix = '')
{
global ${$statusVarNamePrefix.'badgeStatus'.$statusName}, ${$statusVarNamePrefix.'badgeStatus_textColor'.$statusName};
if(!empty(${$statusVarNamePrefix.'badgeStatus'.$statusName})) {
print "\n/* " . strtoupper($commentLabel) . " */\n";
$thisBadgeBackgroundColor = $thisBadgeBorderColor = ${$statusVarNamePrefix . 'badgeStatus' . $statusName};
$TBadgeBorderOnly = array(0, 3, 5, 7);
$thisBadgeTextColor = colorIsLight(${$statusVarNamePrefix . 'badgeStatus' . $statusName}) ? '#212529' : '#ffffff';
if (!empty(${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName})) {
$thisBadgeTextColor = ${$statusVarNamePrefix . 'badgeStatus_textColor' . $statusName};
}
if (in_array($statusName, $TBadgeBorderOnly)) {
$thisBadgeTextColor = '#212529';
$thisBadgeBackgroundColor = "#fff";
}
print $cssPrefix . ".badge-status" . $statusName . " {\n";
print " color: " . $thisBadgeTextColor . " !important;\n";
if (in_array($statusName, $TBadgeBorderOnly)) {
print " border-color: " . $thisBadgeBorderColor . ";\n";
}
print " background-color: " . $thisBadgeBackgroundColor . ";\n";
print "}\n";
print $cssPrefix . ".badge-status" . $statusName . ".focus, " . $cssPrefix . ".badge-status" . $statusName . ":focus {\n";
print " outline: 0;\n";
print " box-shadow: 0 0 0 0.2rem " . colorHexToRgb($thisBadgeBackgroundColor, 0.5) . ";\n";
print "}\n";
print $cssPrefix . ".badge-status" . $statusName . ":focus, " . $cssPrefix . ".badge-status" . $statusName . ":hover {\n";
print " color: " . $thisBadgeTextColor . " !important;\n";
print " background-color: " . colorDarker($thisBadgeBackgroundColor, 10) . ";\n";
if (in_array($statusName, $TBadgeBorderOnly)) {
print " border-color: " . colorDarker($thisBadgeBorderColor, 10) . ";\n";
}
print "}\n";
}
}

View File

@ -32,7 +32,13 @@
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$theme_bordercolor = array(235,235,224);
$theme_datacolor = array(array(136,102,136), array(0,130,110), array(140,140,220), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(250,190,30), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));
$theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250,190,30), array(221, 75, 57), array(0,166,90), array(140,140,220), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));
if(!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by dolgraph.class.php
{
// for now we use the same configuration for all types of color blind
$theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(169, 169, 169), array(253, 102, 136), array(120, 154, 190), array(146, 146, 55), array(0, 52, 251), array(196, 226, 161), array(222, 160, 41), array(85,135,150), array(150,135,80), array(150,80,150));
}
$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));
@ -71,6 +77,11 @@ $badgeInfo ='#17a2b8';
$badgeDark ='#343a40';
$badgeLight ='#f8f9fa';
// badge color ajustement for color blind
$colorblind_deuteranopes_badgeSuccess ='#37de5d'; //! text color black
$colorblind_deuteranopes_badgeSuccess_textColor7='#000';
$colorblind_deuteranopes_badgeWarning ='#e4e411';
/* default color for status : After a quick check, somme status can have oposite function according to objects
* So this badges status uses default value according to theme eldy status img
* TODO: use color definition vars above for define badges color status X -> expemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive ....
@ -85,3 +96,9 @@ $badgeStatus6='#cad2d2';
$badgeStatus7='#baa32b';
$badgeStatus8='#be3013';
$badgeStatus9='#e7f0f0';
// status color ajustement for color blind
$colorblind_deuteranopes_badgeStatus4=$colorblind_deuteranopes_badgeStatus7=$colorblind_deuteranopes_badgeSuccess; //! text color black
$colorblind_deuteranopes_badgeStatus_textColor4=$colorblind_deuteranopes_badgeStatus_textColor7='#000';
$colorblind_deuteranopes_badgeStatus1=$colorblind_deuteranopes_badgeWarning;
$colorblind_deuteranopes_badgeStatus_textColor1='#000';

View File

@ -160,15 +160,15 @@ class Tickets extends DolibarrApi
$num = count($this->ticket->cache_msgs_ticket);
$i = 0;
while ($i < $num) {
if ($this->ticket->cache_msgs_ticket[$i]['fk_user_action'] > 0) {
if ($this->ticket->cache_msgs_ticket[$i]['fk_user_author'] > 0) {
$user_action = new User($this->db);
$user_action->fetch($this->ticket->cache_msgs_ticket[$i]['fk_user_action']);
$user_action->fetch($this->ticket->cache_msgs_ticket[$i]['fk_user_author']);
}
// Now define messages
$messages[] = array(
'id' => $this->ticket->cache_msgs_ticket[$i]['id'],
'fk_user_action' => $this->ticket->cache_msgs_ticket[$i]['fk_user_action'],
'fk_user_action' => $this->ticket->cache_msgs_ticket[$i]['fk_user_author'],
'fk_user_action_socid' => $user_action->socid,
'fk_user_action_string' => dolGetFirstLastname($user_action->firstname, $user_action->lastname),
'message' => $this->ticket->cache_msgs_ticket[$i]['message'],
@ -195,6 +195,7 @@ class Tickets extends DolibarrApi
// Now define messages
$history[] = array(
'id' => $this->ticket->cache_logs_ticket[$i]['id'],
'fk_user_author' => $this->ticket->cache_msgs_ticket[$i]['fk_user_author'],
'fk_user_action' => $this->ticket->cache_logs_ticket[$i]['fk_user_create'],
'fk_user_action_string' => dolGetFirstLastname($user_action->firstname, $user_action->lastname),
'message' => $this->ticket->cache_logs_ticket[$i]['message'],

View File

@ -152,6 +152,12 @@ if (empty($reshook)) {
$tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 0;
}
if (GETPOST('MAIN_OPTIMIZEFORCOLORBLIND')) {
$tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = GETPOST('MAIN_OPTIMIZEFORCOLORBLIND');
} else {
$tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = 0;
}
$result = dol_set_user_param($db, $conf, $object, $tabparam);
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);