diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 562dfd1505b..1c72ea61abd 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -462,7 +462,7 @@ if ($result) // print '' . $obj->description . ''; // TODO: we shoul set a user defined value to adjust user square / wide screen size $trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print '' . nl2br(dol_trunc($obj->description, $trunclengh)) . ''; + print '' . nl2br(dol_trunc($obj->description, $trunclengh)) . ''; } if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index cb8c35f0416..cb56a4179b8 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -573,7 +573,14 @@ if (! $error && $action == 'writebookkeeping') { { $reflabel = ''; if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":""); - $reflabel.= dol_string_nohtmltag($val['soclib']); + if ($tabtype[$key] == 'banktransfert') + { + $reflabel.= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); + } + else + { + $reflabel.= dol_string_nohtmltag($val['soclib']); + } $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -702,7 +709,7 @@ if (! $error && $action == 'writebookkeeping') { } } } - else { // If thirdparty unkown, output the waiting account + else { // If thirdparty unknown, output the waiting account foreach ($tabbq[$key] as $k => $mt) { if ($mt) { @@ -831,7 +838,6 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $langs->transnoentitiesnoconv("Note") . '"' . $sep; print "\n"; - foreach ($tabpay as $key => $val) { $date = dol_print_date($db->jdate($val["date"]), 'day'); @@ -869,7 +875,14 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! { $reflabel = ''; if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":""); - $reflabel.= dol_string_nohtmltag($val['soclib']); + if ($tabtype[$key] == 'banktransfert') + { + $reflabel.= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); + } + else + { + $reflabel.= dol_string_nohtmltag($val['soclib']); + } print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -951,7 +964,7 @@ if (empty($action) || $action == 'view') { $varlink = 'id_journal=' . $id_journal; - journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); + journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); // Test that setup is complete @@ -1087,7 +1100,14 @@ if (empty($action) || $action == 'view') { { $reflabel = ''; if (! empty($val['lib'])) $reflabel .= $val['lib'] . ($val['soclib']?" - ":""); - $reflabel.= $val['soclib']; + if ($tabtype[$key] == 'banktransfert') + { + $reflabel.= $langs->trans('TransitionalAccount').' '.$account_transfer; + } + else + { + $reflabel.= $val['soclib']; + } print ''; print ''; @@ -1115,7 +1135,7 @@ if (empty($action) || $action == 'view') { } else { - print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will a waiting account + print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account } } else diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index c6dda99dcb2..6138fd395f0 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -653,7 +653,7 @@ if (empty($reshook)) if (empty($labeltouse) || (int) $labeltouse === -1) { //fallback on the old configuration. - setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); + setEventMessages('WarningMandatorySetupNotComplete', null, 'errors'); $error++; } else { @@ -734,7 +734,7 @@ if (empty($reshook)) if (empty($labeltouse) || (int) $labeltouse === -1) { //fallback on the old configuration. - setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); + setEventMessages('WarningMandatorySetupNotComplete', null, 'errors'); $error++; } else { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1e940df2e26..dc894663e4c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2439,6 +2439,7 @@ class Adherent extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -2448,7 +2449,7 @@ class Adherent extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - private function _load_ldap_dn($info, $mode = 0) + public function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 16d92b20c5e..026ac9b20bf 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -229,7 +229,7 @@ if ($search_type) $param.="&search_type=".urlencode($search_type); if ($date_select) $param.="&date_select=".urlencode($date_select); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); if ($search_login) $param.="&search_login=".urlencode($search_login); -if ($search_acount) $param.="&search_account=".urlencode($search_account); +if ($search_account) $param.="&search_account=".urlencode($search_account); if ($search_amount) $param.="&search_amount=".urlencode($search_amount); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 19790159c22..2c8c108b3d5 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -603,7 +603,7 @@ if ($rowid > 0) print '
'; print ''."\n"; - // Lignes des champs de filtre + // Fields title search print ''; print ''; } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) { @@ -1965,7 +1968,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } else { - if ($fieldlist[$field]=='sortorder') $fieldlist[$field]='position'; + + $fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''; + + if ($fieldlist[$field]=='sortorder') + { + $fieldlist[$field]='position'; + } $classtd=''; $class=''; if ($fieldlist[$field]=='code') $classtd='width100'; @@ -1982,7 +1991,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { $langs->load("bills"); - $transkey="PaymentCondition".strtoupper($obj->code); + $transkey="PaymentConditionShort".strtoupper($obj->code); } if ($transkey && $langs->trans($transkey) != $transkey) { @@ -1992,8 +2001,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } if (! $transfound) { - print ''; + print ''; } + else{ + print ''; + } print ''; } } diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 8a065190373..509a04494d2 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -60,6 +60,7 @@ if (GETPOST('cancel', 'alpha')) if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND; @@ -81,6 +82,7 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK if ($action == 'update') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index e2f36f96fe9..b62009c2ba6 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -873,6 +873,7 @@ if ($resql) // Status / Active print '"; // Modify link / Delete link diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 8b17c860fd4..e627068b692 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -220,7 +220,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title $head = supplier_proposal_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'supplier_proposal'); +dol_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_proposal'); /* * Module numerotation diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 1bcff705aef..4e6b6d75e85 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -185,12 +185,6 @@ if ($action == 'setvarother') { if (!$res > 0) { $error++; } - - $param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha'); - $res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity); - if (!$res > 0) { - $error++; - } } @@ -260,7 +254,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print ''; // Check if email exists - print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; } - // Auto assign ticket at user who created it - print ''; - print ''; - print ''; - print ''; - print '
'; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index c3d92edefda..11cd105137c 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1903,6 +1903,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') { print ''; } + else{ + print ''; + } print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; + else print ''.$actl[$obj->active].''; print "
' . $langs->trans("TicketsEmailMustExist") . '
' . $langs->trans("TicketsEmailMustExist") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_EMAIL_MUST_EXISTS'); @@ -277,7 +271,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) /*if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // Show logo for module - print '
' . $langs->trans("TicketsShowModuleLogo") . '
' . $langs->trans("TicketsShowModuleLogo") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO'); @@ -293,7 +287,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) }*/ // Show logo for company - print '
' . $langs->trans("TicketsShowCompanyLogo") . '
' . $langs->trans("TicketsShowCompanyLogo") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO'); @@ -310,7 +304,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) // Also send to main email address if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - print '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'); @@ -330,21 +324,6 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print '
' . $langs->trans("TicketsAutoAssignTicket") . ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_AUTO_ASSIGN_USER_CREATE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, $conf->global->TICKET_AUTO_ASSIGN_USER_CREATE); - } - print ''; - print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1, 'help'); - print '

'; if (!$conf->use_javascript_ajax) { diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index d508afe63d2..39ed6162f0f 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -233,7 +233,7 @@ if ($result) print '
'; print ''; - // Lignes des champs de filtres + // Fields title search print ''; print ''; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 73682c7698c..10601303a61 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -889,7 +889,7 @@ class BOM extends CommonObject $this->lines=array(); $objectline = new BOMLine($this->db); - $result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_bom = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id)); if (is_numeric($result)) { @@ -1044,7 +1044,7 @@ class BOMLine extends CommonObject 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',), 'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'), - 'rank' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,), + 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), ); public $rowid; @@ -1053,7 +1053,7 @@ class BOMLine extends CommonObject public $description; public $qty; public $efficiency; - public $rank; + public $position; public $import_key; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 8e8d21c51b1..af54186e255 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2019 Ferran Marcet * * 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 @@ -252,7 +253,10 @@ if ($action == 'add') { $object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n"; } - else $object->label = $cactioncomm->libelle; + else { + $cactioncomm->fetch($object->type_code); + $object->label = $cactioncomm->label; + } } } $object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 555e89e7a61..241f22cfe38 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -446,7 +446,7 @@ if ($resql) $newcardbutton.= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/propal/card.php?action=create'); } - // Lignes des champs de filtre + // Fields title search print '
'; if ($optioncss != '') print ''; print ''; diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 8b7fef878ed..3fa3f90774f 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -133,7 +133,7 @@ if ($resql) print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'class="right"', $sortfield, $sortorder); print "
\n"; - // Lignes des champs de filtre + // Fields title search print ''; print ''; - // Lignes des champs de filtre + // Fields title search print ''; print ''; print ''; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 811fe663f8c..5609bb6b598 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -603,12 +603,13 @@ if ($resql) print $langs->trans("EventualyAddCategory").': '; print Form::selectarray('cat', $options, GETPOST('cat'), 1); } - print '
'.$langs->trans("ThenCheckLinesAndConciliate").' '; + print '
'.$langs->trans("ThenCheckLinesAndConciliate").' '; print ''; print ' '.$langs->trans("or").' '; print ''; print ' '.$langs->trans("or").' '; print ''; + print '
'; // Show last bank statements $nbmax=15; // We accept to show last 15 receipts (so we can have more than one year) @@ -617,7 +618,7 @@ if ($resql) $sql.= " WHERE fk_account=".$object->id." AND num_releve IS NOT NULL"; $sql.= $db->order("num_releve", "DESC"); $sql.= $db->plimit($nbmax+1); - print '

'; + print '
'; print $langs->trans("LastAccountStatements").' : '; $resqlr=$db->query($sql); if ($resqlr) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index ac4d17e4c49..b93f381c555 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -415,7 +415,7 @@ if (empty($numref)) if ($object->canBeConciliated() > 0) { // If not cash account and can be reconciliate if ($user->rights->banque->consolidate) { - print ''.$langs->trans("Conciliate").''; + print ''.$langs->trans("Conciliate").''; } else { print ''.$langs->trans("Conciliate").''; } diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 36cc40c851c..58631937955 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -151,7 +151,7 @@ if ($resql) print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", '', $sortfield, $sortorder, 'right '); print "\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; $totalarray['totalht'] += $obj->total_ht; @@ -1151,7 +1151,7 @@ if ($resql) // Amount VAT if (! empty($arrayfields['f.total_vat']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; $totalarray['totalvat'] += $obj->total_vat; @@ -1159,7 +1159,7 @@ if ($resql) // Amount LocalTax1 if (! empty($arrayfields['f.total_localtax1']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield']; $totalarray['totallocaltax1'] += $obj->total_localtax1; @@ -1167,7 +1167,7 @@ if ($resql) // Amount LocalTax2 if (! empty($arrayfields['f.total_localtax2']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield']; $totalarray['totallocaltax2'] += $obj->total_localtax2; @@ -1175,7 +1175,7 @@ if ($resql) // Amount TTC if (! empty($arrayfields['f.total_ttc']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; $totalarray['totalttc'] += $obj->total_ttc; @@ -1183,7 +1183,7 @@ if ($resql) if (! empty($arrayfields['dynamount_payed']['checked'])) { - print ''; // TODO Use a denormalized field + print ''; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; $totalarray['totalam'] += $totalpay; @@ -1191,7 +1191,7 @@ if ($resql) if (! empty($arrayfields['rtp']['checked'])) { - print ''; // TODO Use a denormalized field + print ''; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield']; $totalarray['totalrtp'] += $remaintopay; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 11de8aa48a2..64ae1dea1f2 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -157,7 +157,7 @@ if ($resql) print '
'; print '
'.$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0).'
'; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 0d0b202a8c3..33acc2b4969 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -615,7 +615,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"'); print '
'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0adfb4e7ac2..968469ff1e0 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -638,7 +638,7 @@ if (empty($reshook)) $resteapayer = $object->total_ttc - $totalpaye; - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + // We check that invlice lines are transferred into accountancy $ventilExportCompta = $object->getVentilExportCompta(); // On verifie si aucun paiement n'a ete effectue @@ -4616,7 +4616,7 @@ elseif ($id > 0 || ! empty($ref)) // Editer une facture deja validee, sans paiement effectue et pas exporte en compta if ($object->statut == Facture::STATUS_VALIDATED) { - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + // We check that invlice lines are transferred into accountancy $ventilExportCompta = $object->getVentilExportCompta(); if ($ventilExportCompta == 0) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 5eedb9b5740..dd4a2af11ee 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1423,8 +1423,8 @@ else include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; $list = array(); $models = ModelePDFFactures::liste_modeles($db); - foreach ($models as $model) { - $list[] = $model . ':' . $model; + foreach ($models as $k => $model) { + $list[] = str_replace(':', '|', $k) . ':' . $model; } $select = 'select;'.implode(',', $list); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 9f9e3276542..5da37d46fd5 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -261,7 +261,7 @@ if ($search_month_date_when > 0) if ($search_year_date_when > 0 && empty($search_day_date_when)) $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when, $search_month_date_when, false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when, $search_month_date_when, false))."'"; elseif ($search_year_date_when > 0 && ! empty($search_day_date_when)) - $sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'"; + $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'"; else $sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'"; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 0a5efadd832..2982246c6d9 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1143,7 +1143,7 @@ if ($resql) // Amount HT if (! empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)."'.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'.price($obj->total_ttc)."'.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').'
'."\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; print ''; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 21cbd6dbfc4..1b41be78640 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1393,7 +1393,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; - $sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; + $sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum"; $sql.= " FROM"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql.= " ".MAIN_DB_PREFIX."facture as f,"; @@ -1419,7 +1419,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum, $obj->rum); $this->total = $this->total + $obj->somme; $i++; } @@ -1624,15 +1624,16 @@ class BonPrelevement extends CommonObject * @param string $row_cg pl.code_guichet AS cg, Not used for SEPA * @param string $row_cc pl.number AS cc, Not used for SEPA * @param string $row_somme pl.amount AS somme, - * @param string $row_ref f.ref + * @param string $row_ref f.ref * @param string $row_idfac pf.fk_facture AS idfac, * @param string $row_iban rib.iban_prefix AS iban, * @param string $row_bic rib.bic AS bic, * @param string $row_datec rib.datec, * @param string $row_drum rib.rowid used to generate rum + * @param string $row_rum rib.rum Rum defined on company bank account * @return string Return string with SEPA part DrctDbtTxInf */ - public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) + public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum) { // phpcs:enable global $conf; @@ -1644,7 +1645,7 @@ class BonPrelevement extends CommonObject // Define value for RUM // Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId) - $Rum = $this->buildRumNumber($row_code_client, $row_datec, $row_drum); + $Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum; // Define date of RUM signature $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index e76cc9d184d..c0e6921c95d 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -22,7 +22,7 @@ /** * \file htdocs/compta/prelevement/class/ligneprelevement.class.php * \ingroup prelevement - * \brief Fichier de la classe des lignes de prelevements + * \brief File of class to manage lines of Direct Debit orders */ diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index d9298c9f607..747bbdf828d 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -181,6 +181,7 @@ else print 'transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."\n"; } +print "\n"; print "\n"; print '
'; diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index c69547740dc..fe6e2a9d150 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy")); -$modecompta = GETPOST('modecompta', 'alpha'); +$modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE); // Date range $year=GETPOST("year", 'int'); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 8b58bde4199..c48bc385c53 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -5,6 +5,7 @@ * Copyright (C) 2006-2015 Yannick Warnier * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Eric Seigne * * 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 @@ -116,7 +117,8 @@ foreach ($listofparams as $param) if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); } -llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring); +$title = $langs->trans("VATReport") . " " . dol_print_date($date_start) . " -> " . dol_print_date($date_end); +llxHeader('', $title, '', '', 0, 0, '', '', $morequerystring); //print load_fiche_titre($langs->trans("VAT"),""); @@ -184,8 +186,10 @@ if ($mysoc->tva_assuj) { $vatsup.=' ('.$langs->trans("ToGetBack").')'; } - -report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); +$optioncss = GETPOST('optioncss'); +if($optioncss != "print") { + report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); +} $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index ca58882b224..38858518dd6 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -499,6 +499,7 @@ class Contact extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -508,7 +509,7 @@ class Contact extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - private function _load_ldap_dn($info, $mode = 0) + public function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 7273ffc3a8e..e7461e2a053 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -862,7 +862,7 @@ class Contrat extends CommonObject } else { - dol_syslog(get_class($this)."::Fetch Erreur lecture des lignes de contrats liees aux produits"); + dol_syslog(get_class($this)."::Fetch Error when reading lines of contracts linked to products"); return -3; } diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 4ece2eae661..5c747065138 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -220,6 +220,7 @@ class box_graph_invoices_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 4e7849ab048..d06098daa3b 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -217,6 +217,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 3ba42cc6d0a..8c4cb250376 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -216,6 +216,7 @@ class box_graph_orders_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 6bfc47c504d..a584c7288ca 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -215,6 +215,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index e085cd82f07..d32c9bb1918 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -332,6 +332,7 @@ class box_graph_product_distribution extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 9ced39271d0..861c5086704 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -219,6 +219,7 @@ class box_graph_propales_permonth extends ModeleBoxes '; $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5016d10780d..0e08bfada90 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Bahfir abbes * Copyright (C) 2017 ATM Consulting - * Copyright (C) 2017 Nicolas ZABOURI + * Copyright (C) 2017-2019 Nicolas ZABOURI * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Frédéric France * Copyright (C) 2018 Josep Lluís Amador @@ -2443,9 +2443,9 @@ abstract class CommonObject */ public function updateRangOfLine($rowid, $rang) { - $fieldposition = 'rang'; // @TODO Rename 'rang' and 'position' into 'rank' + $fieldposition = 'rang'; // @TODO Rename 'rang' into 'position' if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position'; - if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'rank'; + if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'position'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang; $sql.= ' WHERE rowid = '.$rowid; @@ -2749,7 +2749,7 @@ abstract class CommonObject $MODULE = ""; if ($this->element == 'propal') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL"; - elseif ($this->element == 'order') + elseif ($this->element == 'commande' || $this->element == 'order') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER"; elseif ($this->element == 'facture') $MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE"; @@ -5008,6 +5008,8 @@ abstract class CommonObject $attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey]; $attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey]; $attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey]; + $attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$attributeKey]; + if ($attributeRequired) { @@ -5024,6 +5026,21 @@ abstract class CommonObject //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); + + if (!empty($attrfieldcomputed)) + { + if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) + { + $value = dol_eval($attrfieldcomputed, 1, 0); + dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG); + $new_array_options[$key] = $value; + } + else + { + $new_array_options[$key] = null; + } + } + switch ($attributeType) { diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 18bcfcee8d5..a1d0d7f8728 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -267,7 +267,7 @@ abstract class CommonStickerGenerator protected function _Get_Height_Chars($pt) { // phpcs:enable - // Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes + // Array for link between height of characters and space between lines $_Table_Hauteur_Chars = array(6=>2, 7=>2.5, 8=>3, 9=>3.5, 10=>4, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10); if (in_array($pt, array_keys($_Table_Hauteur_Chars))) { return $_Table_Hauteur_Chars[$pt]; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 6e3fc66f89a..9c403b98104 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -364,6 +364,7 @@ class Conf $this->livraison_bon->enabled=(! empty($this->global->MAIN_SUBMODULE_LIVRAISON)?$this->global->MAIN_SUBMODULE_LIVRAISON:0); // Module fournisseur + // TODO To split into module supplier_invoice and supplier_order if (! empty($this->fournisseur)) { $this->fournisseur->commande=new stdClass(); @@ -376,11 +377,7 @@ class Conf $this->fournisseur->facture->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp"); $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; // For backward compatibility $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; // For backward compatibility - $this->supplierproposal=new stdClass(); - $this->supplierproposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal"); - $this->supplierproposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp"); - $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility - $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility + $this->fournisseur->payment=new stdClass(); $this->fournisseur->payment->multidir_output=array($this->entity => $rootfordata."/fournisseur/payment"); $this->fournisseur->payment->multidir_temp =array($this->entity => $rootfordata."/fournisseur/payment/temp"); @@ -409,15 +406,6 @@ class Conf $this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; // For backward compatibility $this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; // For backward compatibility } - - if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists - { - $this->supplier_proposal=new stdClass(); - $this->supplier_proposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal"); - $this->supplier_proposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp"); - $this->supplier_proposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility - $this->supplier_proposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility - } } } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b8f5c0480b5..0e6b0befef9 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1627,6 +1627,8 @@ class ExtraFields if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method. + //if ($computed) $value = // $value is already calculated into $value before calling this method + $showsize=0; if ($type == 'date') { diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index bd36dba199b..ee090fed65d 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -45,6 +45,8 @@ class FileUpload { global $db, $conf; global $object; + global $hookmanager; + $hookmanager->initHooks(array('fileupload')); $this->fk_element=$fk_element; $this->element=$element; @@ -183,6 +185,18 @@ class FileUpload ) ) ); + + $hookmanager->executeHooks( + 'overrideUploadOptions', + array( + 'options' => &$options, + 'element' => $element + ), + $object, + $action, + $hookmanager + ); + if ($options) { $this->options = array_replace_recursive($this->options, $options); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 12cf8893005..31fc85e3c6a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -154,7 +154,7 @@ class Form * @param string $value Value to show/edit * @param object $object Object * @param boolean $perm Permission to allow button to edit parameter - * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) + * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...') * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value * @param object $extObject External object * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') @@ -174,7 +174,7 @@ class Form if (empty($typeofdata)) return 'ErrorBadParameter'; // When option to edit inline is activated - if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker + if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker and support select { $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); } @@ -231,7 +231,8 @@ class Form foreach($arraydata as $val) { $tmp=explode(':', $val); - $arraylist[$tmp[0]]=$tmp[1]; + $tmpkey=str_replace('|', ':', $tmp[0]); + $arraylist[$tmpkey]=$tmp[1]; } $ret.=$this->selectarray($htmlname, $arraylist, $value); } @@ -300,7 +301,7 @@ class Form * @param string $value Value to show/edit * @param string $htmlname DIV ID (field name) * @param int $condition Condition to edit - * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx') + * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly') * @param string $editvalue When in edit mode, use this value as $value instead of value * @param object $extObject External object * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 620b9317995..c6a138b2a02 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -422,7 +422,7 @@ class FormOther if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users } else { - $sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))"; + $sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('usergroup')."))"; $sql_usr.= " OR u.entity = 0"; // Show always superadmin } } @@ -445,7 +445,7 @@ class FormOther if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users } else { - $sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))"; + $sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('usergroup')."))"; } } else diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 1d681d2672b..6f712fa6c4d 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -419,7 +419,7 @@ class FormTicket if ($withdolfichehead) dol_fiche_end(); - print '
'; + print '
'; print ''; if ($this->withcancel) { diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 13b2d1ae520..78dbba9934e 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -34,6 +34,15 @@ if ($resql) // This can fail when class is used on old database (during migra case 'boolean': $typeFilter="Boolean"; break; + case 'select': + if (! empty($conf->global->EXPORT_LABEL_FOR_SELECT)) + { + $tmpparam=unserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...) + if ($tmpparam['options'] && is_array($tmpparam['options'])) { + $typeFilter="Select:".$obj->param; + } + } + break; case 'sellist': $tmp=''; $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index f7e1b28876f..1de902d1f1d 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -175,7 +175,7 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build { global $langs; - print "\n\n\n"; + print "\n\n\n"; if(! is_empty($varlink)) $varlink = '?'.$varlink; @@ -186,6 +186,7 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build $head[$h][2] = 'journal'; print ''; + print ''; dol_fiche_head($head, 'journal'); @@ -240,5 +241,5 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build print ''; - print "\n\n\n"; + print "\n\n\n"; } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8fe5f5b0db4..b578a6f5b8a 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2568,7 +2568,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed=1; } $original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file; - $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='".$db->escape($refname)."' AND entity=".$conf->entity; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } // Wrapping pour les rapport de paiements elseif ($modulepart == 'supplier_payment') diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index c5791e5c89e..9e0c357be05 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -159,7 +159,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - print ''; + print ''; if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) { print '
'; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7518093bf77..88595cd366a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1579,7 +1579,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom'); $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write); $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 0e064991444..0d95646c441 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -549,7 +549,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetLineStyle(array('dash'=>0)); } - $nexY+=2; // Passe espace entre les lignes + $nexY+=2; // Add space between lines // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 745c09c8130..5bcd6d153d0 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -253,7 +253,7 @@ class pdf_espadon extends ModelePdfExpedition global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $pdf=pdf_getInstance($this->format); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index d255c4486fd..44d0e3a5dda 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -282,7 +282,7 @@ class pdf_rouget extends ModelePdfExpedition global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $pdf=pdf_getInstance($this->format); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 99d2ab322e0..b85ca573188 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -400,7 +400,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. //$nblineFollowComment = 1; - // Cherche nombre de lignes a venir pour savoir si place suffisante + // Search number of lines coming to know if there is enough room // if ($i < ($nblines - 1)) // If it's not last line // { // //Fetch current description to know on which line the next one should be placed @@ -414,8 +414,8 @@ class pdf_standard extends ModeleExpenseReport // $nblineFollowComment = max($nbLineCommentNeed, $nbLineTypeNeed); // } - //$nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Passe espace entre les lignes - $nexY += ($pdf->getFontSize()*1.3); // Passe espace entre les lignes + //$nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Add space between lines + $nexY += ($pdf->getFontSize()*1.3); // Add space between lines // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index c3c8431962e..9d606aadc33 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -261,6 +261,9 @@ class ExportCsv extends ModeleExports } $this->col=0; + + $reg=array(); + foreach($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code); diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index ffb1fd83cce..0e7fd0f1169 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -345,6 +345,8 @@ class ExportExcel extends ModeleExports // Define first row $this->col=0; + $reg=array(); + foreach($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code); diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 266cedc1310..038446643a2 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -304,6 +304,8 @@ class ExportExcel2007new extends ModeleExports // Define first row $this->col=0; + $reg=array(); + foreach($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4536add16bb..53929f28e75 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -318,7 +318,7 @@ class pdf_crabe extends ModelePDFFactures global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $nbpayments = count($object->getListOfPayments()); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 422060ab30b..b5529c78d8e 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -329,7 +329,7 @@ class pdf_sponge extends ModelePDFFactures global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $nbpayments = count($object->getListOfPayments()); diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index fb2c818043e..21c33d35170 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -150,14 +150,15 @@ class modBanque extends DolibarrModules $this->export_fields_array[$r]=array( 'b.rowid'=>'IdTransaction','ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.dateo'=>'DateOperation','b.label'=>'Label', 'b.num_chq'=>'ChequeOrTransferNumber','b.fk_bordereau'=>'ChequeBordereau','-b.amount'=>'Debit','b.amount'=>'Credit', - 'b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty", - "s.code_compta"=>"CustomerAccountancyCode","s.code_compta_fournisseur"=>"SupplierAccountancyCode" + 'b.num_releve'=>'AccountStatement','b.rappro'=>'Conciliated','b.datec'=>"DateCreation","bu.url_id"=>"IdThirdParty", + "s.nom"=>"ThirdParty","s.code_compta"=>"CustomerAccountancyCode","s.code_compta_fournisseur"=>"SupplierAccountancyCode" ); - $this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.dateo'=>'Date','b.label'=>'Text','b.num_chq'=>'Text','b.fk_bordereau'=>'Text','-b.amount'=>'Numeric','b.amount'=>'Numeric','b.num_releve'=>'Text','b.datec'=>"Date","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","s.code_compta_fournisseur"=>"Text"); + $this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.dateo'=>'Date','b.label'=>'Text','b.num_chq'=>'Text','b.fk_bordereau'=>'Text','-b.amount'=>'Numeric','b.amount'=>'Numeric','b.num_releve'=>'Text','b.rappro'=>'Boolean','b.datec'=>"Date","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","s.code_compta_fournisseur"=>"Text"); $this->export_entities_array[$r]=array( 'b.rowid'=>'account','ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.dateo'=>'account','b.label'=>'account', - 'b.num_chq'=>'account','b.fk_bordereau'=>'account','-b.amount'=>'account','b.amount'=>'account','b.num_releve'=>'account', - 'b.datec'=>"account","bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company" + 'b.num_chq'=>'account','b.fk_bordereau'=>'account','-b.amount'=>'account','b.amount'=>'account', + 'b.num_releve'=>'account','b.rappro'=>'account','b.datec'=>"account","bu.url_id"=>"company", + "s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company" ); $this->export_special_array[$r]=array('-b.amount'=>'NULLIFNEG','b.amount'=>'NULLIFNEG'); if (empty($conf->fournisseur->enabled)) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index a545ce1378b..8ba2f173ffd 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -276,7 +276,7 @@ class modFournisseur extends DolibarrModules $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Factures fournisseurs et lignes de facture'; + $this->export_label[$r]='Vendor invoices and lines of invoices'; $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("fournisseur","facture","export")); $this->export_fields_array[$r]=array( @@ -484,7 +484,7 @@ class modFournisseur extends DolibarrModules // Order $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Commandes fournisseurs et lignes de commandes'; + $this->export_label[$r]='Purchase Orders and lines of purchase orders'; $this->export_icon[$r]='order'; $this->export_permission[$r]=array(array("fournisseur","commande","export")); $this->export_fields_array[$r]=array( diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 6089a9fe66e..a9bc06f1021 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -493,7 +493,7 @@ class pdf_standard extends ModelePDFProduct $pdf->SetLineStyle(array('dash'=>0)); } - $nexY+=2; // Passe espace entre les lignes + $nexY+=2; // Add space between lines // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 10be4430aea..71e78368d9c 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -216,7 +216,7 @@ class pdf_squille extends ModelePdfReception global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblignes with the new facture lines content after hook + // Set nblines with the new facture lines content after hook $nblines = count($object->lines); $pdf=pdf_getInstance($this->format); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 4be99b07c11..6c222f96dca 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -461,7 +461,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetLineStyle(array('dash'=>0)); } - $nexY+=2; // Passe espace entre les lignes + $nexY+=2; // Add space between lines // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 04720004492..360db1e94b0 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -44,7 +44,7 @@ $langs->load("modulebuilder"); jQuery(document).ready(function() { function init_typeoffields(type) { - console.log("We select a new type = "+type); + console.log("select a new type (add) = "+type); var size = jQuery("#size"); var computed_value = jQuery("#computed_value"); var langfile = jQuery("#langfile"); @@ -68,7 +68,6 @@ $langs->load("modulebuilder"); ?> // Case of computed field - console.log(type); if (type == '' || type == 'varchar' || type == 'int' || type == 'double' || type == 'price') { jQuery("tr.extra_computed_value").show(); } else { @@ -96,18 +95,19 @@ $langs->load("modulebuilder"); else if (type == 'text') { size.val('2000').removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'html') { size.val('2000').removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'varchar') { size.val('255').removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } - else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").show();} + else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();} else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} - else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();jQuery("#helppassword").hide();} + else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();} + else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpchkbxlst").show();} + else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helplink").show();} else if (type == 'separate') { langfile.val('').prop('disabled',true);size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); - jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide(); + jQuery("#value_choice").show(); + jQuery(".spanforparamtooltip").hide(); jQuery("#helpseparate").show(); } else { // type = string size.val('').prop('disabled', true); @@ -165,11 +165,12 @@ $langs->load("modulebuilder");
- textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?>
@@ -179,7 +180,11 @@ $langs->load("modulebuilder"); trans("LanguageFile"); ?> -textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> +global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> + + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 7ed41af9281..1c4e91a50a5 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -43,7 +43,7 @@ $langs->load("modulebuilder"); jQuery(document).ready(function() { function init_typeoffields(type) { - console.log("select new type "+type); + console.log("select a new type (edit) = "+type); var size = jQuery("#size"); var computed_value = jQuery("#computed_value"); var langfile = jQuery("#langfile"); @@ -54,7 +54,7 @@ $langs->load("modulebuilder"); var list = jQuery("#list"); var totalizable = jQuery("#totalizable"); load("modulebuilder"); else if (type == 'text') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'html') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'varchar') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } - else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").show();} - else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} - else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} - else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();jQuery("#helplink").hide();jQuery("#helppassword").hide();} - else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").show();jQuery("#helppassword").hide();} - else if (type == 'separate') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();jQuery("#helppassword").hide();} + else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();} + else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} + else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} + else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();} + else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} + else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpchkbxlst").show();} + else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helplink").show();} + else if (type == 'separate') { + size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); + jQuery("#value_choice").show(); + jQuery(".spanforparamtooltip").hide(); jQuery("#helpseparate").show(); + } else { // type = string size.val('').prop('disabled', true); unique.removeAttr('disabled'); @@ -229,11 +233,12 @@ else - textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?> - textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> + textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?> @@ -243,7 +248,11 @@ else trans("LanguageFile"); ?> -textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> +global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> + + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 1dad8a6739d..35aefb9f719 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -40,7 +40,17 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ { $value = $obj->$tmpkey; } - + // If field is a computed field, we make computation to get value + if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) + { + //global $obj, $object; + //var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]); + //var_dump($obj); + //var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]); + $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1); + //var_dump($value); + } + print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); print ''; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index 8e39c68b6b7..dd6fabd508f 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -144,7 +144,7 @@ class DolLogsCollector extends MessagesCollector $linecounter = $lines; $pos = -2; $beginning = false; - $text = []; + $text = array(); while ($linecounter > 0) { $t = " "; while ($t != "\n") { @@ -179,12 +179,12 @@ class DolLogsCollector extends MessagesCollector $pattern = "/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*/"; $log_levels = $this->getLevels(); preg_match_all($pattern, $file, $matches); - $log = []; + $log = array(); foreach ($matches as $lines) { foreach ($lines as $line) { foreach ($log_levels as $level_key => $level) { if (strpos(strtolower($line), strtolower($level_key)) == 20) { - $log[] = ['level' => $level, 'line' => $line]; + $log[] = array('level' => $level, 'line' => $line); } } } diff --git a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php index e4d8e89159a..ebf9e2bfbd2 100644 --- a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php @@ -8,6 +8,36 @@ use \DebugBar\DataCollector\RequestDataCollector; class DolRequestDataCollector extends RequestDataCollector { + /** + * Collects the data from the collectors + * + * @return array + */ + public function collect() + { + $vars = array('_GET', '_POST', '_SESSION', '_COOKIE', '_SERVER'); + $data = array(); + + foreach ($vars as $var) { + if (isset($GLOBALS[$var])) { + $arrayofvalues = $GLOBALS[$var]; + + if ($var == '_COOKIE') + { + foreach($arrayofvalues as $key => $val) + { + if (preg_match('/^DOLSESSID_/', $key)) $arrayofvalues[$key]='*****hidden*****'; + } + //var_dump($arrayofvalues); + } + + $data["$" . $var] = $this->getDataFormatter()->formatVar($arrayofvalues); + } + } + + return $data; + } + /** * Return widget settings * @@ -20,7 +50,7 @@ class DolRequestDataCollector extends RequestDataCollector $langs->load("other"); return array( - $langs->transnoentities('Request') => array( + $langs->transnoentities('Variables') => array( "icon" => "tags", "widget" => "PhpDebugBar.Widgets.VariableListWidget", "map" => "request", diff --git a/htdocs/don/card.php b/htdocs/don/card.php index cd92d8d02f5..6e6bab0cf57 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -154,7 +154,7 @@ if ($action == 'add') if (! $error) { - $object->socid = GETPOST("socid", 'int'); + $object->socid = GETPOST("socid", 'int'); $object->firstname = GETPOST("firstname", 'alpha'); $object->lastname = GETPOST("lastname", 'alpha'); $object->societe = GETPOST("societe", 'alpha'); @@ -164,7 +164,7 @@ if ($action == 'add') $object->town = GETPOST("town", 'alpha'); $object->country_id = GETPOST('country_id', 'int'); $object->email = GETPOST('email', 'alpha'); - $object->date = $donation_date; + $object->date = $donation_date; $object->note_private = GETPOST("note_private", 'none'); $object->note_public = GETPOST("note_public", 'none'); $object->public = GETPOST("public", 'alpha'); diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index d75e658a191..638de5580e4 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -392,11 +392,11 @@ class Don extends CommonObject $sql.= ", phone"; $sql.= ", phone_mobile"; $sql.= ") VALUES ("; - $sql.= " '".$this->db->idate($now)."'"; + $sql.= "'".$this->db->idate($now)."'"; $sql.= ", ".$conf->entity; $sql.= ", ".price2num($this->amount); $sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); - $sql.= ", '".$this->db->escape($this->socid)."'"; + $sql.= ", ".($this->socid > 0 ? $this->socid : "null"); $sql.= ", '".$this->db->escape($this->firstname)."'"; $sql.= ", '".$this->db->escape($this->lastname)."'"; $sql.= ", '".$this->db->escape($this->societe)."'"; diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 4acb2fce932..9310df52ddf 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -255,7 +255,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); - // Lignes de contacts + // Lines of contacts echo '
'; // Contacts lines (modules that overwrite templates must declare this into descriptor) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index f5c111f2268..8bd8c702d03 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -318,7 +318,7 @@ if ($resql) print '
'; print ''."\n"; - // Lignes des champs de filtre + // Fields title search print ''; // Ref if (! empty($arrayfields['e.ref']['checked'])) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 807b547a4bc..d9e01a6579f 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1386,7 +1386,7 @@ class Fichinter extends CommonObject } /** - * Classe permettant la gestion des lignes d'intervention + * Class to manage intervention lines */ class FichinterLigne extends CommonObjectLine { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 9b27810e6bb..ff33a42e2a9 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -114,6 +114,7 @@ elseif (! empty($socid) && $socid > 0) $permissionnote=$user->rights->fournisseur->commande->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->fournisseur->commande->creer; // Used by the include of actions_dellink.inc.php $permissiontoedit=$user->rights->fournisseur->commande->creer; // Used by the include of actions_lineupdown.inc.php +$permissiontoadd=$user->rights->fournisseur->commande->creer; // Used by the include of actions_addupdatedelete.inc.php /* @@ -392,7 +393,7 @@ if (empty($reshook)) } if ($prod_entry_mode =='free' && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise === '') // Unit price can be 0 but not '' { - setEventMessages($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), null, 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice')), null, 'errors'); $error++; } if ($prod_entry_mode =='free' && ! GETPOST('dp_desc')) @@ -432,7 +433,7 @@ if (empty($reshook)) if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice', 'alpha'), $reg)) { $idprod=$reg[1]; - $res=$productsupplier->fetch($idprod); // Load product from its ID + $res=$productsupplier->fetch($idprod); // Load product from its id // Call to init some price properties of $productsupplier // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price if (! empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER)) @@ -494,7 +495,7 @@ if (empty($reshook)) 0, // We already have the $idprod always defined $ref_supplier, $remise_percent, - 'HT', + $price_base_type, $pu_ttc, $type, $tva_npr, @@ -511,7 +512,7 @@ if (empty($reshook)) // Product not selected $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); } if ($idprod == -1) { @@ -523,8 +524,6 @@ if (empty($reshook)) } elseif (empty($error)) // $price_ht is already set { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); $tva_tx = str_replace('*', '', $tva_tx); $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); @@ -552,7 +551,7 @@ if (empty($reshook)) $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - $result=$object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, '', '', $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise); + $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, '', '', $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise); } //print "xx".$tva_tx; exit; @@ -652,28 +651,28 @@ if (empty($reshook)) if (preg_match('/\*/', $vat_rate)) $info_bits |= 0x01; - // Define vat_rate + // Define vat_rate $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $mysoc, $object->thirdparty); $localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty); if (GETPOST('price_ht') != '') { - $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); + $price_base_type = 'HT'; + $ht = price2num(GETPOST('price_ht')); } else { - $vatratecleaned = $vat_rate; - if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" - { - $vatratecleaned = trim($reg[1]); - $vatratecode = $reg[2]; - } + $vatratecleaned = $vat_rate; + if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" + { + $vatratecleaned = trim($reg[1]); + $vatratecode = $reg[2]; + } - $ttc = price2num(GETPOST('price_ttc')); - $ht = $ttc / (1 + ($vatratecleaned / 100)); - $price_base_type = 'HT'; + $ttc = price2num(GETPOST('price_ttc')); + $ht = $ttc / (1 + ($vatratecleaned / 100)); + $price_base_type = 'HT'; } $pu_ht_devise = GETPOST('multicurrency_subprice'); @@ -689,7 +688,7 @@ if (empty($reshook)) } } -$result = $object->updateline( + $result = $object->updateline( $lineid, $_POST['product_desc'], $ht, @@ -902,6 +901,16 @@ $result = $object->updateline( } } + // Force mandatory order method + if ($action == 'commande') { + $methodecommande = GETPOST('methodecommande'); + + if ($methodecommande <= 0) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("OrderMode")), null, 'errors'); + $action = 'makeorder'; + } + } + if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) { $result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']); @@ -2271,14 +2280,13 @@ elseif (! empty($object->id)) print '
'; // Add free products/services form - global $forceall, $senderissupplier, $dateSelector; - $forceall=1; $dateSelector=0; + global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; + $forceall=1; $dateSelector=0; $inputalsopricewithtax=1; $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. //if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; if (! empty($conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; // Show object lines - $inputalsopricewithtax=0; if (! empty($object->lines)) $ret = $object->printObjectLines($action, $societe, $mysoc, $lineid, 1); @@ -2516,7 +2524,7 @@ elseif (! empty($object->id)) } // Delete - if ($user->rights->fournisseur->commande->supprimer) + if (! empty($user->rights->fournisseur->commande->supprimer) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && ! empty($user->rights->fournisseur->commande->creer))) { print ''.$langs->trans("Delete").''; } @@ -2526,24 +2534,25 @@ elseif (! empty($object->id)) - if ($user->rights->fournisseur->commande->commander && $object->statut == 2 && $action == 'makeorder') + if ($user->rights->fournisseur->commande->commander && $object->statut == CommandeFournisseur::STATUS_ACCEPTED && $action == 'makeorder') { // Set status to ordered (action=commande) print ''."\n"; - print ''; + print ''; print ''; print ''; print load_fiche_titre($langs->trans("ToOrder"), '', ''); print '
'; //print ''; - print ''; - print ''; @@ -2563,9 +2572,7 @@ elseif (! empty($object->id)) { print '
'; - /* - * Documents generes - */ + // Generated documents $comfournref = dol_sanitizeFileName($object->ref); $file = $conf->fournisseur->dir_output . '/commande/' . $comfournref . '/' . $comfournref . '.pdf'; $relativepath = $comfournref.'/'.$comfournref.'.pdf'; @@ -2583,10 +2590,10 @@ elseif (! empty($object->id)) print '
'; - if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4)) + if ($user->rights->fournisseur->commande->receptionner && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) { // Set status to received (action=livraison) - print ''."\n"; + print ''."\n"; print ''; print ''; print ''; @@ -2599,7 +2606,7 @@ elseif (! empty($object->id)) print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1); print "\n"; - print "
'; } // Town - if (! empty($arrayfields['s.town']['checked'])) print ''; + if (! empty($arrayfields['s.town']['checked'])) print ''; // Zip - if (! empty($arrayfields['s.zip']['checked'])) print ''; + if (! empty($arrayfields['s.zip']['checked'])) print ''; // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; } // Country @@ -1004,7 +1004,7 @@ if ($resql) // Town if (! empty($arrayfields['s.town']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; @@ -1012,7 +1012,7 @@ if ($resql) // Zip if (! empty($arrayfields['s.zip']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 093e0fd331b..6775e9f9b65 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -509,7 +509,7 @@ if (($action != 'create' && $action != 'add') && !$error) { print_liste_field_titre('GenerateBill', '', '', '', '', '', '', '', 'center '); print "\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; $totalarray['totalht'] += $obj->total_ht; @@ -994,7 +994,7 @@ if ($resql) // Amount VAT if (! empty($arrayfields['f.total_vat']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; $totalarray['totalvat'] += $obj->total_vat; @@ -1002,7 +1002,7 @@ if ($resql) // Amount LocalTax1 if (! empty($arrayfields['f.total_localtax1']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield']; $totalarray['totallocaltax1'] += $obj->total_localtax1; @@ -1010,7 +1010,7 @@ if ($resql) // Amount LocalTax2 if (! empty($arrayfields['f.total_localtax2']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield']; $totalarray['totallocaltax2'] += $obj->total_localtax2; @@ -1018,7 +1018,7 @@ if ($resql) // Amount TTC if (! empty($arrayfields['f.total_ttc']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; $totalarray['totalttc'] += $obj->total_ttc; @@ -1026,7 +1026,7 @@ if ($resql) if (! empty($arrayfields['dynamount_payed']['checked'])) { - print ''; // TODO Use a denormalized field + print ''; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; $totalarray['totalam'] += $totalpay; @@ -1034,7 +1034,7 @@ if ($resql) if (! empty($arrayfields['rtp']['checked'])) { - print ''; // TODO Use a denormalized field + print ''; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield']; $totalarray['totalrtp'] += $remaintopay; diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 7b319490815..bd5c0f1fd1e 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -228,7 +228,7 @@ if ($resql) print '
'.$langs->trans("ToOrder").'
'.$langs->trans("OrderDate").''; + print '
'.$langs->trans("OrderDate").''; $date_com = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($date_com)) $date_com=dol_now(); print $form->selectDate($date_com, '', 1, 1, '', "commande", 1, 1); print '
'.$langs->trans("OrderMode").''; + // Force mandatory order method + print '
'.$langs->trans("OrderMode").''; $formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1); print '
".$langs->trans("Delivery")."\n"; + print '
'.$langs->trans("Delivery")."\n"; $liv = array(); $liv[''] = ' '; $liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected"); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 0c6091b694a..dae11084fe1 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -242,7 +242,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) // We ask to move a qty if (GETPOST($qty) != 0) { if (! (GETPOST($ent, 'int') > 0)) { - dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed'); + dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.'); $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline); setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors'); $error ++; @@ -279,7 +279,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) // We ask to move a qty if (GETPOST($qty) > 0) { if (! (GETPOST($ent, 'int') > 0)) { - dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed'); + dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.'); $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline) . '-' . ($reg[1] + 1); setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors'); $error ++; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 80645e2a486..475d42f66dc 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -635,7 +635,7 @@ if ($resql) $newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/commande/card.php?action=create'); } - // Lignes des champs de filtre + // Fields title search print ''; if ($optioncss != '') print ''; print ''; @@ -777,14 +777,14 @@ if ($resql) print ''; - print ''; + print ''; print ''; + print ''; print $obj->town; print ''; + print ''; print $obj->zip; print '
'; // REF diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a0a966e7210..ae042b4c4b8 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1175,7 +1175,7 @@ if (empty($reshook)) } if ($prod_entry_mode =='free' && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise==='') // Unit price can be 0 but not '' { - setEventMessages($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), null, 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice')), null, 'errors'); $error++; } if ($prod_entry_mode =='free' && ! GETPOST('dp_desc')) @@ -1332,7 +1332,7 @@ if (empty($reshook)) $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - $result=$object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise, $ref_supplier); + $result = $object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise, $ref_supplier); } //print "xx".$tva_tx; exit; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index f72261a0802..b18af4c3f19 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -986,7 +986,7 @@ if ($resql) // Amount HT if (! empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($obj->total_ht)."'.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'.price($obj->total_ttc)."'.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''.(! empty($totalpay)?price($totalpay, 0, $langs):' ').''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').''.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').'
'; - // Lignes des champs de filtre + // Fields title search print ''; print ''; print ''; - // Lignes des titres + // Line for title print ''; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("RefSupplierShort", $_SERVER["PHP_SELF"], "ppf.ref_fourn", $param, "", "", $sortfield, $sortorder); diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 0c64fcf7d0d..87741d1054b 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -24,7 +24,7 @@ INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_u INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__INFOS__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__(FirstName)__ : __MEMBER_FIRSTNAME__
__(LastName)__ : __MEMBER_LASTNAME__
__(ID)__ : __MEMBER_ID__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index b10ab3b9a85..f8cc3062bde 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -48,3 +48,5 @@ ALTER TABLE llx_facture_fourn DROP COLUMN total; ALTER TABLE llx_user ADD COLUMN iplastlogin varchar(250); ALTER TABLE llx_user ADD COLUMN ippreviouslogin varchar(250); + +ALTER TABLE llx_events ADD COLUMN prefix_session varchar(255) NULL; diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index ebcca580870..ca677fc5224 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -284,7 +284,7 @@ CREATE TABLE llx_expensereport_det total_ttc double(24,8) DEFAULT 0 NOT NULL, date date NOT NULL, info_bits integer DEFAULT 0, -- TVA NPR ou non - special_code integer DEFAULT 0, -- code pour les lignes speciales + special_code integer DEFAULT 0, -- code for special lines rang integer DEFAULT 0, -- position of line import_key varchar(14) ) ENGINE=innodb; diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index bf08e794a65..c2d4809f958 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -252,12 +252,13 @@ CREATE TABLE llx_bom_bomline( import_key varchar(14), qty double(24,8) NOT NULL, efficiency double(8,4) NOT NULL DEFAULT 1, - rank integer NOT NULL + position integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; ALTER TABLE llx_bom_bomline ADD COLUMN efficiency double(8,4) DEFAULT 1; ALTER TABLE llx_bom_bomline ADD COLUMN fk_bom_child integer NULL; +ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL; create table llx_bom_bomline_extrafields ( diff --git a/htdocs/install/mysql/tables/llx_bom_bomline.sql b/htdocs/install/mysql/tables/llx_bom_bomline.sql index bafaaf73694..4b0aa515950 100644 --- a/htdocs/install/mysql/tables/llx_bom_bomline.sql +++ b/htdocs/install/mysql/tables/llx_bom_bomline.sql @@ -23,6 +23,6 @@ CREATE TABLE llx_bom_bomline( import_key varchar(14), qty double(24,8) NOT NULL, efficiency double(8,4) NOT NULL DEFAULT 1, - rank integer NOT NULL + position integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql b/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql index dfbf4e261eb..f107e348bbe 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql @@ -47,7 +47,7 @@ create table llx_commande_fournisseurdet date_start datetime DEFAULT NULL, -- date debut si service date_end datetime DEFAULT NULL, -- date fin si service info_bits integer DEFAULT 0, -- TVA NPR ou non - special_code integer DEFAULT 0, -- code pour les lignes speciales + special_code integer DEFAULT 0, -- code for special lines rang integer DEFAULT 0, import_key varchar(14), fk_unit integer DEFAULT NULL, diff --git a/htdocs/install/mysql/tables/llx_events.sql b/htdocs/install/mysql/tables/llx_events.sql index f906cf0fcbd..c9f8f034a34 100644 --- a/htdocs/install/mysql/tables/llx_events.sql +++ b/htdocs/install/mysql/tables/llx_events.sql @@ -27,6 +27,7 @@ create table llx_events tms timestamp, -- date creation/modification type varchar(32) NOT NULL, -- action type entity integer DEFAULT 1 NOT NULL, -- multi company id + prefix_session varchar(255) NULL, -- prefix of session, obtained with dol_getprefix dateevent datetime, -- date event fk_user integer, -- id user description varchar(250) NOT NULL, -- full description of action diff --git a/htdocs/install/mysql/tables/llx_expensereport_det.sql b/htdocs/install/mysql/tables/llx_expensereport_det.sql index 75d503ac181..ee583852deb 100644 --- a/htdocs/install/mysql/tables/llx_expensereport_det.sql +++ b/htdocs/install/mysql/tables/llx_expensereport_det.sql @@ -43,7 +43,7 @@ CREATE TABLE llx_expensereport_det total_ttc double(24,8) DEFAULT 0 NOT NULL, date date NOT NULL, info_bits integer DEFAULT 0, -- TVA NPR ou non - special_code integer DEFAULT 0, -- code pour les lignes speciales + special_code integer DEFAULT 0, -- code for special lines fk_multicurrency integer, multicurrency_code varchar(255), multicurrency_subprice double(24,8) DEFAULT 0, diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql index 2f75f9ff54e..57097f600c0 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql @@ -47,7 +47,7 @@ create table llx_facture_fourn_det date_end datetime DEFAULT NULL, -- date fin si service info_bits integer DEFAULT 0, -- TVA NPR ou non fk_code_ventilation integer DEFAULT 0 NOT NULL, - special_code integer DEFAULT 0, -- code pour les lignes speciales + special_code integer DEFAULT 0, -- code for special lines rang integer DEFAULT 0, import_key varchar(14), fk_unit integer DEFAULT NULL, diff --git a/htdocs/install/mysql/tables/llx_facturedet_rec.sql b/htdocs/install/mysql/tables/llx_facturedet_rec.sql index 267abcd5053..8bb0c06e8f8 100644 --- a/htdocs/install/mysql/tables/llx_facturedet_rec.sql +++ b/htdocs/install/mysql/tables/llx_facturedet_rec.sql @@ -52,7 +52,7 @@ create table llx_facturedet_rec buy_price_ht double(24,8) DEFAULT 0, -- buying price. Note: this value is saved as an always positive value, even on credit notes (it is price we bought the product before selling it). fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created) - special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales + special_code integer UNSIGNED DEFAULT 0, -- code for special lines rang integer DEFAULT 0, -- ordre d'affichage fk_contract_line integer NULL, -- id of contract line when template invoice comes from contract lines fk_unit integer DEFAULT NULL, diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 1a8a4108827..4e645bb6934 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -311,7 +311,7 @@ if ($action == "set") { $buf = fgets($fp, 4096); - // Cas special de lignes autorisees pour certaines versions uniquement + // Special case of lines allowed for some version only if ($choix == 1 && preg_match('/^--\sV([0-9\.]+)/i', $buf, $reg)) { $versioncommande=explode('.', $reg[1]); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index c932b2631e8..11bfe9ff99f 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1432,7 +1432,7 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) } /** - * Mise a jour des totaux lignes de facture + * Update total of invoice lines * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -1453,7 +1453,7 @@ function migrate_price_facture($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationInvoice')."
\n"; - // Liste des lignes facture non a jour + // List of invoice lines not up to date $sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_tx as vatrate, fd.total_ttc, fd.info_bits,"; $sql.= " f.rowid as facid, f.remise_percent as remise_percent_global, f.total_ttc as total_ttc_f"; $sql.= " FROM ".MAIN_DB_PREFIX."facturedet as fd, ".MAIN_DB_PREFIX."facture as f"; @@ -1551,7 +1551,7 @@ function migrate_price_facture($db, $langs, $conf) } /** - * Mise a jour des totaux lignes de propal + * Update total of proposal lines * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -1570,7 +1570,7 @@ function migrate_price_propal($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationProposal')."
\n"; - // Liste des lignes propal non a jour + // List of proposal lines not up to date $sql = "SELECT pd.rowid, pd.qty, pd.subprice, pd.remise_percent, pd.tva_tx as vatrate, pd.info_bits,"; $sql.= " p.rowid as propalid, p.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."propal as p"; @@ -1679,7 +1679,7 @@ function migrate_price_contrat($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationContract')."
\n"; - // Liste des lignes contrat non a jour + // List of contract lines not up to date $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as contratid"; $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; @@ -1748,7 +1748,7 @@ function migrate_price_contrat($db, $langs, $conf) } /** - * Mise a jour des totaux lignes de commande + * Update total of sales order lines * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -1767,7 +1767,7 @@ function migrate_price_commande($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationOrder')."
\n"; - // Liste des lignes commande non a jour + // List of sales orders lines not up to date $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."commande as c"; @@ -1865,7 +1865,7 @@ function migrate_price_commande($db, $langs, $conf) } /** - * Mise a jour des totaux lignes de commande fournisseur + * Update total of purchase order lines * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -1884,7 +1884,7 @@ function migrate_price_commande_fournisseur($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationSupplierOrder')."
\n"; - // Liste des lignes commande non a jour + // List of purchase order lines not up to date $sql = "SELECT cd.rowid, cd.qty, cd.subprice, cd.remise_percent, cd.tva_tx as vatrate, cd.info_bits,"; $sql.= " c.rowid as commandeid, c.remise_percent as remise_percent_global"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd, ".MAIN_DB_PREFIX."commande_fournisseur as c"; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 3bb0df59812..6dfe4fc8c4f 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -158,6 +158,7 @@ ACCOUNTING_RESULT_LOSS=Result accounting account (Loss) ACCOUNTING_CLOSURE_DEFAULT_JOURNAL=Journal of closure ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of transitional bank transfer +TransitionalAccount=Transitional bank transfer account ACCOUNTING_ACCOUNT_SUSPENSE=Accounting account of wait DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations @@ -300,7 +301,7 @@ ChartofaccountsId=Chart of accounts Id InitAccountancy=Init accountancy InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accounting account defined for sales and purchases. DefaultBindingDesc=This page can be used to set a default account to use to link transactions record about payment salaries, donation, taxes and vat when no specific accounting account were already set. -DefaultClosureDesc=This page can be used to set parameters to use to enclose a balance sheet. +DefaultClosureDesc=This page can be used to set parameters used for accounting closures. Options=Options OptionModeProductSell=Mode sales OptionModeProductSellIntra=Mode sales exported in EEC diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7480550195a..e14e15033d6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -422,6 +422,8 @@ ExtrafieldCheckBoxFromList=Checkboxes from table ExtrafieldLink=Link to an object ComputedFormula=Computed field ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: $db, $conf, $langs, $mysoc, $user, $object.
WARNING: Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example.
Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.

Example of formula:
$object->id < 10 ? round($object->id / 2, 2): ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)

Example to reload object
(($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id: ($obj->rowid ? $obj->rowid: $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5: '-1'

Other example of formula to force load of object and its parent object:
(($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref: 'Parent project not found' +Computedpersistent=Store computed field +ComputedpersistentDesc=Computed extra fields will be stored in the database, however, the value will only be recalculated when the object of this field is changed. If the computed field depends on other objects or global data this value might be wrong!! ExtrafieldParamHelpPassword=Leaving this field blank means this value will be stored without encryption (field must be only hidden with star on screen).
Set 'auto' to use the default encryption rule to save password into database (then value read will be the hash only, no way to retrieve original value) ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
code3,value3
...

In order to have the list depending on another complementary attribute list:
1,value1|options_parent_list_code:parent_key
2,value2|options_parent_list_code:parent_key

In order to have the list depending on another list:
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
3,value3
... @@ -429,6 +431,7 @@ ExtrafieldParamHelpradio=List of values must be lines with format key,value (whe ExtrafieldParamHelpsellist=List of values comes from a table
Syntax: table_name:label_field:id_field::filter
Example: c_typent:libelle:id::filter

- idfilter is necessarly a primary int key
- filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax: table_name:label_field:id_field::filter
Example: c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax: ObjectName:Classpath
Examples:
Societe:societe/class/societe.class.php
Contact:contact/class/contact.class.php +ExtrafieldParamHelpSeparator=Keep empty for a simple separator
Set this to 1 for a collapsing separator (open by default)
Set this to 2 for a collapsing separator (collapsed by default) LibraryToBuildPDF=Library used for PDF generation LocalTaxDesc=Some countries may apply two or three taxes on each invoice line. If this is the case, choose the type for the second and third tax and its rate. Possible type are:
1: local tax apply on products and services without vat (localtax is calculated on amount without tax)
2: local tax apply on products and services including vat (localtax is calculated on amount + main tax)
3: local tax apply on products without vat (localtax is calculated on amount without tax)
4: local tax apply on products including vat (localtax is calculated on amount + main vat)
5: local tax apply on services without vat (localtax is calculated on amount without tax)
6: local tax apply on services including vat (localtax is calculated on amount + tax) SMS=SMS @@ -1924,4 +1927,4 @@ UrlForIFTTT=URL endpoint for IFTTT YouWillFindItOnYourIFTTTAccount=You will find it on your IFTTT account EndPointFor=End point for %s : %s DeleteEmailCollector=Delete email collector -ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector? \ No newline at end of file +ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector? diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index ae189111c15..616b565496a 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -287,6 +287,7 @@ SupplierAbsoluteDiscountAllUsers=Absolute vendor discounts (entered by all users SupplierAbsoluteDiscountMy=Absolute vendor discounts (entered by yourself) DiscountNone=None Vendor=Vendor +Supplier=Vendor AddContact=Create contact AddContactAddress=Create contact/address EditContact=Edit contact diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 5d01dffa886..9021faf7542 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -322,9 +322,7 @@ class Livraison extends CommonObject // fetch optionals attributes and labels $this->fetch_optionals(); - /* - * Lignes - */ + // Load lines $result=$this->fetch_lines(); if ($result < 0) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2e9ec140bf7..ee2b14fdf11 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -353,6 +353,7 @@ if (! defined('NOTOKENRENEWAL')) //var_dump(GETPOST('token').' '.$_SESSION['token'].' - '.$_SESSION['newtoken'].' '.$_SERVER['SCRIPT_FILENAME']); // Check token +//var_dump((! defined('NOCSRFCHECK')).' '.empty($dolibarr_nocsrfcheck).' '.(! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)).' '.$_SERVER['REQUEST_METHOD'].' '.(! GETPOSTISSET('token'))); if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set { @@ -1199,7 +1200,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (! is_object($hookmanager)) $hookmanager = new HookManager($db); $hookmanager->initHooks(array("main")); - $ext='layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION); + $ext='layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION); print "\n"; @@ -1245,7 +1246,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (GETPOST('version', 'int')) $ext='version='.GETPOST('version', 'int'); // usefull to force no cache on css/js $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09')?'&optioncss='.GETPOST('optioncss', 'aZ09', 1):'').'&userid='.$user->id.'&entity='.$conf->entity; - $themeparam.=($ext?'&'.$ext:''); + $themeparam.=($ext?'&'.$ext:'').'&revision='.$conf->global->MAIN_IHM_PARAMS_REV; if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; if (GETPOST('dol_hide_topmenu', 'int')) { $themeparam.='&dol_hide_topmenu='.GETPOST('dol_hide_topmenu', 'int'); } if (GETPOST('dol_hide_leftmenu', 'int')) { $themeparam.='&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu', 'int'); } @@ -1719,7 +1720,7 @@ function top_menu_user(User $user, Translate $langs) $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); } - else{ + else { $nophoto='/public/theme/common/user_anonymous.png'; if ($user->gender == 'man') $nophoto='/public/theme/common/user_man.png'; if ($user->gender == 'woman') $nophoto='/public/theme/common/user_woman.png'; @@ -1733,7 +1734,7 @@ function top_menu_user(User $user, Translate $langs) $dropdownBody.= '
'; // login infos - if (!empty($user->admin)) { + if (! empty($user->admin)) { $dropdownBody.= '
' . $langs->trans("Administrator").': '.yn($user->admin); } if (! empty($user->socid)) // Add thirdparty for external users @@ -1786,7 +1787,7 @@ function top_menu_user(User $user, Translate $langs) $profilName = $user->getFullName($langs).' ('.$user->login.')'; - if($user->admin){ + if (! empty($user->admin)) { $profilName = ' '.$profilName; } @@ -1846,6 +1847,8 @@ function top_menu_user(User $user, Translate $langs) if (!$(event.target).closest("#topmenu-login-dropdown").length) { // Hide the menus. $("#topmenu-login-dropdown").removeClass("open"); + $("#dropdown-icon-down").show(); // use show/hide instead toggle for avoid conflict + $("#dropdown-icon-up").hide(); // use show/hide instead toggle for avoid conflict } }); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 6382f352106..d2bd1c6ac03 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -689,7 +689,7 @@ class MyObject extends CommonObject $this->lines=array(); $objectline = new MyObjectLine($this->db); - $result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_myobject = '.$this->id)); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_myobject = '.$this->id)); if (is_numeric($result)) { @@ -774,5 +774,5 @@ class MyObject extends CommonObject class MyObjectLine { // To complete with content of an object MyObjectLine - // We should have a field rowid, fk_myobject and rank + // We should have a field rowid, fk_myobject and position } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index cc2eb5062cb..28c817658f6 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -434,7 +434,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '' . $langs->trans('SendMail') . ''."\n"; // Modify - if ($user->rights->mymodule->write) + if (! empty($user->rights->mymodule->write)) { print ''.$langs->trans("Modify").''."\n"; } @@ -444,7 +444,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - if ($user->rights->mymodule->write) + if (! empty($user->rights->mymodule->write)) { print ''; } @@ -463,7 +463,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } */ - if ($user->rights->mymodule->delete) + // Delete (need delete permission, or if draft, just need create/modify permission) + if (! empty($user->rights->mymodule->delete) || (! empty($object->fields['status']) && $object->status == $object::STATUS_DRAFT && ! empty($user->rights->mymodule->write))) { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 95f61d2f20a..a7e45d488e1 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -245,12 +245,12 @@ if ($action == 'set') if (! $res > 0) $error++; } -if ($action == 'other') -{ - $value = GETPOST('activate_units', 'alpha'); - $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; -} +//if ($action == 'other') +//{ +// $value = GETPOST('activate_units', 'alpha'); +// $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity); +// if (! $res > 0) $error++; +//} if ($action) { diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index db7ad4d2b70..6247d84b045 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -199,7 +199,7 @@ class ActionsCardProduct if ($action == 'view') { // Photo - $this->tpl['nblignes'] = 4; + $this->tpl['nblines'] = 4; if ($this->object->is_photo_available($conf->product->multidir_output[$this->object->entity])) { $this->tpl['photos'] = $this->object->show_photos('product', $conf->product->multidir_output[$this->object->entity], 1, 1, 0, 0, 0, 80); diff --git a/htdocs/product/canvas/product/tpl/card_view.tpl.php b/htdocs/product/canvas/product/tpl/card_view.tpl.php index 06d9faf05b7..1f330257073 100644 --- a/htdocs/product/canvas/product/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_view.tpl.php @@ -56,7 +56,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
photos) { ?> - diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index fab5794c82a..85b1feb6795 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -195,7 +195,7 @@ class ActionsCardService if ($action == 'view') { // Photo - $this->tpl['nblignes'] = 4; + $this->tpl['nblines'] = 4; if ($this->object->is_photo_available($conf->service->multidir_output[$this->object->entity])) { $this->tpl['photos'] = $this->object->show_photos('product', $conf->service->multidir_output[$this->object->entity], 1, 1, 0, 0, 0, 80); diff --git a/htdocs/product/canvas/service/tpl/card_view.tpl.php b/htdocs/product/canvas/service/tpl/card_view.tpl.php index 8d2409ba5e2..29a0e18a8b7 100644 --- a/htdocs/product/canvas/service/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_view.tpl.php @@ -56,7 +56,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref'); photos) { ?> - diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 69cd6ba077c..11cbfa9ff14 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -272,13 +272,26 @@ class Product extends CommonObject public $accountancy_code_buy; /** - * Main barcode - * barcode value + * Main Barcode value * * @var string */ public $barcode; + /** + * Main Barcode type ID + * + * @var int + */ + public $barcode_type; + + /** + * Main Barcode type code + * + * @var string + */ + public $barcode_type_code; + /** * Additional barcodes (Some products have different barcodes according to the country of origin of manufacture) * @@ -294,7 +307,7 @@ class Product extends CommonObject public $multilangs=array(); - //! Taille de l'image + //! Size of image public $imgWidth; public $imgHeight; @@ -348,16 +361,7 @@ class Product extends CommonObject public $fields = array( - 'rowid' => array( - 'type'=>'integer', - 'label'=>'TechnicalID', - 'enabled'=>1, - 'visible'=>-2, - 'notnull'=>1, - 'index'=>1, - 'position'=>1, - 'comment'=>'Id', - ), + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), @@ -3716,7 +3720,7 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Fonction recursive uniquement utilisee par get_arbo_each_prod, recompose l'arborescence des sousproduits - * Define value of this->res + * Define value of this->res * * @param array $prod Products array * @param string $compl_path Directory path of parents to add before @@ -3730,7 +3734,7 @@ class Product extends CommonObject // phpcs:enable global $conf,$langs; - $product = new Product($this->db); + $tmpproduct = null; //var_dump($prod); foreach($prod as $id_product => $desc_pere) // $id_product is 0 (first call starting with root top) or an id of a sub_product { @@ -3746,23 +3750,26 @@ class Product extends CommonObject } //print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n"; - $this->fetch($id); // Load product - $this->load_stock('nobatch,novirtual'); // Load stock to get true this->stock_reel + if (is_null($tmpproduct)) $tmpproduct = new Product($this->db); // So we initialize tmpproduct only once for all loop. + $tmpproduct->fetch($id); // Load product to get ->ref + $tmpproduct->load_stock('nobatch,novirtual'); // Load stock to get true ->stock_reel + //$this->fetch($id); // Load product to get ->ref + //$this->load_stock('nobatch,novirtual'); // Load stock to get true ->stock_reel $this->res[]= array( - 'id'=>$id, // Id product - 'id_parent'=>$id_parent, - 'ref'=>$this->ref, // Ref product - 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_reel, // Stock - 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'label'=>$label, - 'fullpath'=>$compl_path.$label, // Label - 'type'=>$type, // Nb of units that compose parent product - 'desiredstock'=>$this->desiredstock, - 'level'=>$level, - 'incdec'=>$incdec, - 'entity'=>$this->entity + 'id'=>$id, // Id product + 'id_parent'=>$id_parent, + 'ref'=>$tmpproduct->ref, // Ref product + 'nb'=>$nb, // Nb of units that compose parent product + 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product + 'stock'=>$tmpproduct->stock_reel, // Stock + 'stock_alert'=>$tmpproduct->seuil_stock_alerte, // Stock alert + 'label'=>$label, + 'fullpath'=>$compl_path.$label, // Label + 'type'=>$type, // Nb of units that compose parent product + 'desiredstock'=>$tmpproduct->desiredstock, + 'level'=>$level, + 'incdec'=>$incdec, + 'entity'=>$tmpproduct->entity ); // Recursive call if there is childs to child diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 26970f1dd13..75f4bd469a1 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1557,12 +1557,12 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ { print '"; print '"; if (! empty($conf->dynamicprices->enabled)) { //Only if module is enabled @@ -1572,13 +1572,13 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ print ''; print ''; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 476fec36c2a..1ecb136d817 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -274,7 +274,7 @@ if ($resql) print '
'; print '
'; print ''; @@ -249,7 +249,7 @@ if ($resql) print '
label; ?> + photos; ?> label; ?> + photos; ?> '; if (empty($objp->price_by_qty)) { - print ($objp->price_base_type != 'TTC' ? price($objp->price) : ''); + print price($objp->price); } print "'; if (empty($objp->price_by_qty)) { - print ($objp->price_base_type == 'TTC' ? price($objp->price_ttc) : ''); + print price($objp->price_ttc); } print "'; if (empty($objp->price_by_qty)) { - print ($objp->price_base_type != 'TTC' ? price($objp->price_min) : ''); + print price($objp->price_min); } print ''; if (empty($objp->price_by_qty)) { - print ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : ''); + print price($objp->price_min_ttc); } print '
'; - // Lignes des champs de filtre + // Fields title search print ''; print ''; print ''; - // Lignes des titres + //Line for column titles print ""; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index faf91184dd1..5d569fc41be 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -271,7 +271,7 @@ if ($resql) print '
'; print '
'; print ''; @@ -303,7 +303,7 @@ if ($resql) print '
'; - // Lignes des champs de filtre + // Fields title search print ''; print ''; print ''; - // Lignes des titres + //Line for column titles print ""; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 8178df6b03c..8e19242d1c1 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -187,7 +187,7 @@ if ($result) print '
'; print '
'; print ''; @@ -299,7 +299,7 @@ if ($resql) print '
'."\n"; - // Lignes des champs de filtre + // Fields title search print ''; print '
'; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index b75042c7cca..85065e8ec2b 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -766,7 +766,7 @@ if ($resql) print '
'; print ''."\n"; - // Lignes des champs de filtre + // Fields title search print ''; if (! empty($arrayfields['m.rowid']['checked'])) { diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 836bb97e50c..efcbc534c08 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -742,7 +742,7 @@ if ($resql) print '
'; print '
'."\n"; - // Lignes des champs de filtre + // Fields title search print ''; if (! empty($arrayfields['m.rowid']['checked'])) { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 069be8aca96..b9799865e20 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -551,7 +551,7 @@ print '' ''. ''; -// Lignes des champs de filtre +// Fields title search print ''; print ''; print ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 08351fc752f..b4d2a8b290f 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -605,6 +605,7 @@ foreach ($listofreferent as $key => $value) if ($key == 'invoice') { if (! empty($element->close_code) && $element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice, do not include into total + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $element->type == Facture::TYPE_DEPOSIT) $qualifiedfortotal=false; // If hidden option to use deposits as payment (deprecated, not recommended to use this), deposits are not included } if ($key == 'propal') { diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 0f6e21f0984..62de885eac6 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -97,7 +97,7 @@ if (empty($reshook)) ), // All demo profile array('default'=>'0', 'key'=>'profdemoall','label'=>'ChooseYourDemoProfilMore', - 'disablemodules'=>'adherent,don,externalsite,mailmanspip', + 'disablemodules'=>'adherent,don,externalsite,mailmanspip,takepos', //'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot9.png' 'icon'=>DOL_URL_ROOT.'/public/demo/demo-profile-all.jpg' ) @@ -106,10 +106,10 @@ if (empty($reshook)) // Visible $alwayscheckedmodules=array('barcode','bookmark','categorie','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want - $alwaysuncheckedmodules=array('dav','dynamicprices','incoterm','loan','multicurrency','paybox','paypal','stripe','google','printing','scanner','skype','takepos','workflow','website'); // Module we dont want by default + $alwaysuncheckedmodules=array('dav','dynamicprices','incoterm','loan','multicurrency','paybox','paypal','stripe','google','printing','scanner','skype','website'); // Module we dont want by default // Not visible $alwayshiddencheckedmodules=array('accounting','api','barcode','blockedlog','bookmark','clicktodial','comptabilite','cron','document','domain','externalrss','externalsite','fckeditor','geoipmaxmind','gravatar','label','ldap', - 'mailmanspip','notification','oauth','syslog','user','webservices', + 'mailmanspip','notification','oauth','syslog','user','webservices','workflow', // Extended modules 'memcached','numberwords','zipautofillfr'); $alwayshiddenuncheckedmodules=array('debugbar','emailcollector','ftp','hrm','modulebuilder','webservicesclient','websites', @@ -392,10 +392,10 @@ foreach ($demoprofiles as $profilearray) //if ($modulo == 0) print ''; print ''; print '
'; - print '
'.$val->getName().'

'; + print '>
'; print '
'; //if ($modulo == ($nbcolsmod - 1)) print ''; $j++; diff --git a/htdocs/public/stripe/confirm_payment.php b/htdocs/public/stripe/confirm_payment.php index ea59b13dcb9..9ff9662ff84 100644 --- a/htdocs/public/stripe/confirm_payment.php +++ b/htdocs/public/stripe/confirm_payment.php @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +// TODO Do we really need this page. We alread have a ipn.php page ! + define("NOLOGIN", 1); // This means this output page does not require to be logged. define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. @@ -105,13 +107,13 @@ $intent = null; try { if (isset($json_obj->payment_method_id)) { // Create the PaymentIntent - $intent = \Stripe\PaymentIntent::create([ + $intent = \Stripe\PaymentIntent::create(array( 'payment_method' => $json_obj->payment_method_id, 'amount' => 1099, 'currency' => 'eur', 'confirmation_method' => 'manual', 'confirm' => true, - ]); + )); } if (isset($json_obj->payment_intent_id)) { $intent = \Stripe\PaymentIntent::retrieve( @@ -122,9 +124,9 @@ try { generatePaymentResponse($intent); } catch (\Stripe\Error\Base $e) { // Display error on client - echo json_encode([ + echo json_encode(array( 'error' => $e->getMessage() - ]); + )); } /* @@ -138,22 +140,22 @@ function generatePaymentResponse($intent) if ($intent->status == 'requires_source_action' && $intent->next_action->type == 'use_stripe_sdk') { // Tell the client to handle the action - echo json_encode([ + echo json_encode(array( 'requires_action' => true, 'payment_intent_client_secret' => $intent->client_secret - ]); + )); } elseif ($intent->status == 'succeeded') { // The payment didn’t need any additional actions and completed! // Handle post-payment fulfillment // TODO - echo json_encode([ + echo json_encode(array( "success" => true - ]); + )); } else { // Invalid status http_response_code(500); - echo json_encode(['error' => 'Invalid PaymentIntent status']); + echo json_encode(array('error' => 'Invalid PaymentIntent status')); } } diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 42774772eb5..b663aaa43c3 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -59,7 +59,7 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); */ // Add file in email form -if (GETPOST('addfile') && !GETPOST('add_ticket')) { +if (GETPOST('addfile', 'alpha') && ! GETPOST('add', 'alpha')) { ////$res = $object->fetch('','',GETPOST('track_id')); ////if($res > 0) ////{ @@ -77,7 +77,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) { } // Remove file -if (GETPOST('removedfile') && !GETPOST('add_ticket')) { +if (GETPOST('removedfile', 'alpha') && !GETPOST('add', 'alpha')) { include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; @@ -89,7 +89,7 @@ if (GETPOST('removedfile') && !GETPOST('add_ticket')) { dol_remove_file_process($_POST['removedfile'], 0, 0); $action = 'create_ticket'; } -if ($action == 'create_ticket' && GETPOST('add_ticket')) { +if ($action == 'create_ticket' && GETPOST('add', 'alpha')) { $error = 0; $origin_email = GETPOST('email', 'alpha'); if (empty($origin_email)) { @@ -311,7 +311,13 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $formmail->remove_attached_files($i); } - setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); + //setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); + + // Make a redirect to avoid to have ticket submitted twice if we make back + setEventMessages($langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '' . $object->track_id . ''), null, 'warnings'); + setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); + header("Location: index.php"); + exit; } } else { setEventMessages($object->error, $object->errors, 'errors'); @@ -324,21 +330,23 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { * View */ -$arrayofjs = array(); -$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php'); - -llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss); - $form = new Form($db); $formticket = new FormTicket($db); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) +{ print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; $db->close(); exit(); } -print '
'; +$arrayofjs = array(); +$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php'); + +llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss); + + +print '
'; if ($action != "infos_success") { $formticket->withfromsocid = isset($socid) ? $socid : $user->societe_id; @@ -361,11 +369,8 @@ if ($action != "infos_success") { print '
' . $langs->trans('TicketPublicInfoCreateTicket') . '
'; $formticket->showForm(); -} else { - print '
' . $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '' . $object->track_id . ''); - print '
'; - print $langs->trans('PleaseRememberThisId'); } + print '
'; // End of page diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index a3e4d63a4bc..2e138312102 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -55,18 +55,18 @@ $action = GETPOST('action', 'alpha'); $form = new Form($db); $formticket = new FormTicket($db); -$arrayofjs = array(); -$arrayofcss = array('/ticket/css/styles.css.php'); - if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print $langs->trans('TicketPublicInterfaceForbidden'); exit; } +$arrayofjs = array(); +$arrayofcss = array('/ticket/css/styles.css.php'); + llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -print '
'; +print '
'; print '

' . ($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")) . '

'; print '
'; print '
' . dol_escape_htmltag($langs->trans("CreateTicket")) . '
'; diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 443af658cb5..9da0a4272e1 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -155,21 +155,23 @@ $user_assign = new User($db); $user_create = new User($db); $formTicket = new FormTicket($db); +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { + print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; + $db->close(); + exit(); +} + $arrayofjs = array(); $arrayofcss = array('/ticket/css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { - print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; - $db->close(); - exit(); -} -print '
'; +print '
'; if ($action == "view_ticketlist") { + print '
'; if ($display_ticket_list) { // Filters $search_fk_status = GETPOST("search_fk_status", 'alpha'); @@ -676,6 +678,7 @@ if ($action == "view_ticketlist") } } else { print '

' . $langs->trans("TicketPublicMsgViewLogIn") . '

'; + print '
'; print '
'; print ''; diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index a0311ce1430..69a77413b2e 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -133,18 +133,18 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | $form = new Form($db); $formticket = new FormTicket($db); +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { + print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; + $db->close(); + exit(); +} + $arrayofjs = array(); $arrayofcss = array('/ticket/css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { - print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; - $db->close(); - exit(); -} - -print '
'; +print '
'; if ($action == "view_ticket" || $action == "add_message" || $action == "close" || $action == "confirm_public_close") { if ($display_ticket) { @@ -298,7 +298,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | print ''; } } else { - print '

' . $langs->trans("TicketPublicMsgViewLogIn") . '

'; + print '

' . $langs->trans("TicketPublicMsgViewLogIn") . '

'; print '
'; print ''; diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index d51062ef7ef..c3deb28c4bc 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -257,7 +257,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); - // Lignes de contacts + // Lines of contacts echo '
'; // Contacts lines (modules that overwrite templates must declare this into descriptor) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index e40be9f0d10..17518df8ab6 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -628,7 +628,7 @@ if ($resql) print '
'; print '
 
'."\n"; - // Lignes des champs de filtre + // Fields title search print ''; // Ref if (! empty($arrayfields['e.ref']['checked'])) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 772d8d3fe10..f94e182b010 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -378,6 +378,48 @@ class Contacts extends DolibarrApi return $result; } + /** + * Add a category to a contact + * + * @url POST {id}/categories/{category_id} + * + * @param int $id Id of contact + * @param int $category_id Id of category + * + * @return mixed + * + * @throws 401 RestException Insufficient rights + * @throws 401 RestException Access not allowed for login + * @throws 404 RestException Category not found + * @throws 404 RestException Contact not found + */ + public function addCategory($id, $category_id) + { + if(! DolibarrApiAccess::$user->rights->societe->contact->creer) { + throw new RestException(401, 'Insufficient rights'); + } + + $result = $this->contact->fetch($id); + if (! $result) { + throw new RestException(404, 'Contact not found'); + } + $category = new Categorie($this->db); + $result = $category->fetch($category_id); + if (! $result) { + throw new RestException(404, 'category not found'); + } + + if (! DolibarrApi::_checkAccessToResource('contact', $this->contact->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + if (! DolibarrApi::_checkAccessToResource('category', $category->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $category->add_type($this->contact, 'contact'); + + return $this->_cleanObjectDatas($this->contact); + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index adae31e7677..95aad3a003b 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1041,7 +1041,7 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i=0; - $accounts =[]; + $accounts = array(); if ($result) { @@ -1061,12 +1061,12 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( } - $fields = ['socid', 'default_rib', 'frstrecur', '1000110000001', 'datec', 'datem', 'label', 'bank', 'bic', 'iban', 'id', 'rum']; + $fields = array('socid', 'default_rib', 'frstrecur', '1000110000001', 'datec', 'datem', 'label', 'bank', 'bic', 'iban', 'id', 'rum'); - $returnAccounts = []; + $returnAccounts = array(); foreach($accounts as $account){ - $object= []; + $object= array(); foreach($account as $key => $value) if(in_array($key, $fields)){ $object[$key] = $value; @@ -1308,7 +1308,7 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i=0; - $accounts =[]; + $accounts = array(); $num = $db->num_rows($result); while ($i < $num) @@ -1322,12 +1322,12 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( $i++; } - $fields = ['id', 'fk_soc', 'key_account', 'site', 'date_creation', 'tms']; + $fields = array('id', 'fk_soc', 'key_account', 'site', 'date_creation', 'tms'); - $returnAccounts = []; + $returnAccounts = array(); foreach($accounts as $account){ - $object= []; + $object= array(); foreach($account as $key => $value) if(in_array($key, $fields)){ $object[$key] = $value; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6a3596f6e24..51a7ccb24bb 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -637,6 +637,16 @@ if (empty($reshook)) elseif ($action == 'deletecard' && $source) { try { + if (preg_match('/pm_/', $source)) + { + $payment_method = \Stripe\PaymentMethod::retrieve($source, array("stripe_account" => $stripeacc)); + if ($payment_method) + { + $payment_method->detach(); + } + } + else + { $cu=$stripe->customerStripe($object, $stripeacc, $servicestatus); $card=$cu->sources->retrieve("$source"); if ($card) @@ -645,6 +655,7 @@ if (empty($reshook)) if (method_exists($card, 'detach')) $card->detach(); else $card->delete(); } + } $url=DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id; header('Location: '.$url); diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index d8d0c656dab..6b910236e96 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -389,7 +389,7 @@ class Stripe extends CommonObject "confirmation_method" => $mode, "amount" => $stripeamount, "currency" => $currency_code, - "payment_method_types" => ["card"], + "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) //"save_payment_method" => true, diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index 1b5c08119d1..c97ea508448 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -64,7 +64,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title $head = supplier_proposal_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("CommRequests"), 0, 'supplier_proposal'); +dol_fiche_head($head, 'attributes', $langs->trans("CommRequests"), -1, 'supplier_proposal'); print $langs->trans("DefineHereComplementaryAttributes", $textobject).'
'."\n"; diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index b3b0e482f62..c54e65ad825 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -69,7 +69,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title $head = supplier_proposal_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines', $langs->trans("CommRequests"), 0, 'supplier_proposal'); +dol_fiche_head($head, 'attributeslines', $langs->trans("CommRequests"), -1, 'supplier_proposal'); print $langs->trans("DefineHereComplementaryAttributes", $textobject).'
'."\n"; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 56473959a39..60034cc7bc0 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -77,6 +77,9 @@ $NBLINES = 4; if (! empty($user->societe_id)) $socid = $user->societe_id; $result = restrictedArea($user, 'supplier_proposal', $id); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('supplier_proposalcard','globalcard')); + $object = new SupplierProposal($db); $extrafields = new ExtraFields($db); @@ -92,9 +95,6 @@ if ($id > 0 || ! empty($ref)) { dol_print_error('', $object->error); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('supplier_proposalcard','globalcard')); - $permissionnote = $user->rights->supplier_proposal->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->supplier_proposal->creer; // Used by the include of actions_dellink.inc.php $permissiontoedit=$user->rights->supplier_proposal->creer; // Used by the include of actions_lineupdown.inc.php @@ -565,9 +565,9 @@ if (empty($reshook)) $error ++; } - if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. + if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise === '') // Unit price can be 0 but not ''. Also price can be negative for proposal. { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPrice")), null, 'errors'); $error ++; } if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) { @@ -585,7 +585,7 @@ if (empty($reshook)) // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit - if ($prod_entry_mode != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' + if (($prod_entry_mode != 'free') && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { $productsupplier = new ProductFournisseur($db); @@ -595,7 +595,7 @@ if (empty($reshook)) if (preg_match('/^idprod_([0-9]+)$/', GETPOST('idprodfournprice', 'alpha'), $reg)) { $idprod=$reg[1]; - $res=$productsupplier->fetch($idprod); + $res=$productsupplier->fetch($idprod); // Load product from its ID // Call to init some price properties of $productsupplier // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price if (! empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER)) @@ -632,23 +632,21 @@ if (empty($reshook)) 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; - $type = $productsupplier->type; $price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT'); $ref_supplier = $productsupplier->ref_supplier; - $fk_unit = $productsupplier->fk_unit; - $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha')); $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha')); - if (empty($tva_tx)) $tva_npr=0; $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); - $result=$object->addline( + $pu_ht = $productsupplier->fourn_pu; + if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value + + $result=$object->addline( $desc, $pu_ht, $qty, @@ -669,7 +667,7 @@ if (empty($reshook)) $label, $array_options, $ref_supplier, - $fk_unit, + $productsupplier->fk_unit, '', 0, $productsupplier->fourn_multicurrency_unitprice @@ -730,6 +728,8 @@ if (empty($reshook)) { $db->commit(); + $ret=$object->fetch($object->id); // Reload to get new records + // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -798,32 +798,52 @@ if (empty($reshook)) // Mise a jour d'une ligne dans la demande de prix elseif ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('save') == $langs->trans("Save")) { + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + // Define info_bits $info_bits = 0; - if (preg_match('/\*/', GETPOST('tva_tx'))) + if (preg_match('/\*/', $vat_rate)) $info_bits |= 0x01; - // Clean parameters + // Clean parameters $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'none')); // Define vat_rate - $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $vat_rate = str_replace('*', '', $vat_rate); - $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty); - $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); - $pu_ht = GETPOST('price_ht') ? GETPOST('price_ht') : 0; + $localtax1_rate = get_localtax($vat_rate, 1, $mysoc, $object->thirdparty); + $localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty); + + if (GETPOST('price_ht') != '') + { + $price_base_type = 'HT'; + $ht = price2num(GETPOST('price_ht')); + } + else + { + $vatratecleaned = $vat_rate; + if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" + { + $vatratecleaned = trim($reg[1]); + $vatratecode = $reg[2]; + } + + $ttc = price2num(GETPOST('price_ttc')); + $ht = $ttc / (1 + ($vatratecleaned / 100)); + $price_base_type = 'HT'; + } + + $pu_ht_devise = GETPOST('multicurrency_subprice'); // Add buying price $fournprice = (GETPOST('fournprice') ? GETPOST('fournprice') : ''); $buyingprice = (GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value - // Extrafields + // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); - // Unset extrafield + // Unset extrafield POST Data if (is_array($extralabelsline)) { - // Get extra fields foreach ($extralabelsline as $key => $value) { unset($_POST["options_" . $key]); } @@ -869,9 +889,33 @@ if (empty($reshook)) if (! $error) { $db->begin(); + $ref_supplier = GETPOST('fourn_ref', 'alpha'); $fk_unit = GETPOST('units'); - $result = $object->updateline(GETPOST('lineid'), $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $array_options, $ref_supplier, $fk_unit); + + $result = $object->updateline( + GETPOST('lineid'), + $ht, + GETPOST('qty'), + GETPOST('remise_percent'), + $vat_rate, + $localtax1_rate, + $localtax2_rate, + $description, + $price_base_type, + $info_bits, + $special_code, + GETPOST('fk_parent_line'), + 0, + $fournprice, + $buyingprice, + $label, + $type, + $array_options, + $ref_supplier, + $fk_unit, + $pu_ht_devise + ); if ($result >= 0) { $db->commit(); @@ -1705,8 +1749,8 @@ if ($action == 'create') print '
'; // Add free products/services form - global $forceall, $senderissupplier, $dateSelector; - $forceall=1; $dateSelector=0; + global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; + $forceall=1; $dateSelector=0; $inputalsopricewithtax=1; $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty. if (! empty($conf->global->SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 74073c0d7e4..2725cd18190 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -655,9 +655,10 @@ class SupplierProposal extends CommonObject * @param array $array_option extrafields array * @param string $ref_supplier Supplier price reference * @param int $fk_unit Id of the unit to use. + * @param double $pu_ht_devise Unit price in currency * @return int 0 if OK, <0 if KO */ - public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $array_option = 0, $ref_supplier = '', $fk_unit = '') + public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $array_option = 0, $ref_supplier = '', $fk_unit = '', $pu_ht_devise = 0) { global $conf,$user,$langs, $mysoc; @@ -684,10 +685,17 @@ class SupplierProposal extends CommonObject // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); - $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. + $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $mysoc, $this->thirdparty); - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx); + // Clean vat code + $vat_src_code=''; + if (preg_match('/\((.*)\)/', $txtva, $reg)) + { + $vat_src_code = $reg[1]; + $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. + } + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -726,7 +734,9 @@ class SupplierProposal extends CommonObject $this->line->label = $label; $this->line->desc = $desc; $this->line->qty = $qty; - $this->line->product_type = $type; + $this->line->product_type = $type; + + $this->line->vat_src_code = $vat_src_code; $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index fe010c95e9c..dabf49215fd 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -391,7 +391,7 @@ if ($resql) $newcardbutton.= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create'); } - // Lignes des champs de filtre + // Fields title search print ''; if ($optioncss != '') print ''; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e66e2e52eec..7fb121fd90c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1353,7 +1353,7 @@ img.photorefnoborder { } .trextrafieldseparator td { /* border-bottom: 2px solid rgb() !important; */ - border-bottom: 2px solid rgb() !important; + border-bottom: 2px dashed rgb() !important; } .tdhrthin { @@ -5252,6 +5252,9 @@ div.tabsElem a.tab { /* Ticket module */ /* ============================================================================== */ +.publicnewticketform { + margin-top: 25px !important; +} #cd-timeline { position: relative; padding: 2em 0; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6fd50fa42b3..c15bbf26eef 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1562,6 +1562,10 @@ img.photorefnoborder { .underbanner { border-bottom: px solid rgb(); } + +.trextrafieldseparator td { + border-bottom: 1px solid rgb() !important; +} .tdhrthin { margin: 0; padding-bottom: 0 !important; @@ -1932,7 +1936,6 @@ a.tmenuimage:focus { } - /* Login */ .bodylogin @@ -5384,7 +5387,6 @@ border-top-right-radius: 6px; } - /* ============================================================================== */ /* Public */ /* ============================================================================== */ @@ -5398,26 +5400,14 @@ border-top-right-radius: 6px; } - -::-webkit-scrollbar { - width: 12px; -} -::-webkit-scrollbar-button { - background: #aaa -} -::-webkit-scrollbar-track-piece { - background: #fff -} -::-webkit-scrollbar-thumb { - background: #ddd -}​ - - - /* ============================================================================== */ /* Ticket module */ /* ============================================================================== */ +.publicnewticketform { + margin-top: 25px !important; +} + #cd-timeline { position: relative; padding: 2em 0; @@ -5829,6 +5819,22 @@ border-top-right-radius: 6px; +/* This must be at end */ +::-webkit-scrollbar { + width: 12px; +} +::-webkit-scrollbar-button { + background: #aaa; +} +::-webkit-scrollbar-track-piece { + background: #fff; +} +::-webkit-scrollbar-thumb { + background: #ddd; +}​ + + + global->MAIN_DISABLE_FONT_AWESOME_5)) { ?> trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1': '').'&leftmenu='); } -$morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); +$morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list paddingleft', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); print load_fiche_titre($title, $morehtmlright.' '.$newcardbutton); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index ad310b0041e..8c780c703f7 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -304,7 +304,7 @@ print ''; print ''; -$morehtmlright.= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-sitemap', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); +$morehtmlright.= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-sitemap paddingleft', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'title_generic', 0, $morehtmlright.' '.$newcardbutton, '', $limit); diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php index f9c0928bad2..921d0e6d70d 100644 --- a/test/phpunit/ActionCommTest.php +++ b/test/phpunit/ActionCommTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ActionCommTest extends PHPUnit_Framework_TestCase +class ActionCommTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index bd5ae5571cc..c83df4da0d2 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class AdherentTest extends PHPUnit_Framework_TestCase +class AdherentTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index bbf5ae2da00..21133d21072 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class AdminLibTest extends PHPUnit_Framework_TestCase +class AdminLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/BOMTest.php b/test/phpunit/BOMTest.php index ace04f7ba71..1179b35e6e1 100644 --- a/test/phpunit/BOMTest.php +++ b/test/phpunit/BOMTest.php @@ -28,7 +28,7 @@ namespace test\unit; * Class BillOfMaterialsTest * @package Testbillofmaterials */ -class BOMTest extends \PHPUnit_Framework_TestCase +class BOMTest extends \PHPUnit\Framework\TestCase { /** * Global test setup diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index fa150742c4b..94149bd0ad5 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -46,7 +46,7 @@ $langs->load("main"); * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class BankAccountTest extends PHPUnit_Framework_TestCase +class BankAccountTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php index 4ba05b2c0b6..d65d2066c2a 100644 --- a/test/phpunit/BonPrelevementTest.php +++ b/test/phpunit/BonPrelevementTest.php @@ -47,7 +47,7 @@ $langs->load("main"); * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class BonPrelevementTest extends PHPUnit_Framework_TestCase +class BonPrelevementTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index e8fa72a8f40..442b76091ff 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -74,7 +74,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class BuildDocTest extends PHPUnit_Framework_TestCase +class BuildDocTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index b664b345c26..9941eaa67da 100755 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CMailFileTest extends PHPUnit_Framework_TestCase +class CMailFileTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index 80761a6e594..46d8dbe875b 100644 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CategorieTest extends PHPUnit_Framework_TestCase +class CategorieTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index b037e50752d..9eabbf20fa0 100644 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ChargeSocialesTest extends PHPUnit_Framework_TestCase +class ChargeSocialesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index db6b3299bd5..b7636a5c934 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -57,7 +57,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CodingPhpTest extends PHPUnit_Framework_TestCase +class CodingPhpTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 277328339ee..c249c47bd91 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CommandeFournisseurTest extends PHPUnit_Framework_TestCase +class CommandeFournisseurTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 00a0a4983c9..570165f3382 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CommandeTest extends PHPUnit_Framework_TestCase +class CommandeTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index 549540bb0d0..e4bd0f73518 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CommonObjectTest extends PHPUnit_Framework_TestCase +class CommonObjectTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 58eebfd0207..08749d12619 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CompanyBankAccountTest extends PHPUnit_Framework_TestCase +class CompanyBankAccountTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CompanyLibTest.php b/test/phpunit/CompanyLibTest.php index 0fb1722aee9..9e211441103 100644 --- a/test/phpunit/CompanyLibTest.php +++ b/test/phpunit/CompanyLibTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CompanyLibTest extends PHPUnit_Framework_TestCase +class CompanyLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index ef43bd06311..c0ed8d7843f 100755 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -53,7 +53,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ContactTest extends PHPUnit_Framework_TestCase +class ContactTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index c5342865979..c763a976172 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ContratTest extends PHPUnit_Framework_TestCase +class ContratTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index 51a0f54698f..4720df9014c 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -47,7 +47,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class CoreTest extends PHPUnit_Framework_TestCase +class CoreTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 6424cb4d8df..cc4f50705e0 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class DateLibTest extends PHPUnit_Framework_TestCase +class DateLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index fa7aef2bed8..8913c56a77d 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class DateLibTzFranceTest extends PHPUnit_Framework_TestCase +class DateLibTzFranceTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php index cd73a7ad173..8c461aba88a 100644 --- a/test/phpunit/DiscountTest.php +++ b/test/phpunit/DiscountTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class DiscountTest extends PHPUnit_Framework_TestCase +class DiscountTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index a2c0e78ee96..61bb5fe1b49 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class EntrepotTest extends PHPUnit_Framework_TestCase +class EntrepotTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index c4b3e2a707a..570afd8bb18 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ExpenseReportTest extends PHPUnit_Framework_TestCase +class ExpenseReportTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index 7403cba3ddf..5497f88cd67 100644 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -49,7 +49,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ExportTest extends PHPUnit_Framework_TestCase +class ExportTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index 33d503825ac..4d7df1f0ed7 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FactureFournisseurTest extends PHPUnit_Framework_TestCase +class FactureFournisseurTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index de1bb164451..5d9021032a2 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FactureRecTest extends PHPUnit_Framework_TestCase +class FactureRecTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 4f680ba32db..3c066380b09 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FactureTest extends PHPUnit_Framework_TestCase +class FactureTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index a0df47cd97f..1716bd51153 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FactureTestRounding extends PHPUnit_Framework_TestCase +class FactureTestRounding extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index 35680559581..c81e1c99e1a 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FichinterTest extends PHPUnit_Framework_TestCase +class FichinterTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 2411c5c9cf3..cbe6ad948d8 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FilesLibTest extends PHPUnit_Framework_TestCase +class FilesLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/FormAdminTest.php b/test/phpunit/FormAdminTest.php index 8532d6ac283..20c22a76cd8 100644 --- a/test/phpunit/FormAdminTest.php +++ b/test/phpunit/FormAdminTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class FormAdminTest extends PHPUnit_Framework_TestCase +class FormAdminTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 50efabf9403..a83ba0f4859 100644 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -48,7 +48,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class Functions2LibTest extends PHPUnit_Framework_TestCase +class Functions2LibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index a352a1722b9..7e3fc6a8069 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -47,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class HolidayTest extends PHPUnit_Framework_TestCase +class HolidayTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php index 4ecaab49d39..445fe572b61 100644 --- a/test/phpunit/ImagesLibTest.php +++ b/test/phpunit/ImagesLibTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ImagesLibTest extends PHPUnit_Framework_TestCase +class ImagesLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index 10d906f2ede..5a11a770842 100644 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -47,7 +47,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ImportTest extends PHPUnit_Framework_TestCase +class ImportTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index a84a78a7c75..c123f2e6ff6 100644 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -47,7 +47,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page i * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class JsonLibTest extends PHPUnit_Framework_TestCase +class JsonLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 228cde51901..71d467b78d3 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -57,7 +57,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class LangTest extends PHPUnit_Framework_TestCase +class LangTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/LoanTest.php b/test/phpunit/LoanTest.php index b0ecd583514..e0cc1f5b5ff 100644 --- a/test/phpunit/LoanTest.php +++ b/test/phpunit/LoanTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class LoanTest extends PHPUnit_Framework_TestCase +class LoanTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/MarginsLibTest.php b/test/phpunit/MarginsLibTest.php index 81f4a512e4f..84fb59c81ec 100644 --- a/test/phpunit/MarginsLibTest.php +++ b/test/phpunit/MarginsLibTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class MarginsLibTest extends PHPUnit_Framework_TestCase +class MarginsLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index ea16813d873..38a630b46e0 100755 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ModulesTest extends PHPUnit_Framework_TestCase +class ModulesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index cac49f34a7a..ba7b093596f 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -47,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class MouvementStockTest extends PHPUnit_Framework_TestCase +class MouvementStockTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index 66c4c670128..57c376b702b 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class NumberingModulesTest extends PHPUnit_Framework_TestCase +class NumberingModulesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PaypalTest.php b/test/phpunit/PaypalTest.php index 98300a6a86a..54913b1e5f9 100644 --- a/test/phpunit/PaypalTest.php +++ b/test/phpunit/PaypalTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PaypalTest extends PHPUnit_Framework_TestCase +class PaypalTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index 634a931da56..bece387b93f 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PdfDocTest extends PHPUnit_Framework_TestCase +class PdfDocTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php index a1fcc180528..743328abb71 100644 --- a/test/phpunit/PgsqlTest.php +++ b/test/phpunit/PgsqlTest.php @@ -47,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PgsqlTest extends PHPUnit_Framework_TestCase +class PgsqlTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 0203a1d4275..32babae209c 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -52,7 +52,7 @@ if (! empty($conf->global->MAIN_ROUNDING_RULE_TOT)) * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PricesTest extends PHPUnit_Framework_TestCase +class PricesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index c57ef426d0b..782d5f076e8 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ProductTest extends PHPUnit_Framework_TestCase +class ProductTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; @@ -168,6 +168,31 @@ class ProductTest extends PHPUnit_Framework_TestCase return $localobject; } + /** + * testProductGetArboEachProd + * + * @return void + */ + public function testProductGetArboEachProd() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + /* + $localobject=new Product($db); + $localobject->fetch(208); + $localobject->get_sousproduits_arbo(); + $localobject->get_arbo_each_prod(); + + var_dump($localobject->res); print (json_encode($localobject->res)); exit; + */ + + return; + } + /** * testProductUpdate * diff --git a/test/phpunit/ProjectTest.php b/test/phpunit/ProjectTest.php index faa533e2c00..886463be104 100644 --- a/test/phpunit/ProjectTest.php +++ b/test/phpunit/ProjectTest.php @@ -46,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ProjectTest extends PHPUnit_Framework_TestCase +class ProjectTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 6a3d17d7806..b0331a5575f 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class PropalTest extends PHPUnit_Framework_TestCase +class PropalTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/RestAPIDocumentTest.php b/test/phpunit/RestAPIDocumentTest.php index f0d3efe34e6..08ea79352d3 100644 --- a/test/phpunit/RestAPIDocumentTest.php +++ b/test/phpunit/RestAPIDocumentTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_UMASK = '0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class RestAPIDocumentTest extends PHPUnit_Framework_TestCase +class RestAPIDocumentTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index 39f924e7e04..b44fb7aaccc 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -47,7 +47,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class RestAPIUserTest extends PHPUnit_Framework_TestCase +class RestAPIUserTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php index 4e43a036c7e..e4a2263e849 100644 --- a/test/phpunit/ScriptsTest.php +++ b/test/phpunit/ScriptsTest.php @@ -57,7 +57,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class ScriptsTest extends PHPUnit_Framework_TestCase +class ScriptsTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 636fa923bc0..b457c4c0fa7 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -57,7 +57,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class SecurityTest extends PHPUnit_Framework_TestCase +class SecurityTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 11eb6711862..f823d8a4803 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class SocieteTest extends PHPUnit_Framework_TestCase +class SocieteTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index 14a63776444..ee95e882572 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class SupplierProposalTest extends PHPUnit_Framework_TestCase +class SupplierProposalTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/TicketTest.php b/test/phpunit/TicketTest.php index e5367d03fbe..4d7ce3363ed 100644 --- a/test/phpunit/TicketTest.php +++ b/test/phpunit/TicketTest.php @@ -45,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class TicketTest extends PHPUnit_Framework_TestCase +class TicketTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index e524b989172..be230655fe1 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class UserGroupTest extends PHPUnit_Framework_TestCase +class UserGroupTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index b87dfd84494..e993ed981a6 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class UserTest extends PHPUnit_Framework_TestCase +class UserTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/UtilsTest.php b/test/phpunit/UtilsTest.php index 58074af1c1f..5a913977ccc 100644 --- a/test/phpunit/UtilsTest.php +++ b/test/phpunit/UtilsTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class UtilsTest extends PHPUnit_Framework_TestCase +class UtilsTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index fb8e36af6a1..77ad0902ec2 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -49,7 +49,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase +class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index 8b989df273f..8e6312ac039 100644 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesOrdersTest extends PHPUnit_Framework_TestCase +class WebservicesOrdersTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index bdc3a15b2b9..5c19414966b 100644 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesOtherTest extends PHPUnit_Framework_TestCase +class WebservicesOtherTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index 90147a429a4..ff78d9d91bb 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -55,7 +55,7 @@ if (empty($conf->service->enabled)) * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesProductsTest extends PHPUnit_Framework_TestCase +class WebservicesProductsTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index cb1f26d1980..4effe555d2f 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase +class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index 7ca0d9e8ee8..d7df632e413 100644 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class WebservicesUserTest extends PHPUnit_Framework_TestCase +class WebservicesUserTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser; diff --git a/test/phpunit/XCalLibTest.php b/test/phpunit/XCalLibTest.php index 4783bf4bc8f..602ec11e46d 100644 --- a/test/phpunit/XCalLibTest.php +++ b/test/phpunit/XCalLibTest.php @@ -44,7 +44,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class XCalLibTest extends PHPUnit_Framework_TestCase +class XCalLibTest extends PHPUnit\Framework\TestCase { protected $savconf; protected $savuser;