From 24ae5a0ca653edc88e0a3feec6d3dfce44221ad0 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 24 Jul 2015 11:37:15 +0200 Subject: [PATCH 01/96] FIX virtual stock for virtual product --- htdocs/product/class/product.class.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 13368f652a9..d913f0a1a3f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1868,6 +1868,32 @@ class Product extends CommonObject $this->stats_commande['nb']=$obj->nb; $this->stats_commande['rows']=$obj->nb_rows; $this->stats_commande['qty']=$obj->qty?$obj->qty:0; + + // if it's a virtual product, maybe it is in order by extension + $TFather = $this->getFather(); + if(is_array($TFather) && !empty($TFather)) { + + foreach($TFather as &$fatherData) { + + $pFather = new Product($this->db); + $pFather->id = $fatherData['id']; + $qtyCoef = $fatherData['qty']; + + if($fatherData['incdec']) { + $pFather->load_stats_commande($socid, $filtrestatut); + + $this->stats_commande['customers']+=$pFather->stats_commande['customers']; + $this->stats_commande['nb']+=$pFather->stats_commande['nb']; + $this->stats_commande['rows']+=$pFather->stats_commande['rows']; + $this->stats_commande['qty']+=$pFather->stats_commande['qty'] * $qtyCoef; + + } + + + } + + } + return 1; } else From 4ebd1ff8a2c5fe1452e42866cff9b6d5d65cdd34 Mon Sep 17 00:00:00 2001 From: Benlo Date: Wed, 12 Oct 2016 12:30:22 +0200 Subject: [PATCH 02/96] Permit to print Total TTC price in objectline --- htdocs/core/class/commonobject.class.php | 4 +++- htdocs/core/tpl/objectline_view.tpl.php | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) mode change 100644 => 100755 htdocs/core/tpl/objectline_view.tpl.php diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a82a4c9e537..a09253e02ea 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3277,7 +3277,7 @@ abstract class CommonObject { global $conf, $hookmanager, $langs, $user; // TODO We should not use global var for this ! - global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove; + global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $inputalsopricetotalwithtax; // Define usemargins $usemargins=0; @@ -3340,6 +3340,8 @@ abstract class CommonObject // Multicurrency if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('TotalHTShortCurrency').''; + if ($inputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; + print ''; // No width to allow autodim print ''; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php old mode 100644 new mode 100755 index 559cae91464..acdc33db3f1 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -36,7 +36,7 @@ * $type, $text, $description, $line */ -global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins; +global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins, $inputalsopricetotalwithtax; $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; @@ -45,6 +45,7 @@ if (empty($dateSelector)) $dateSelector=0; if (empty($forceall)) $forceall=0; if (empty($senderissupplier)) $senderissupplier=0; if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; +if (empty($inputalsopricetotalwithtax)) $inputalsopricetotalwithtax=0; if (empty($usemargins)) $usemargins=0; ?> @@ -201,6 +202,10 @@ if (empty($usemargins)) $usemargins=0; multicurrency_total_ht); ?> + + total_ttc); ?> + + statut == 0 && ($object_rights->creer)) { ?> From d848e98759937e7b5f6e7e065f6734fe791571d7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 12 Oct 2016 15:33:33 +0200 Subject: [PATCH 03/96] Fix: add possibility to change width type to prevent some display issues --- htdocs/core/lib/ajax.lib.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4b0ae91ee3f..ab6828581a8 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -35,7 +35,7 @@ * @param string $urloption More parameters on URL request * @param int $minLength Minimum number of chars to trigger that Ajax search * @param int $autoselect Automatic selection if just one value - * @param array $ajaxoptions Multiple options array + * @param array $ajaxoptions Multiple options array * Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done * Ex: array('disabled'=> * Ex: array('show'=> @@ -61,8 +61,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt $("input#search_'.$htmlname.'").keydown(function() { $("#'.$htmlname.'").val(""); }); - - /* I disable this. A call to trigger is already done later into the select action of the autocomplete code + + /* I disable this. A call to trigger is already done later into the select action of the autocomplete code $("input#search_'.$htmlname.'").change(function() { console.log("Call the change trigger on input '.$htmlname.' because of a change on search_'.$htmlname.' was triggered"); $("#'.$htmlname.'").trigger("change"); @@ -291,7 +291,7 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLengt needtotrigger="#" + fields[i]; } } - + if (needtotrigger != "") // To force select2 to refresh visible content { // We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done @@ -366,6 +366,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $ if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; if (empty($conf->use_javascript_ajax)) return ''; + $widthTypeOfAutocomplete = (!empty($conf->global->MAIN_WIDTH_TYPE_OF_AUTOCOMPLETE) ? $conf->global->MAIN_WIDTH_TYPE_OF_AUTOCOMPLETE : 'resolve'); if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0; $tmpplugin='select2'; @@ -374,7 +375,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $ $(document).ready(function () { $(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({ dir: \'ltr\', - width: \'resolve\', /* off or resolve */ + width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */ minimumInputLength: '.$minLengthToAutocomplete.' })'; if ($forcefocus) $msg.= '.select2(\'focus\')'; From 6423b23fb3fc5a890ceddc778f367d56b3ed4529 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 12 Oct 2016 15:36:51 +0200 Subject: [PATCH 04/96] Fix: use parameter instead constant --- htdocs/core/lib/ajax.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index ab6828581a8..756fbcf9672 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -357,7 +357,7 @@ function ajax_dialog($title,$message,$w=350,$h=150) * @param int $forcefocus Force focus on field * @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason. */ -function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0) +function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve') { global $conf; @@ -366,7 +366,6 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $ if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; if (empty($conf->use_javascript_ajax)) return ''; - $widthTypeOfAutocomplete = (!empty($conf->global->MAIN_WIDTH_TYPE_OF_AUTOCOMPLETE) ? $conf->global->MAIN_WIDTH_TYPE_OF_AUTOCOMPLETE : 'resolve'); if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0; $tmpplugin='select2'; From a46e7d8e1abc9cbdb753d2b45081b2a45945c572 Mon Sep 17 00:00:00 2001 From: Benoit Date: Mon, 24 Oct 2016 10:18:24 +0200 Subject: [PATCH 05/96] Change inputalsopricetotalwithtax to outputalsopricetotalwithtax --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/tpl/objectline_view.tpl.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a09253e02ea..824c9b032ad 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3277,7 +3277,7 @@ abstract class CommonObject { global $conf, $hookmanager, $langs, $user; // TODO We should not use global var for this ! - global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $inputalsopricetotalwithtax; + global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $outputalsopricetotalwithtax; // Define usemargins $usemargins=0; @@ -3340,7 +3340,7 @@ abstract class CommonObject // Multicurrency if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('TotalHTShortCurrency').''; - if ($inputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; + if ($outputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; print ''; // No width to allow autodim diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index acdc33db3f1..4df9eb517b1 100755 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -36,7 +36,7 @@ * $type, $text, $description, $line */ -global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins, $inputalsopricetotalwithtax; +global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins, $outputalsopricetotalwithtax; $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; @@ -45,7 +45,7 @@ if (empty($dateSelector)) $dateSelector=0; if (empty($forceall)) $forceall=0; if (empty($senderissupplier)) $senderissupplier=0; if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; -if (empty($inputalsopricetotalwithtax)) $inputalsopricetotalwithtax=0; +if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; if (empty($usemargins)) $usemargins=0; ?> @@ -202,7 +202,7 @@ if (empty($usemargins)) $usemargins=0; multicurrency_total_ht); ?> - + total_ttc); ?> From 52e0d1cec40d5348ba73940e26dbb26d814f77f0 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 29 Oct 2016 06:06:44 +0200 Subject: [PATCH 06/96] Correct typo --- htdocs/compta/resultat/clientfourn.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 63d4b9930ed..c2ef7fc7a45 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -534,14 +534,14 @@ if ($modecompta == 'CREANCES-DETTES') print ''.price(-$subtotal_ttc).''; print ''; -if ($mysoc->tva_assuj == 'franchise') // Non assujeti +if ($mysoc->tva_assuj == 'franchise') // Non assujetti { // Total print ''; print ' '; print ''; - print ''.$langs->trans("Profit").''; + print ''.$langs->trans("Result").''; if ($modecompta == 'CREANCES-DETTES') print ''.price($total_ht).''; print ''.price($total_ttc).''; @@ -572,7 +572,7 @@ if (! empty($conf->salaries->enabled)) $sql.= " WHERE p.entity = ".$conf->entity; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; - + $sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; $sql.= " ORDER BY u.firstname"; @@ -599,7 +599,7 @@ if (! empty($conf->salaries->enabled)) $var = !$var; print " "; - print "".$langs->trans("Salaries")." fk_user."\">".$obj->firstname." ".$obj->lastname."\n"; + print "".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."\n"; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount).''; print ''.price(-$obj->amount).''; @@ -639,9 +639,8 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); $sql.= " AND p.fk_statut>=5"; - + $column='p.date_valid'; - } else { $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; @@ -650,12 +649,12 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); $sql.= " AND p.fk_statut>=5"; - + $column='pe.datep'; } print ''.$langs->trans("ExpenseReport").''; - + if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; @@ -709,12 +708,12 @@ if (! empty($conf->expensereport->enabled)) } /* - * Donation + * Donations */ if (! empty($conf->don->enabled)) { - print ''.$langs->trans("Donation").''; + print ''.$langs->trans("Donations").''; if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; @@ -975,7 +974,7 @@ else } -if ($mysoc->tva_assuj != 'franchise') // Assujeti +if ($mysoc->tva_assuj != 'franchise') // Assujetti { print ''; if ($modecompta == 'CREANCES-DETTES') @@ -995,14 +994,14 @@ $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addBalanceLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; -if ($mysoc->tva_assuj != 'franchise') // Assujeti +if ($mysoc->tva_assuj != 'franchise') // Assujetti { // Total print ''; print ' '; print ''; - print ''.$langs->trans("Profit").''; + print ''.$langs->trans("Result").''; if ($modecompta == 'CREANCES-DETTES') print ''.price(price2num($total_ht,'MT')).''; print ''.price(price2num($total_ttc,'MT')).''; From efd24e5922b1eb75b2b75b8795fb7b8188b2dc34 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 29 Oct 2016 07:45:24 +0200 Subject: [PATCH 07/96] Work on supplier credit note --- htdocs/compta/facture.php | 70 +++++++++++++++++------------------ htdocs/fourn/facture/card.php | 50 +++++++++++++------------ 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 2f4f887f652..3ee875b5d93 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2933,17 +2933,17 @@ else if ($id > 0 || ! empty($ref)) } } $morehtmlref.=''; - + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status - + dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', $morehtmlright); - + print '
'; print '
'; print '
'; - + print ''; - + // Type print '
' . $langs->trans('Type') . ''; print $object->getLibType(); @@ -3303,7 +3303,7 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print '
'; - + print '
'; print '
'; print '
'; @@ -3328,15 +3328,15 @@ else if ($id > 0 || ! empty($ref)) print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ''; print ''; } - + // Amount - print '' . $langs->trans('AmountHT') . ''; + print '' . $langs->trans('AmountHT') . ''; print '' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . ''; - + // Vat print '' . $langs->trans('AmountVAT') . '' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . ''; print ''; - + // Amount Local Taxes if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) // Localtax1 { @@ -3348,7 +3348,7 @@ else if ($id > 0 || ! empty($ref)) print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; print '' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . ''; } - + // Revenue stamp if ($selleruserevenustamp) // Test company use revenue stamp { @@ -3375,14 +3375,14 @@ else if ($id > 0 || ! empty($ref)) } print ''; } - + // Total with tax print '' . $langs->trans('AmountTTC') . '' . price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency) . ''; - + print ''; - + // List of payments - + $sign = 1; if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = - 1; $nbrows = 8; @@ -3491,9 +3491,9 @@ else if ($id > 0 || ! empty($ref)) if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0) print ''; } - + print ''; - + // List of payments already done print ''; print ''; @@ -3505,9 +3505,9 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + $var = true; - + // Payments already done (from payment on this invoice) $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; $sql .= ' c.code as payment_code, c.libelle as payment_label,'; @@ -3518,12 +3518,12 @@ else if ($id > 0 || ! empty($ref)) $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; $sql .= ' ORDER BY p.datep, p.tms'; - + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; - + // if ($object->type != 2) // { if ($num > 0) { @@ -3563,7 +3563,7 @@ else if ($id > 0 || ! empty($ref)) } else { dol_print_error($db); } - + if ($object->type != Facture::TYPE_CREDIT_NOTE) { // Total already paid print ''; - + $resteapayeraffiche = $resteapayer; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; - + // Loop on each credit note or deposit amount applied $creditnoteamount = 0; $depositamount = 0; @@ -3611,7 +3611,7 @@ else if ($id > 0 || ! empty($ref)) } else { dol_print_error($db); } - + // Paye partiellement 'escompte' if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { print ''; @@ -3667,10 +3667,10 @@ else if ($id > 0 || ! empty($ref)) print ''; - + // Billed print ''; - + // Remainder to pay back print ''; print ''; print ''; - + // Sold credit note // print ''; // print ''; } - + print '
' . ($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '' . $langs->trans('Amount') . ' 
'; @@ -3572,10 +3572,10 @@ else if ($id > 0 || ! empty($ref)) else print $langs->trans('AlreadyPaid'); print ' : 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . ' 
'; @@ -3647,7 +3647,7 @@ else if ($id > 0 || ! empty($ref)) $resteapayeraffiche = 0; $cssforamountpaymentcomplete = ''; } - + // Billed print '
' . $langs->trans("Billed") . ' :' . price($object->total_ttc) . ' 
'; print $langs->trans('AlreadyPaidBack'); print ' :' . price($sign * $totalpaye) . ' 
' . $langs->trans("Billed") . ' :' . price($sign * $object->total_ttc) . ' 
'; if ($resteapayeraffiche <= 0) @@ -3680,27 +3680,26 @@ else if ($id > 0 || ! empty($ref)) print ' :' . price($sign * $resteapayeraffiche) . ' 
'.$langs->trans('TotalTTC').' :'.price($sign * // $object->total_ttc).' 
'; - + // Margin Infos if (! empty($conf->margin->enabled)) { $formmargin->displayMarginInfos($object); } - print '
'; print '
'; print '
'; - + print '

'; - + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { $blocname = 'contacts'; $title = $langs->trans('ContactsAddresses'); @@ -3811,8 +3810,7 @@ else if ($id > 0 || ! empty($ref)) print '
'; $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { // Editer une facture deja validee, sans paiement effectue et pas exporte en compta if ($object->statut == 1) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index bd7d1317957..1fbbe41978b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Marcos García - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2249,9 +2249,9 @@ else print '
'; print '
'; print '
'; - + print ''; - + // Amount print ''; print ''; - + // Amount Local Taxes //TODO: Place into a function to control showing by country or study better option if ($societe->localtax1_assuj=="1") //Localtax1 @@ -2281,7 +2281,7 @@ else print ''; } print ''; - + if (!empty($conf->multicurrency->enabled)) { // Multicurrency Amount HT @@ -2298,22 +2298,26 @@ else print ''; print ''; print ''; - } - + } + print '
'.$langs->trans('AmountHT').''.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'
        '; @@ -2265,7 +2265,7 @@ else $s.=''.$langs->trans("Mode2").''; print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); print '
'.$langs->trans('AmountTTC').''.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
'; - + /* * List of payments */ - $nbrows=9; $nbcols=3; + $sign = 1; + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = - 1; + + $nbrows=9; $nbcols=3; if (! empty($conf->projet->enabled)) $nbrows++; if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; } if (! empty($conf->incoterm->enabled)) $nbrows++; - + if (! empty($conf->multicurrency->enabled)) $nbrows += 5; + // Local taxes if ($societe->localtax1_assuj=="1") $nbrows++; if ($societe->localtax2_assuj=="1") $nbrows++; - + $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; $sql.= ' c.id as paiement_type,'; $sql.= ' pf.amount,'; @@ -2325,7 +2329,7 @@ else $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid'; $sql.= ' WHERE pf.fk_facturefourn = '.$object->id; $sql.= ' ORDER BY p.datep, p.tms'; - + $result = $db->query($sql); if ($result) { @@ -2333,14 +2337,14 @@ else $i = 0; $totalpaye = 0; print ''; print ''; - print ''; + print ''; print ''; print ''; if (! empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; - + $var=false; if ($num > 0) { @@ -2369,7 +2373,7 @@ else if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions'); print ''; } - print ''; + print ''; print ''; + + $resteapayeraffiche = $resteapayer; + $cssforamountpaymentcomplete = 'amountpaymentcomplete'; + + // Loop on each credit note or deposit amount applied + $creditnoteamount = 0; + $depositamount = 0; + $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; + $sql .= " re.description, re.fk_facture_source"; + $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re"; + $sql .= " WHERE fk_facture = " . $object->id; + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + $invoice = new FactureFournisseur($db); + while ($i < $num) { + $obj = $db->fetch_object($resql); + $invoice->fetch($obj->fk_facture_source); + print ''; + print ''; + print ''; + $i ++; + if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE) + $creditnoteamount += $obj->amount_ttc; + if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT) + $depositamount += $obj->amount_ttc; + } + } else { + dol_print_error($db); + } + + // Paye partiellement 'escompte' + if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { + print ''; + $resteapayeraffiche = 0; + $cssforamountpaymentcomplete = ''; + } + // Paye partiellement ou Abandon 'badsupplier' + if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'badsupplier') { + print ''; + // $resteapayeraffiche=0; + $cssforamountpaymentcomplete = ''; + } + // Paye partiellement ou Abandon 'product_returned' + if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'product_returned') { + print ''; + $resteapayeraffiche = 0; + $cssforamountpaymentcomplete = ''; + } + // Paye partiellement ou Abandon 'abandon' + if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'abandon') { + print ''; + $resteapayeraffiche = 0; + $cssforamountpaymentcomplete = ''; + } + + // Billed + print ''; + + // Remainder to pay + print ''; + print ''; + print ''; + } + else // Credit note + { + // Total already paid back + print ''; + + // Billed + print ''; + + // Remainder to pay back + print ''; + print ''; + print ''; + + // Sold credit note + // print ''; + // print ''; + } + + print '
'.$langs->trans('Payments').'' . ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . ''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
'.price($objp->amount).'' . price($sign * $objp->amount) . ''; if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { @@ -2405,7 +2409,6 @@ else { dol_print_error($db); } - print ''; print ''; @@ -2435,13 +2438,12 @@ else //$result = $object->getLinesArray(); - print '
- - - - - - '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; if (! empty($conf->use_javascript_ajax) && $object->statut == FactureFournisseur::STATUS_DRAFT) { include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; @@ -2449,7 +2451,7 @@ else print ''; - global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; + global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; $forceall=1; $senderissupplier=1; $dateSelector=0; $inputalsopricewithtax=1; // Show object lines From 6f061fc3667ad8d4e74735d6a28a9bc86aea6607 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Oct 2016 21:53:39 +0100 Subject: [PATCH 08/96] Fix css --- htdocs/societe/notify/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index a1f38f0562a..9da1d057558 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -172,7 +172,7 @@ if ($result > 0) if ($object->client) { - print ''; } - print ''; + print ''; print ''; } - + + /* if ($object->paye == 0) { print ''; @@ -2402,7 +2403,8 @@ else print ''; print ''; } - print '
'; + print '
'; print $langs->trans('CustomerCode').''; print $object->code_client; if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; @@ -181,14 +181,14 @@ if ($result > 0) if ($object->fournisseur) { - print '
'; + print '
'; print $langs->trans('SupplierCode').''; print $object->code_fournisseur; if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; print '
'.$langs->trans("NbOfActiveNotifications").'
'.$langs->trans("NbOfActiveNotifications").''; $notify=new Notify($db); $tmparray = $notify->getNotificationsArray('', $object->id); From 7be49e47b81dc5e75393b8349f6929458ec1610e Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 1 Nov 2016 17:09:51 +0100 Subject: [PATCH 09/96] indenting and little refactoring --- .../expedition/doc/pdf_rouget.modules.php | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 7420e347482..ece59790fc3 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -790,7 +790,7 @@ class pdf_rouget extends ModelePdfExpedition // Show Draft Watermark if($object->statut==0 && (! empty($conf->global->SHIPPING_DRAFT_WATERMARK)) ) { - pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->SHIPPING_DRAFT_WATERMARK); + pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->SHIPPING_DRAFT_WATERMARK); } //Prepare la suite @@ -861,11 +861,11 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetTextColor(0,0,60); $title=$outputlangs->transnoentities("SendingSheet"); $pdf->MultiCell($w, 4, $title, '', 'R'); - $posy+=1; $pdf->SetFont('','', $default_font_size + 1); - $posy+=4; + $posy+=5; + $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R'); @@ -873,10 +873,10 @@ class pdf_rouget extends ModelePdfExpedition // Date planned delivery if (! empty($object->date_delivery)) { - $posy+=4; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery,"day",false,$outputlangs,true), '', 'R'); + $posy+=4; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery,"day",false,$outputlangs,true), '', 'R'); } if (! empty($object->thirdparty->code_client)) @@ -889,11 +889,10 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFont('','', $default_font_size + 3); - $Yoff=25; + $Yoff=25; - // Add list of linked orders - - $origin = $object->origin; + // Add list of linked orders + $origin = $object->origin; $origin_id = $object->origin_id; // TODO move to external function From 73b5bad2da5e6a7f7cd2fe8626258931dcb13b0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Nov 2016 20:53:05 +0100 Subject: [PATCH 10/96] Fix missing hook init --- htdocs/societe/rib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 39069d1e3f5..d16a17c6cab 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -49,11 +49,19 @@ $id=GETPOST("id","int"); $ribid=GETPOST("ribid","int"); $action=GETPOST("action"); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('thirdpartybancard')); + + /* * Actions */ +$parameters=array('id'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if ($action == 'update' && ! $_POST["cancel"]) { // Modification From de8ed22448933b0211fb01abc00da8ddd834df7e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 2 Nov 2016 07:13:17 +0100 Subject: [PATCH 11/96] Work on supplier credit/deposit/replacement invoice --- .../fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/facture/card.php | 139 +++++++++++++++++- 2 files changed, 132 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 9b3de478cc9..5241105a90e 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Bahfir Abbes * Copyright (C) 2015 Ferran Marcet - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1fbbe41978b..e301c7aaa13 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -486,10 +486,10 @@ if (empty($reshook)) { // Reset fk_parent_line for no child products and special product if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) { - $fk_parent_line = 0; + $fk_parent_line = 0; } - $line->fk_facture = $object->id; + $line->fk_facture_fourn = $object->id; $line->fk_parent_line = $fk_parent_line; $line->subprice =-$line->subprice; // invert price for object @@ -2391,7 +2391,8 @@ else { print '
'.$langs->trans("None").'
'.$langs->trans('AlreadyPaid').' :'.price($totalpaye).'
'.$langs->trans('RemainderToPay').' :'.price($resteapayer).'
'; + */ + $db->free($result); } else @@ -2410,6 +2412,131 @@ else dol_print_error($db); } + if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE) { + // Total already paid + print '
'; + if ($object->type != FactureFournisseur::TYPE_DEPOSIT) + print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); + else + print $langs->trans('AlreadyPaid'); + print ' : 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . ' 
'; + if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE) + print $langs->trans("CreditNote") . ' '; + if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT) + print $langs->trans("Deposit") . ' '; + print $invoice->getNomUrl(0); + print ' :' . price($obj->amount_ttc) . ''; + print 'rowid . '">' . img_delete() . ''; + print '
'; + print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1); + print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' 
'; + print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1); + print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' 
'; + print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1); + print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' 
'; + $text = $langs->trans("HelpAbandonOther"); + if ($object->close_note) + $text .= '

' . $langs->trans("Reason") . ':' . $object->close_note; + print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1); + print '
' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' 
' . $langs->trans("Billed") . ' :' . price($object->total_ttc) . ' 
'; + if ($resteapayeraffiche >= 0) + print $langs->trans('RemainderToPay'); + else + print $langs->trans('ExcessReceived'); + print ' :' . price($resteapayeraffiche) . ' 
'; + print $langs->trans('AlreadyPaidBack'); + print ' :' . price($sign * $totalpaye) . ' 
' . $langs->trans("Billed") . ' :' . price($sign * $object->total_ttc) . ' 
'; + if ($resteapayeraffiche <= 0) + print $langs->trans('RemainderToPayBack'); + else + print $langs->trans('ExcessPaydBack'); + print ' :' . price($sign * $resteapayeraffiche) . ' 
'.$langs->trans('TotalTTC').' :'.price($sign * + // $object->total_ttc).' 
'; + print '
'; print '
'; print '
'; @@ -2435,9 +2562,6 @@ else /* * Lines */ - //$result = $object->getLinesArray(); - - print ''; print ''; print ''; @@ -2526,7 +2650,6 @@ else else print ''.$langs->trans('SendByMail').''; } - // Make payments if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { From 6661773a061f12720df7d2b94357c07ee723e2c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Nov 2016 16:37:24 +0100 Subject: [PATCH 12/96] Clean menu --- htdocs/core/menus/init_menu_auguria.sql | 6 ++---- htdocs/core/menus/standard/eldy.lib.php | 10 +++++----- htdocs/langs/en_US/accountancy.lang | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 07b737c8bbf..bb53a0dd1da 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -317,15 +317,13 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4206__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?leftmenu=members&statut=1&filter=uptodate', 'MenuMembersUpToDate', 2, 'members', '$user->rights->adherent->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4207__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?leftmenu=members&statut=0', 'MenuMembersResiliated', 2, 'members', '$user->rights->adherent->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4208__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/stats/geo.php?leftmenu=members&mode=memberbycountry', 'MenuMembersStats', 1, 'members', '$user->rights->adherent->lire', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && $conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/htpasswd.php?leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/cartes/carte.php?leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 10, __ENTITY__); -- Members - Subscriptions insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4300__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?leftmenu=members&mainmenu=members', 'Subscriptions', 0, 'compta', '$user->rights->adherent->cotisation->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4301__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/list.php?statut=-1&leftmenu=accountancy&mainmenu=members', 'NewSubscription', 1, 'compta', '$user->rights->adherent->cotisation->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4302__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/subscription/list.php?leftmenu=members', 'List', 1, 'compta', '$user->rights->adherent->cotisation->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4303__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/stats/index.php?leftmenu=members', 'MenuMembersStats', 1, 'members', '$user->rights->adherent->lire', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4500__+MAX_llx_menu__, 'members', 'export', 13__+MAX_llx_menu__, '/adherents/index.php?leftmenu=export&mainmenu=members', 'Exports', 0, 'members', '$user->rights->adherent->export', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->export->enabled', __HANDLER__, 'left', 4501__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/exports/index.php?leftmenu=export', 'Datas', 1, 'members', '$user->rights->adherent->export', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/htpasswd.php?leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/cartes/carte.php?leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', 'setup', 13__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&mainmenu=members', 'MembersTypes', 0, 'members', '$user->rights->adherent->configurer', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&mainmenu=members&action=create', 'New', 1, 'members', '$user->rights->adherent->configurer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&mainmenu=members', 'List', 1, 'members', '$user->rights->adherent->configurer', '', 2, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index e64d6318105..69c9e441c98 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1364,7 +1364,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate",$langs->trans("MenuMembersNotUpToDate"),2,$user->rights->adherent->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=0",$langs->trans("MenuMembersResiliated"),2,$user->rights->adherent->lire); $newmenu->add("/adherents/stats/index.php?leftmenu=members",$langs->trans("MenuMembersStats"),1,$user->rights->adherent->lire); - + if (! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && (empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export); + if (empty($leftmenu) || $leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export); + $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members",$langs->trans("Subscriptions"),0,$user->rights->adherent->cotisation->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members",$langs->trans("NewSubscription"),1,$user->rights->adherent->cotisation->creer); $newmenu->add("/adherents/subscription/list.php?leftmenu=members",$langs->trans("List"),1,$user->rights->adherent->cotisation->lire); @@ -1379,10 +1381,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu //if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); } - $newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Exports"),0,$user->rights->adherent->export, '', $mainmenu, 'export'); - if (! empty($conf->export->enabled) && (empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); - if (empty($leftmenu) || $leftmenu=="export") $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export); - if (empty($leftmenu) || $leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export); + //$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Tools"),0,$user->rights->adherent->export, '', $mainmenu, 'export'); + //if (! empty($conf->export->enabled) && (empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); // Type $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members",$langs->trans("MembersTypes"),0,$user->rights->adherent->configurer, '', $mainmenu, 'setup'); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 99131bd5c0c..d24ec11a502 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -20,7 +20,7 @@ Chartofaccounts=Chart of accounts AccountancyArea=Accountancy area AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: AccountancyAreaDescActionOnce=The following actions are usually executed one time only, or once per year... -AccountancyAreaDescActionOnceBis=Next step should be done to save you time in future by suggesting you the correct default accounting account when making thee journalization (writing record in Journals and General ledger) +AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making thee journalization (writing record in Journals and General ledger) AccountancyAreaDescActionFreq=The following actions are usually executed every month, week or day for very large companies... AccountancyAreaDescChartModel=STEP %s: Create a model of chart of account from menu %s AccountancyAreaDescChart=STEP %s: Create or check content of your chart of account from menu %s From 59291be6e0c60df2a712af5eca45470a56d489b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Nov 2016 19:39:54 +0100 Subject: [PATCH 13/96] NEW Can filter on status on objects on the "statistics" page. --- htdocs/adherents/class/adherent.class.php | 11 ++ htdocs/adherents/list.php | 2 +- htdocs/comm/propal/stats/index.php | 7 +- htdocs/commande/list.php | 10 +- htdocs/commande/stats/index.php | 32 ++++++ htdocs/compta/bank/bankentries.php | 5 +- htdocs/compta/facture/stats/index.php | 24 +++- htdocs/core/class/html.formpropal.class.php | 22 ++-- .../html.formsupplier_proposal.class.php | 104 ------------------ htdocs/langs/en_US/supplier_proposal.lang | 1 + htdocs/supplier_proposal/card.php | 2 - .../class/supplier_proposal.class.php | 7 +- htdocs/supplier_proposal/list.php | 6 +- 13 files changed, 101 insertions(+), 132 deletions(-) delete mode 100644 htdocs/core/class/html.formsupplier_proposal.class.php diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 191b23bea32..79c12e68561 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1682,6 +1682,17 @@ class Adherent extends CommonObject if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated"); } if ($mode == 5) + { + if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); + if ($statut >= 1) + { + if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActiveShort").' '.img_picto($langs->trans('MemberStatusActive'),'statut1'); + elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLateShort").' '.img_picto($langs->trans('MemberStatusActiveLate'),'statut3'); + else return ''.$langs->trans("MemberStatusPaidShort").' '.img_picto($langs->trans('MemberStatusPaid'),'statut4'); + } + if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); + } + if ($mode == 6) { if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut >= 1) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index c98ad4abf31..0727002aa59 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -809,7 +809,7 @@ while ($i < $num && $i < $conf->liste_limit) if (! empty($arrayfields['d.statut']['checked'])) { print ''; - print $memberstatic->LibStatut($obj->statut,$obj->subscription,$datefin,2); + print $memberstatic->LibStatut($obj->statut,$obj->subscription,$datefin,5); print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index aa5a865dbf2..04c1af11e1d 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -37,7 +37,7 @@ $mode=GETPOST("mode")?GETPOST("mode"):'customer'; if ($mode == 'customer' && ! $user->rights->propale->lire) accessforbidden(); if ($mode == 'supplier' && ! $user->rights->supplier_proposal->lire) accessforbidden(); -$object_statut=GETPOST('propal_statut'); +$object_status=GETPOST('object_status'); $userid=GETPOST('userid','int'); $socid=GETPOST('socid','int'); @@ -58,6 +58,7 @@ $langs->load('orders'); $langs->load('companies'); $langs->load('other'); $langs->load('suppliers'); +$langs->load('supplier_proposal'); /* @@ -91,7 +92,7 @@ dol_mkdir($dir); $stats = new PropaleStats($db, $socid, ($userid>0?$userid:0), $mode); -if ($object_statut != '' && $object_statut >= 0) $stats->where .= ' AND p.fk_statut IN ('.$object_statut.')'; +if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$object_status.')'; // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); @@ -265,7 +266,7 @@ print '
'; print ''; // Status print ''.$langs->trans("Status").''; - $formpropal->selectProposalStatus($object_statut,0,1,1,$mode); + $formpropal->selectProposalStatus(($object_status!=''?$object_status:-1),0,0,1,$mode,'object_status'); print ''; // Year print ''.$langs->trans("Year").''; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 14c2b88214e..87a95062323 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1014,11 +1014,11 @@ if ($resql) { print ''; $liststatus=array( - '0'=>$langs->trans("StatusOrderDraftShort"), - '1'=>$langs->trans("StatusOrderValidated"), - '2'=>$langs->trans("StatusOrderSentShort"), - '3'=>$langs->trans("StatusOrderDelivered"), - '-1'=>$langs->trans("StatusOrderCanceledShort") + Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"), + Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), + Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"), + Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), + Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort") ); print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4); print ''; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 1f0f763bfd1..55b82d1063c 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -28,6 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); @@ -37,6 +38,8 @@ $mode=GETPOST("mode")?GETPOST("mode"):'customer'; if ($mode == 'customer' && ! $user->rights->commande->lire) accessforbidden(); if ($mode == 'supplier' && ! $user->rights->fournisseur->commande->lire) accessforbidden(); +$object_status=GETPOST('object_status'); + $userid=GETPOST('userid','int'); $socid=GETPOST('socid','int'); // Security check @@ -63,6 +66,7 @@ $langs->load('suppliers'); */ $form=new Form($db); +$formorder=new FormOrder($db); if ($mode == 'customer') { @@ -82,9 +86,19 @@ print load_fiche_titre($title,'','title_commercial.png'); dol_mkdir($dir); $stats = new CommandeStats($db, $socid, $mode, ($userid>0?$userid:0)); +if ($mode == 'customer') +{ + if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; +} +if ($mode == 'supplier') +{ + if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; +} + // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); + //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) @@ -261,6 +275,24 @@ print '
'; // User print ''.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + // Status + print ''.$langs->trans("Status").''; + if ($mode == 'customer') + { + $liststatus=array( + Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraft"), + Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), + Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSent"), + Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), + Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled") + ); + print $form->selectarray('object_status', $liststatus, GETPOST('object_status'), -4); + } + if ($mode == 'supplier') + { + $formorder->selectSupplierOrderStatus((strstr($object_status, ',')?-1:$object_status), 0, 'object_status'); + } + print ''; // Year print ''.$langs->trans("Year").''; if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year; diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index bb56c494854..477c65a66b3 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -108,14 +108,13 @@ if (! $sortfield) $sortfield='b.datev'; $mode_balance_ok=false; //if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid')) // TODO Manage balance when account not selected -if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid') && ($id > 0 || ! empty($ref))) +if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid')) { $sortfield = 'b.datev, b.dateo, b.rowid'; - $mode_balance_ok = true; + if ($id > 0 || ! empty($ref) || $account > 0) $mode_balance_ok = true; } if (strtolower($sortorder) == 'desc') $mode_balance_ok = false; - $object = new Account($db); if ($id > 0 || ! empty($ref)) { diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 9ca0c2f7718..5c5aa8489be 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -36,6 +36,8 @@ $mode=GETPOST("mode")?GETPOST("mode"):'customer'; if ($mode == 'customer' && ! $user->rights->facture->lire) accessforbidden(); if ($mode == 'supplier' && ! $user->rights->fournisseur->facture->lire) accessforbidden(); +$object_status=GETPOST('object_status'); + $userid=GETPOST('userid','int'); $socid=GETPOST('socid','int'); // Security check @@ -80,7 +82,14 @@ print load_fiche_titre($title, $mesg, 'title_accountancy.png'); dol_mkdir($dir); $stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0)); - +if ($mode == 'customer') +{ + if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')'; +} +if ($mode == 'supplier') +{ + if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')'; +} // Build graphic number of object // $data = array(array('Lib',val1,val2,val3),...) @@ -246,6 +255,19 @@ print '
'; print ''.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print ''; + // Status + print ''.$langs->trans("Status").''; + if ($mode == 'customer') + { + $liststatus=array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); + print $form->selectarray('object_status', $liststatus, $object_status, 1); + } + if ($mode == 'supplier') + { + $liststatus=array('0'=>$langs->trans("BillStatusDraft"),'1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid")); + print $form->selectarray('object_status', $liststatus, $object_status, 1); + } + print ''; // Year print ''.$langs->trans("Year").''; if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year; diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index 57dd6336a43..2cfeaadd368 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -50,9 +50,10 @@ class FormPropal * @param int $excludedraft 0=All status, 1=Exclude draft status * @param int $showempty 1=Add empty line * @param string $mode 'customer', 'supplier' + * @param string $htmlname Name of select field * @return void */ - function selectProposalStatus($selected='',$short=0, $excludedraft=0, $showempty=1, $mode='customer') + function selectProposalStatus($selected='',$short=0, $excludedraft=0, $showempty=1, $mode='customer',$htmlname='propal_statut') { global $langs; @@ -63,7 +64,13 @@ class FormPropal $prefix='SupplierProposalStatus'; $langs->load("supplier_proposal"); - $listofstatus=array(0=>array('code'=>'PR_DRAFT'), 1=>array('code'=>'PR_OPEN'), 2=>array('code'=>'PR_SIGNED'), 3=>array('code'=>'PR_NOTSIGNED'), 4=>array('code'=>'PR_CLOSED')); + $listofstatus=array( + 0=>array('id'=>0, 'code'=>'PR_DRAFT'), + 1=>array('id'=>1, 'code'=>'PR_OPEN'), + 2=>array('id'=>2, 'code'=>'PR_SIGNED'), + 3=>array('id'=>3, 'code'=>'PR_NOTSIGNED'), + 4=>array('id'=>4, 'code'=>'PR_CLOSED') + ); } else { @@ -93,7 +100,7 @@ class FormPropal } } - print ''; if ($showempty) print ''; foreach($listofstatus as $key => $obj) @@ -115,15 +122,16 @@ class FormPropal print ''; $i++; diff --git a/htdocs/core/class/html.formsupplier_proposal.class.php b/htdocs/core/class/html.formsupplier_proposal.class.php deleted file mode 100644 index ed8781731a0..00000000000 --- a/htdocs/core/class/html.formsupplier_proposal.class.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/core/class/html.formpropal.class.php - * \ingroup core - * \brief File of class with all html predefined components - */ - - -/** - * Class to manage generation of HTML components for proposal management - */ -class FormSupplierProposal -{ - var $db; - var $error; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) - { - $this->db = $db; - } - - /** - * Return combo list of differents status of a proposal - * Values are id of table c_propalst - * - * @param string $selected Preselected value - * @param int $short Use short labels - * @return void - */ - function selectSupplierProposalStatus($selected='',$short=0) - { - global $langs; - - $sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst"; - $sql .= " WHERE active = 1"; - - dol_syslog(get_class($this)."::selectSupplierProposalStatus", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - print ''; - } - else - { - dol_print_error($this->db); - } - } - -} - diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index 94c0ef2e039..621d7784e35 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -28,6 +28,7 @@ SupplierProposalStatusClosed=Closed SupplierProposalStatusSigned=Accepted SupplierProposalStatusNotSigned=Refused SupplierProposalStatusDraftShort=Draft +SupplierProposalStatusValidatedShort=Validated SupplierProposalStatusClosedShort=Closed SupplierProposalStatusSignedShort=Accepted SupplierProposalStatusNotSignedShort=Refused diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 0658416797e..804c02cfa68 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -34,7 +34,6 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formsupplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT . '/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; @@ -997,7 +996,6 @@ llxHeader('', $langs->trans('CommRequests'), 'EN:Ask_Price_Supplier|FR:Demande_d $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); -$formsupplier_proposal = new FormSupplierProposal($db); $formmargin = new FormMargin($db); $companystatic = new Societe($db); if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 45dacd3805a..1d249ad627d 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2095,11 +2095,12 @@ class SupplierProposal extends CommonObject if ($mode == 0) return $this->labelstatut[$statut]; if ($mode == 1) return $this->labelstatut_short[$statut]; - if ($mode == 2) return img_picto($this->labelstatut_short[$statut], $statuttrans).' '.$this->labelstatut_short[$statut]; + if ($mode == 2) return img_picto($this->labelstatut[$statut], $statuttrans).' '.$this->labelstatut_short[$statut]; if ($mode == 3) return img_picto($this->labelstatut[$statut], $statuttrans); if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut]; - if ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut_short[$statut],$statuttrans); - } + if ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); + if ($mode == 6) return ''.$this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); + } /** diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index e51ddfcdceb..a50e8509ba5 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -34,8 +34,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsupplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -191,7 +191,7 @@ llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_p $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); -$formsupplier_proposal = new FormSupplierProposal($db); +$formpropal = new FormPropal($db); $companystatic=new Societe($db); $now=dol_now(); @@ -388,7 +388,7 @@ if ($result) print ''; print ''; print ''; - $formsupplier_proposal->selectSupplierProposalStatus($viewstatut,1); + $formpropal->selectProposalStatus($viewstatut,1,0,1,'supplier'); print ''; // Check boxes print ''; From 5b2a44f16f543cda00f879ea8ab53dc69d1f470d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Nov 2016 20:10:01 +0100 Subject: [PATCH 14/96] Fix phpunit regression --- htdocs/fourn/class/fournisseur.facture.class.php | 3 +-- htdocs/fourn/facture/card.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 534f12b3877..d8490fde20b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -694,7 +694,6 @@ class FactureFournisseur extends CommonInvoice if (isset($this->tva)) $this->tva=trim($this->tva); if (isset($this->localtax1)) $this->localtax1=trim($this->localtax1); if (isset($this->localtax2)) $this->localtax2=trim($this->localtax2); - if (empty($this->total)) $this->total=0; if (empty($this->total_ht)) $this->total_ht=0; if (empty($this->total_tva)) $this->total_tva=0; // if (isset($this->total_localtax1)) $this->total_localtax1=trim($this->total_localtax1); @@ -734,7 +733,7 @@ class FactureFournisseur extends CommonInvoice $sql.= " tva=".(isset($this->tva)?$this->tva:"null").","; $sql.= " localtax1=".(isset($this->localtax1)?$this->localtax1:"null").","; $sql.= " localtax2=".(isset($this->localtax2)?$this->localtax2:"null").","; - $sql.= " total=".(isset($this->total)?$this->total:"null").","; + //$sql.= " total=".(isset($this->total)?$this->total:"null").","; $sql.= " total_ht=".(isset($this->total_ht)?$this->total_ht:"null").","; $sql.= " total_tva=".(isset($this->total_tva)?$this->total_tva:"null").","; $sql.= " total_ttc=".(isset($this->total_ttc)?$this->total_ttc:"null").","; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e301c7aaa13..113c698f7f4 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -309,7 +309,7 @@ if (empty($reshook)) elseif ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) { $object->fetch($id); - $object->label=$_POST['label']; + $object->label=GETPOST('label'); $result=$object->update($user); if ($result < 0) dol_print_error($db); } From 6ceb79cf5abfbae550dc7cb28272c8525c505a45 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Nov 2016 20:55:55 +0100 Subject: [PATCH 15/96] Uniformise look and feel --- htdocs/compta/index.php | 4 +- htdocs/compta/sociales/index.php | 18 ++++--- htdocs/fourn/facture/card.php | 36 +++++++------- htdocs/langs/en_US/orders.lang | 1 + htdocs/supplier_proposal/card.php | 80 ++++++++----------------------- 5 files changed, 53 insertions(+), 86 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 1dd1c46299a..40e3b80a510 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -577,7 +577,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -663,7 +663,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $i = 0; print '
'.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("DateDue").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").'
'; print ""; - print ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index fc106de2ad1..80364960406 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -40,6 +40,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); $search_ref = GETPOST('search_ref','int'); $search_label = GETPOST('search_label','alpha'); $search_amount = GETPOST('search_amount','alpha'); +$search_status = GETPOST('search_status','int'); $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); @@ -52,8 +53,8 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="cs.date_ech"; if (! $sortorder) $sortorder="DESC"; -$year=$_GET["year"]; -$filtre=$_GET["filtre"]; +$year=GETPOST("year",'int'); +$filtre=GETPOST("filtre",'int'); if (empty($_REQUEST['typeid'])) { @@ -88,7 +89,7 @@ $form = new Form($db); $formsocialcontrib = new FormSocialContrib($db); $chargesociale_static=new ChargeSociales($db); -llxHeader(); +llxHeader('', $langs->trans("SocialContributions")); $sql = "SELECT cs.rowid as id, cs.fk_type as type, "; $sql.= " cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode,"; @@ -99,11 +100,11 @@ $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND cs.entity = ".$conf->entity; - // Search criteria -if ($search_ref) $sql.=" AND cs.rowid=".$search_ref; +if ($search_ref) $sql.=" AND cs.rowid=".$db->escape($search_ref); if ($search_label) $sql.=natural_search("cs.libelle", $search_label); if ($search_amount) $sql.=natural_search("cs.amount", price2num(trim($search_amount)), 1); +if ($search_status != '') $sql.=" AND cs.paye = ".$db->escape($search_status); if ($year > 0) { $sql .= " AND ("; @@ -118,7 +119,7 @@ if ($filtre) { $sql .= " AND ".$filtre; } if ($typeid) { - $sql .= " AND cs.fk_type=".$typeid; + $sql .= " AND cs.fk_type=".$db->escape($typeid); } $sql.= " GROUP BY cs.rowid, cs.fk_type, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle"; $sql.= $db->order($sortfield,$sortorder); @@ -204,7 +205,10 @@ if ($resql) print ''; print ''; // Status - print ''; + print ''; print ''; - // Project - /* - if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - print ''; - } else { - print '
'.$langs->trans("OrdersToBill").' '.$num.''.$langs->trans("OrdersDeliveredToBill").' '.$num.''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").'  '; + $liststatus=array('0'=>$langs->trans("Unpaid"), '1'=>$langs->trans("Paid")); + print $form->selectarray('search_status', $liststatus, $search_status, 1); + print ''; $searchpitco=$form->showFilterAndCheckAddButtons(0); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 113c698f7f4..103850509a5 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2252,6 +2252,24 @@ else print ''; + if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) + { + // Multicurrency Amount HT + print ''; + print ''; + print ''; + + // Multicurrency Amount VAT + print ''; + print ''; + print ''; + + // Multicurrency Amount TTC + print ''; + print ''; + print ''; + } + // Amount print ''; print ''; - if (!empty($conf->multicurrency->enabled)) - { - // Multicurrency Amount HT - print ''; - print ''; - print ''; - - // Multicurrency Amount VAT - print ''; - print ''; - print ''; - - // Multicurrency Amount TTC - print ''; - print ''; - print ''; - } - print '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
'.$langs->trans('AmountHT').''.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'
        '; @@ -2282,24 +2300,6 @@ else } print '
'.$langs->trans('AmountTTC').''.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
'; /* diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 45997ef6cb5..2f0579394eb 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -19,6 +19,7 @@ CustomerOrder=Customer order CustomersOrders=Customer orders CustomersOrdersRunning=Current customer orders CustomersOrdersAndOrdersLines=Customer orders and order lines +OrdersDeliveredToBill=Customer orders delivered to bill OrdersToBill=Customer orders delivered OrdersInProcess=Customer orders in process OrdersToProcess=Customer orders to process diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 804c02cfa68..3ab1c159545 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1476,41 +1476,6 @@ if ($action == 'create') } print '
'; - print ''; - if ($user->rights->supplier_proposal->creer) { - if ($action != 'classify') - print ''; - print '
'; - print $langs->trans('Project') . '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '
'; - print '
'; - if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid'); - } else { - $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none'); - } - print '
'; - if (! empty($object->fk_project)) { - print ''; - $proj = new Project($db); - $proj->fetch($object->fk_project); - print ''; - print $proj->ref; - print ''; - print ''; - } else { - print ' '; - } - } - print ''; - }*/ - // Multicurrency if (! empty($conf->multicurrency->enabled)) { @@ -1594,14 +1559,32 @@ if ($action == 'create') print ''; + if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) + { + // Multicurrency Amount HT + print ''; + print ''; + print ''; + + // Multicurrency Amount VAT + print ''; + print ''; + print ''; + + // Multicurrency Amount TTC + print ''; + print ''; + print ''; + } + // Amount HT - print ''; - print ''; + print ''; + print ''; print ''; // Amount VAT print ''; - print ''; + print ''; print ''; // Amount Local Taxes @@ -1623,27 +1606,6 @@ if ($action == 'create') print ''; print ''; - if (!empty($conf->multicurrency->enabled)) - { - // Multicurrency Amount HT - print ''; - print ''; - print ''; - - // Multicurrency Amount VAT - print ''; - print ''; - print ''; - - // Multicurrency Amount TTC - print ''; - print ''; - print ''; - } - - // Statut - //print ''; - print '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . $langs->trans('Status') . '' . $object->getLibStatut(4) . '
'; // Margin Infos From 0f016bbbcb7237665b4a17b5081137c39bbc07a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Nov 2016 20:57:19 +0100 Subject: [PATCH 16/96] Uniformise look and feel --- htdocs/compta/sociales/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 80364960406..6a4f7f836e7 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -76,6 +76,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_ref=""; $search_label=""; $search_amount=""; + $search_status=''; $typeid=""; $year=""; $month=""; @@ -104,7 +105,7 @@ $sql.= " AND cs.entity = ".$conf->entity; if ($search_ref) $sql.=" AND cs.rowid=".$db->escape($search_ref); if ($search_label) $sql.=natural_search("cs.libelle", $search_label); if ($search_amount) $sql.=natural_search("cs.amount", price2num(trim($search_amount)), 1); -if ($search_status != '') $sql.=" AND cs.paye = ".$db->escape($search_status); +if ($search_status != '' && $search_status >= 0) $sql.=" AND cs.paye = ".$db->escape($search_status); if ($year > 0) { $sql .= " AND ("; From 8b16eeb55481da937a2927a4a255a52f74252c2d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 4 Nov 2016 10:06:53 +0100 Subject: [PATCH 17/96] Fix: no login are required for fckeditor (external emailing) --- htdocs/viewimage.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index d14ccc6f8d4..5aeb1072d04 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -36,6 +36,12 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks // Pour autre que companylogo, on charge environnement + info issus de logon comme le user if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); +if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'fckeditor') && ! defined("NOLOGIN")) { + define("NOLOGIN",'1'); + // For multicompany + $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); + if (is_numeric($entity)) define("DOLENTITY", $entity); +} /** * Header empty From 718adef600eaeda9e74fcef3eedfe88b63079a0c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 4 Nov 2016 10:21:20 +0100 Subject: [PATCH 18/96] Fix: external access of fkeditor image with multicompany --- htdocs/core/class/doleditor.class.php | 2 +- htdocs/core/filemanagerdol/connectors/php/config.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 35c3b3909ef..7e68589c5f9 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -108,7 +108,7 @@ class DolEditor // Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart. // Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ? $modulepart='fckeditor'; - $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&file='; + $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file='; $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ; $this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false'); diff --git a/htdocs/core/filemanagerdol/connectors/php/config.php b/htdocs/core/filemanagerdol/connectors/php/config.php index 0c3b0a4884c..e21e69bdec2 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.php @@ -44,7 +44,8 @@ $Config['Enabled'] = true ; // Path to user files relative to the document root. -$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=fckeditor&file=' ; +$extEntity=(empty($entity) ? 1 : $entity); // For multicompany with external access +$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=fckeditor&entity='.$extEntity.'&file=' ; // Fill the following value it you prefer to specify the absolute path for the // user files directory. Useful if you are using a virtual directory, symbolic From e59c2bb61ca654b371191bd04d12c54df86f7791 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Nov 2016 15:43:30 +0100 Subject: [PATCH 19/96] Debug accounting menu. Can now edit product account if already set. --- htdocs/accountancy/admin/account.php | 6 +- htdocs/accountancy/admin/defaultaccounts.php | 2 +- htdocs/accountancy/admin/productaccount.php | 221 ++++++++++++------ .../class/html.formventilation.class.php | 15 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/langs/en_US/accountancy.lang | 10 +- htdocs/langs/en_US/products.lang | 1 + htdocs/product/class/product.class.php | 22 +- 8 files changed, 184 insertions(+), 95 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 95ba62de0c5..cb3255f981d 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -256,10 +256,8 @@ if ($resql) { print ''; print ' '; print ''; - - print ''; - print ' '; - print ''; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; print ''; print ''; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index a66217ebbee..6854c8a45ff 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -138,7 +138,7 @@ foreach ( $list_account as $key ) { $label = $langs->trans($key); print '' . $label . ''; // Value - print ''; + print ''; // Do not force align=right, or it align also the content of the select box print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1); print ''; print ''; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 495fb2a1304..5de8be91d20 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -40,6 +40,7 @@ $langs->load("companies"); $langs->load("compta"); $langs->load("main"); $langs->load("accountancy"); +$langs->load("products"); // Security check if (empty($conf->accounting->enabled)) { @@ -61,6 +62,10 @@ $changeaccount_sell = GETPOST('changeaccount_sell', 'array'); $search_ref = GETPOST('search_ref', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); $search_desc = GETPOST('search_desc', 'alpha'); +$search_current_account = GETPOST('search_current_account', 'alpha'); +$search_current_account_valid = GETPOST('search_current_account_valid', 'alpha'); +if ($search_current_account_valid == '') $search_current_account_valid='withoutvalidaccount'; + $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); $btn_changeaccount = GETPOST('changeaccount'); $btn_changetype = GETPOST('changetype'); @@ -85,12 +90,21 @@ $arrayfields=array(); * Actions */ +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + // Purge search criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $search_ref = ''; $search_label = ''; $search_desc = ''; + $search_current_account = ''; + $search_current_account_valid = '-1'; } // Sales or Purchase mode ? @@ -189,23 +203,38 @@ $aacompta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? llxHeader('', $langs->trans("ProductsBinding")); -$pcgver = $conf->global->CHARTOFACCOUNTS; +$pcgverid = $conf->global->CHARTOFACCOUNTS; +$pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); +if (empty($pcgvercode)) $pcgvercode=$pcgverid; -$sql = "SELECT p.rowid, p.ref, p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type"; -$sql .= " FROM " . MAIN_DB_PREFIX . "product as p"; -$sql .= " WHERE ("; -if ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') { - $sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL"; - $sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; -} else { - $sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL "; - $sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN - (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))"; +$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy, p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type,"; +$sql.= " aa.rowid as aaid"; +$sql.= " FROM " . MAIN_DB_PREFIX . "product as p"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON"; +if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + $sql.=" p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'"; } -$sql .= ")"; -if (! empty($conf->multicompany->enabled)) { - $sql.= ' AND p.entity IN ('.getEntity('product', 1).')'; +else +{ + $sql.=" p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'"; +} +$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; +if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + if (strlen(trim($search_current_account))) { + $sql .= natural_search("p.accountancy_code_buy",$search_current_account); + } +} else { + if (strlen(trim($search_current_account))) { + $sql .= natural_search("p.accountancy_code_sell",$search_current_account); + } +} +if ($search_current_account_valid == 'withoutvalidaccount') +{ + $sql .= " AND aa.account_number IS NULL"; +} +if ($search_current_account_valid == 'withvalidaccount') +{ + $sql .= " AND aa.account_number IS NOT NULL"; } // Add search filter like if (strlen(trim($search_ref))) { @@ -218,6 +247,7 @@ if (strlen(trim($search_desc))) { $sql .= natural_search("p.description",$search_desc); } $sql .= $db->order($sortfield, $sortorder); + $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { @@ -236,9 +266,11 @@ if ($result) $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($search_ref > 0) $param.="&search_desc=".urlencode($search_ref); - if ($search_label > 0) $param.="&search_desc=".urlencode($search_label); - if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc); + if ($search_ref > 0) $param.="&search_desc=".urlencode($search_ref); + if ($search_label > 0) $param.="&search_desc=".urlencode($search_label); + if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc); + if ($search_current_account > 0) $param.="&search_current_account=".urlencode($search_current_account); + if ($search_current_account_valid && $search_current_account_valid != '-1') $param.="&search_current_account_valid=".urlencode($search_current_account_valid); print ''; if ($optioncss != '') print ''; @@ -260,11 +292,10 @@ if ($result) print '' . $langs->trans('Options') . '' . $langs->trans('Description') . ''; print "\n"; print ' ' . $langs->trans('OptionModeProductSell') . ''; - print '' . nl2br($langs->trans('OptionModeProductSellDesc')); + print ''.$langs->trans('OptionModeProductSellDesc'); print "\n"; print ' ' . $langs->trans('OptionModeProductBuy') . ''; - print '' . nl2br($langs->trans('OptionModeProductBuyDesc')) . "\n"; - + print ''.$langs->trans('OptionModeProductBuyDesc')."\n"; print "\n"; print '
'; @@ -277,7 +308,7 @@ if ($result) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - $texte=$langs->trans("ListOfProductsWithoutAccountingAccount"); + $texte=$langs->trans("ListOfProductsServices"); print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); print ''; @@ -285,37 +316,54 @@ if ($result) print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder); - /* - if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { - print_liste_field_titre($langs->trans("Accountancy_code_buy")); - } else { - print_liste_field_titre($langs->trans("Accountancy_code_sell")); - } - */ - print_liste_field_titre($langs->trans("AccountAccounting")); - //print_liste_field_titre($langs->trans("Modify") . '
/ ', '', '', '', '', 'align="center"'); + print_liste_field_titre($langs->trans("OnSell"), $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("OnBuy"), $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder); + if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + $fieldtosortaccount="p.accountancy_code_buy"; + } + else $fieldtosortaccount="p.accountancy_code_sell"; + print_liste_field_titre($langs->trans("CurrentDedicatedAccountingAccount"), $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("AssignDedicatedAccountingAccount")); print_liste_field_titre('', '', '', '', '', 'align="center"'); print ''; print ''; - print ''; - print ''; - print ''; - if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print ''; + print ''; + print ''; + if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print ''; + // On sell + print ''; + // On buy + print ''; + // Current account + print ''; + print ''; print ''; print ''; - $var = true; + $product_static = new Product($db); + $var = true; + $i=0; while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - $var = ! $var; - - $compta_prodsell = $obj->accountancy_code_sell; + + // Ref produit as link + $product_static->ref = $obj->ref; + $product_static->id = $obj->rowid; + $product_static->type = $obj->product_type; + $product_static->label = $obj->label; + $product_static->description = $obj->description; + $product_static->status = $obj->tosell; + $product_static->status_buy = $obj->tobuy; if ($obj->product_type == 0) { $compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); @@ -325,8 +373,6 @@ if ($result) $compta_prodsell_id = $aarowid_servsell; } - $compta_prodbuy = $obj->accountancy_code_buy; - if ($obj->product_type == 0) { $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodbuy_id = $aarowid_prodbuy; @@ -335,30 +381,15 @@ if ($result) $compta_prodbuy_id = $aarowid_servbuy; } - $product_static = new Product($db); - - print ''; - - print ""; - + $var = ! $var; print ''; - // Ref produit as link - $product_static->ref = $obj->ref; - $product_static->id = $obj->rowid; - $product_static->type = $obj->type; - $product_static->label = $obj->label; - $product_static->description = $obj->description; - print ''; print ''; - + if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) { // TODO ADJUST DESCRIPTION SIZE @@ -368,24 +399,43 @@ if ($result) print ''; } - // Accounting account buy + print ''; + + print ''; + + // Current accounting account + print ''; - // TODO: replace by select - // print ''; - // TODO: we shoul set a user defined value to adjust user square / wide screen size - // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; + print length_accountg($obj->accountancy_code_buy); + if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount")); + } + else + { + print length_accountg($obj->accountancy_code_sell); + if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount")); + } + print ''; + + // Dedicated account + $defaultvalue=''; + if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { + // Accounting account buy print ''; } else { // Accounting account sell - // print ''; - // TODO: replace by select - // TODO: we shoul set a user defined value to adjust user square / wide screen size - // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; print ''; } @@ -397,7 +447,34 @@ if ($result) } print '
 '; + print ''; + $listofvals=array('withoutvalidaccount'=>$langs->trans("WithoutValidAccount"), 'withvalidaccount'=>$langs->trans("WithValidAccount")); + print ' '.$langs->trans("or").' '.$form->selectarray('search_current_account_valid', $listofvals, $search_current_account_valid, 1); + print ' '; $searchpitco=$form->showFilterAndCheckAddButtons(1, 'checkforselect', 1); print $searchpitco; print '
'; - if ($product_static->id) - print $product_static->getNomUrl(1); - else - print '- '; + print $product_static->getNomUrl(1); print ''.$obj->label.'' . nl2br(dol_trunc($obj->description, $trunclengh)) . ''.$product_static->getLibStatut(3, 0).''.$product_static->getLibStatut(3, 1).''; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { - // print '' . $obj->accountancy_code_buy . '' . $compta_prodbuy . ''; - print $form->select_account($compta_prodbuy_id, 'codeventil_' . $product_static->id, 1); + //$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code + if (empty($defaultvalue)) $defaultvalue=$compta_prodbuy; + $codesell=length_accountg($obj->accountancy_code_buy); + if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid + print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1); print '' . $obj->accountancy_code_sell . ''; - print $form->select_account($compta_prodsell_id, 'codeventil_' . $product_static->id, 1); + //$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code + if (empty($defaultvalue)) $defaultvalue=$compta_prodsell; + $codesell=length_accountg($obj->accountancy_code_sell); + //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); + if (! empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid + print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1); print '
'; - print '
'; + // Example : Adding jquery code + print ''; + + + print '
'; print ''; diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php index ac72df44e21..fab9e81031d 100644 --- a/htdocs/accountancy/class/html.formventilation.class.php +++ b/htdocs/accountancy/class/html.formventilation.class.php @@ -65,7 +65,7 @@ class FormVentilation extends Form /** * Return list of accounts with label by chart of accounts * - * @param string $selectid Preselected chart of accounts + * @param string $selectid Preselected id or code of accounting accounts (depends on $select_in) * @param string $htmlname Name of field in html form * @param int $showempty Add an empty field * @param array $event Event options @@ -99,26 +99,28 @@ class FormVentilation extends Form $out = ajax_combobox($htmlname, $event); + // TODO Add $options in cache so next call will not execute the request + $selected = 0; $options = array(); - $selected = null; - - while ($obj = $this->db->fetch_object($resql)) { + while ($obj = $this->db->fetch_object($resql)) + { $label = length_accountg($obj->account_number) . ' - ' . $obj->label; $label = dol_trunc($label, $trunclength); $select_value_in = $obj->rowid; $select_value_out = $obj->rowid; + // Try to guess if we have found default value if ($select_in == 1) { $select_value_in = $obj->account_number; } if ($select_out == 1) { $select_value_out = $obj->account_number; } - // Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number // Because same account_number can be share between different accounting_system and do have the same meaning - if (($selectid != '') && $selectid == $select_value_in) { + if ($selectid != '' && $selectid == $select_value_in) { + //var_dump("Found ".$selectid." ".$select_value_in); $selected = $select_value_out; } @@ -127,6 +129,7 @@ class FormVentilation extends Form $out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1); $this->db->free($resql); + return $out; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d7414a46835..e00a8a825b8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5197,7 +5197,7 @@ function dol_osencode($str) * Store also Code-Id into a cache to speed up next request on same key. * * @param DoliDB $db Database handler - * @param string $key Code to get Id + * @param string $key Code or Id to get Id or Code * @param string $tablename Table name without prefix * @param string $fieldkey Field for code * @param string $fieldid Field for id diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index d24ec11a502..9a94bf5d5c5 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -16,6 +16,8 @@ Journaux=Journals JournalFinancial=Financial journals BackToChartofaccounts=Return chart of accounts Chartofaccounts=Chart of accounts +CurrentDedicatedAccountingAccount=Current dedicated account +AssignDedicatedAccountingAccount=New account to assign AccountancyArea=Accountancy area AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: @@ -207,11 +209,15 @@ DefaultBindingDesc=This page can be used to set a default account to use to link Options=Options OptionModeProductSell=Mode sales OptionModeProductBuy=Mode purchases -OptionModeProductSellDesc=Show all products with no accounting account defined for sales. -OptionModeProductBuyDesc=Show all products with no accounting account defined for purchases. +OptionModeProductSellDesc=Show all products with accounting account for sales. +OptionModeProductBuyDesc=Show all products with accounting account for purchases. CleanFixHistory=Remove accountancy code from lines that not exists into charts of account CleanHistory=Reset all bindings for selected year +WithoutValidAccount=Without valid dedicated account +WithValidAccount=With valid dedicated account +ValueNotIntoChartOfAccount=This value of accounting account does not exist into chart of account + ## Dictionary Range=Range of accounting account Calculated=Calculated diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 27b64a4399d..9bea19a30a2 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -101,6 +101,7 @@ KeywordFilter=Keyword filter CategoryFilter=Category filter ProductToAddSearch=Search product to add NoMatchFound=No match found +ListOfProductsServices=List of products/services ProductAssociationList=List of products/services that are component of this virtual product/package ProductParentList=List of virtual products/services with this product as a component ErrorAssociationIsFatherOfThis=One of selected product is parent with current product diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 7e3f337ed3b..4755e5e5405 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3159,17 +3159,21 @@ class Product extends CommonObject if (! empty($this->label)) $label .= '
' . $langs->trans('ProductLabel') . ': ' . $this->label; - $tmptext=''; - if ($this->weight) $tmptext.="
".$langs->trans("Weight").': '.$this->weight.' '.measuring_units_string($this->weight_units,"weight"); - if ($this->length) $tmptext.="
".$langs->trans("Length").': '.$this->length.' '.measuring_units_string($this->length_units,'length'); - if ($this->surface) $tmptext.="
".$langs->trans("Surface").': '.$this->surface.' '.measuring_units_string($this->surface_units,'surface'); - if ($this->volume) $tmptext.="
".$langs->trans("Volume").': '.$this->volume.' '.measuring_units_string($this->volume_units,'volume'); - if ($tmptext) $label .= $tmptext; - if (! empty($conf->productbatch->enabled)) + if ($this->type == Product::TYPE_PRODUCT) { - $tmptext.="
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0,2); + if ($this->weight) $label.="
".$langs->trans("Weight").': '.$this->weight.' '.measuring_units_string($this->weight_units,"weight"); + if ($this->length) $label.="
".$langs->trans("Length").': '.$this->length.' '.measuring_units_string($this->length_units,'length'); + if ($this->surface) $label.="
".$langs->trans("Surface").': '.$this->surface.' '.measuring_units_string($this->surface_units,'surface'); + if ($this->volume) $label.="
".$langs->trans("Volume").': '.$this->volume.' '.measuring_units_string($this->volume_units,'volume'); + if (! empty($conf->productbatch->enabled)) + { + $label.="
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0,2); + } + } + if ($this->type == Product::TYPE_SERVICE) + { + // } - $label.=$tmptext; if (! empty($this->entity)) $label .= '
' . $this->show_photos($conf->product->multidir_output[$this->entity],1,1,0,0,0,80); From 614f3d82861a093b6d67cb6e3756609fa553b898 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Nov 2016 16:32:28 +0100 Subject: [PATCH 20/96] Fix param lost when saving setup --- htdocs/accountancy/admin/index.php | 66 ++++++++++++------------------ 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 4eb95d298c5..8f023432727 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -50,8 +50,6 @@ $action = GETPOST('action', 'alpha'); // Parameters ACCOUNTING_* and others $list = array ( - //'ACCOUNTING_LIMIT_LIST_VENTILATION', Useless, we can change value dynamically, so we use default global setup - 'ACCOUNTING_MANAGE_ZERO', 'ACCOUNTING_LENGTH_GACCOUNT', 'ACCOUNTING_LENGTH_AACCOUNT' , 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc @@ -85,13 +83,11 @@ if ($action == 'update') { $error ++; } - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { + if ($error) { setEventMessages($langs->trans("Error"), null, 'errors'); } - foreach ( $list as $constname ) { + foreach ($list as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -259,41 +255,37 @@ if (! empty($user->admin)) print ''; } print ''; + + $var = ! $var; + print ""; + print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; } // Param a user $user->rights->accountancy->chartofaccount can access -foreach ( $list as $key ) { +foreach ($list as $key) +{ $var = ! $var; - if ($key != 'ACCOUNTING_MANAGE_ZERO') - { - print ''; - // Param - $label = $langs->trans($key); - print ''.$label.''; - // Value - print ''; - print ''; - print ''; - print ''; - } - if ($key == 'ACCOUNTING_MANAGE_ZERO') - { - $var = ! $var; - print ""; - print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; - if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - } + print ''; + // Param + $label = $langs->trans($key); + print ''.$label.''; + // Value + print ''; + print ''; + print ''; + print ''; } @@ -302,10 +294,6 @@ print ''; - - - - dol_fiche_end(); print '
'; From ebe3ed9ad4f905e928f64cf80ec8ae1c5cb8e160 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Nov 2016 17:48:20 +0100 Subject: [PATCH 21/96] Uniformize code --- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/bank/index.php | 43 ++++++++++++++-------- htdocs/langs/en_US/accountancy.lang | 2 +- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index f786158ccbe..29f04d8f82d 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1244,7 +1244,7 @@ class Account extends CommonObject } if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' '); - $result.=$link.$this->label.$linkend; + $result.=$link.$this->ref.$linkend; return $result; } diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 7d3073d7129..21f3e581ba4 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -39,6 +39,9 @@ $show_files=GETPOST('show_files','int'); $confirm=GETPOST('confirm','alpha'); $toselect = GETPOST('toselect', 'array'); +$search_ref=GETPOST('search_ref','alpha'); +$search_label=GETPOST('search_label','alpha'); +$search_number=GETPOST('search_number','alpha'); $statut=GETPOST('statut')?GETPOST('statut', 'alpha'):'opened'; // 'all' or ''='opened' $optioncss = GETPOST('optioncss','alpha'); @@ -115,7 +118,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $statut = 'all'; - + $search_ref=''; + $search_label=''; + $search_number=''; + $search_statut=''; } @@ -139,9 +145,11 @@ $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bankcacount_extrafields as ef on (c.rowid = ef.fk_object)"; $sql.= " WHERE entity IN (".getEntity('bank_account', 1).")"; -if ($statut == 'opened') $sql.= " AND clos = 0"; -if ($statut == 'closed') $sql.= " AND clos = 1"; - +if ($statut == 'opened') $sql.= " AND clos = 0"; +if ($statut == 'closed') $sql.= " AND clos = 1"; +if ($search_ref != '') $sql.=natural_search('b.ref', $search_ref); +if ($search_label != '') $sql.=natural_search('b.label', $search_label); +if ($search_number != '') $sql.=natural_search('b.number', $search_number); // Add where from extra fields foreach ($search_array_options as $key => $val) { @@ -202,6 +210,9 @@ $arrayofselected=is_array($toselect)?$toselect:array(); $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if ($search_ref != '') $param.='&search_ref='.$search_ref; +if ($search_label != '') $param.='&search_label='.$search_label; +if ($search_number != '') $param.='&search_number='.$search_number; if ($statut != '') $param.='&statut='.$statut; if ($show_files) $param.='&show_files=' .$show_files; if ($optioncss != '') $param.='&optioncss='.$optioncss; @@ -266,8 +277,8 @@ print ''; if (! empty($arrayfields['b.ref']['checked'])) print_liste_field_titre($arrayfields['b.ref']['label'],$_SERVER["PHP_SELF"],'b.ref','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titre($arrayfields['accountype']['label'],$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['b.label']['checked'])) print_liste_field_titre($arrayfields['b.label']['label'],$_SERVER["PHP_SELF"],'b.label','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titre($arrayfields['accountype']['label'],$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'],$_SERVER["PHP_SELF"],'b.number','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titre($arrayfields['toreconcile']['label'],$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['b.clos']['checked'])) print_liste_field_titre($arrayfields['b.clos']['label'],$_SERVER["PHP_SELF"],'b.clos','',$param,'align="center"',$sortfield,$sortorder); @@ -300,19 +311,19 @@ if (! empty($arrayfields['b.ref']['checked'])) print ''; print ''; } -// Account type -if (! empty($arrayfields['accountype']['checked'])) -{ - print ''; -} -// Ref +// Label if (! empty($arrayfields['b.label']['checked'])) { print ''; } +// Account type +if (! empty($arrayfields['accountype']['checked'])) +{ + print ''; +} // Number if (! empty($arrayfields['b.number']['checked'])) { @@ -403,10 +414,10 @@ foreach ($accounts as $key=>$type) print ''; print ''; + print ''; print ''; - print ''; print ''; print ''; - print ''; + // Status + print ''; + // print ''; @@ -442,7 +455,7 @@ foreach ($accounts as $key=>$type) $total[$acc->currency_code] += $solde; //} } -if (! $found) print ''; +if (! $found) print ''; // Total foreach ($total as $key=>$solde) { diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 9a94bf5d5c5..1619884c36f 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -169,7 +169,7 @@ DescVentilSupplier=Consult here the list of supplier invoice lines bound or not DescVentilDoneSupplier=Consult here the list of the lines of invoices supplier and their accounting account DescVentilTodoExpenseReport=Bind expense report lines not already bound with a fee accounting account DescVentilExpenseReport=Consult here the list of expense report lines bound (or not) to a fee accounting account -DescVentilExpenseReportMore=In most cases, if you use configured fees, the application will be able to make all the binding between your expense report lines and the accounting account of your chart of accounts, just in one click with the button "%s". If account was not set on fees dictionary or if you still has some lines not bound to any account, you will have to make a manual binding from the menu "%s". +DescVentilExpenseReportMore=If you setup accounting account on type of expense report lines, the application will be able to make all the binding between your expense report lines and the accounting account of your chart of accounts, just in one click with the button "%s". If account was not set on fees dictionary or if you still has some lines not bound to any account, you will have to make a manual binding from the menu "%s". DescVentilDoneExpenseReport=Consult here the list of the lines of expenses reports and their fees accounting account ValidateHistory=Bind Automatically From 0fea6f22a9d53d06214c90508a29db1c516c417d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2016 03:27:56 +0100 Subject: [PATCH 22/96] Change code to reduce need of jmobile --- htdocs/comm/mailing/list.php | 8 +- htdocs/compta/bank/index.php | 2 + htdocs/core/class/html.form.class.php | 4 +- htdocs/core/class/html.formcompany.class.php | 10 ++- htdocs/core/lib/functions.lib.php | 28 +++--- htdocs/main.inc.php | 81 +++++++++-------- htdocs/societe/soc.php | 19 ++-- htdocs/theme/eldy/style.css.php | 44 +++++++--- htdocs/theme/md/style.css.php | 91 +++++++++++++------- 9 files changed, 175 insertions(+), 112 deletions(-) diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 7542782f6e7..bd94dd83f5c 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -125,11 +125,11 @@ if ($result) print ''; print ''; // Title print ''; print ''; if (! $filteremail) print ''; @@ -145,7 +145,7 @@ if ($result) $email=new Mailing($db); - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 21f3e581ba4..56735d15fce 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -130,6 +130,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP * View */ +$form=new Form($db); + $title=$langs->trans('BankAccounts'); // Load array of financial accounts (opened by default) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 48126c9afed..b3e1c162102 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5555,8 +5555,8 @@ class Form //$previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'':''; //$next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'':''; - $previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?'<':' ').'':''.(empty($conf->dol_use_jmobile)?'<':' ').''; - $next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?'>':' ').'':''.(empty($conf->dol_use_jmobile)?'>':' ').''; + $previous_ref = $object->ref_previous?''.(($conf->dol_use_jmobile != 4)?'<':' ').'':''.(($conf->dol_use_jmobile != 4)?'<':' ').''; + $next_ref = $object->ref_next?''.(($conf->dol_use_jmobile != 4)?'>':' ').'':''.(($conf->dol_use_jmobile != 4)?'>':' ').''; //print "xx".$previous_ref."x".$next_ref; $ret.='
'; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index ef9141dbc94..ac800d480fc 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -358,9 +358,10 @@ class FormCompany * * @param string $selected Title preselected * @param string $htmlname Name of HTML select combo field + * @param string $morecss Add more css on SELECT element * @return string String with HTML select */ - function select_civility($selected='',$htmlname='civility_id') + function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') { global $conf,$langs,$user; $langs->load("dict"); @@ -374,7 +375,7 @@ class FormCompany $resql=$this->db->query($sql); if ($resql) { - $out.= ''; $out.= ''; $num = $this->db->num_rows($resql); $i = 0; @@ -724,9 +725,10 @@ class FormCompany * @param int $fieldsize Field size * @param int $disableautocomplete 1 To disable ajax autocomplete features (browser autocomplete may still occurs) * @param string $moreattrib Add more attribute on HTML input field + * @param string $morecss More css * @return string */ - function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='') + function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='') { global $conf; @@ -740,7 +742,7 @@ class FormCompany $out.= ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n"; $moreattrib.=' autocomplete="off"'; } - $out.= ''."\n"; + $out.= ''."\n"; return $out; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e00a8a825b8..50f4ff30cc6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1080,9 +1080,9 @@ function fieldLabel($langkey, $fieldkey, $fieldrequired=0) global $conf, $langs; $ret=''; if ($fieldrequired) $ret.=''; - if (empty($conf->dol_use_jmobile)) $ret.=''; if ($fieldrequired) $ret.=''; return $ret; } @@ -3208,20 +3208,20 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so if ($cpt>=1) { - $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=0'.$options.'">1'; - if ($cpt > 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...'; - else if ($cpt == 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=1'.$options.'">2'; + $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page=0'.$options.'">1'; + if ($cpt > 2) $pagelist.='dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="inactive"':'data-role="button"').'>...'; + else if ($cpt == 2) $pagelist.='dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page=1'.$options.'">2'; } do { if ($cpt==$page) { - $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="active"':'data-role="button"').'>'.($page+1).''; + $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="active"':'data-role="button"').'>'.($page+1).''; } else { - $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.$cpt.$options.'">'.($cpt+1).''; + $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page='.$cpt.$options.'">'.($cpt+1).''; } $cpt++; } @@ -3229,14 +3229,14 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so if ($cpt<$nbpages) { - if ($cpt<$nbpages-2) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...'; - else if ($cpt == $nbpages-2) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-2).$options.'">'.($nbpages - 1).''; - $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-1).$options.'">'.$nbpages.''; + if ($cpt<$nbpages-2) $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="inactive"':'data-role="button"').'>...'; + else if ($cpt == $nbpages-2) $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-2).$options.'">'.($nbpages - 1).''; + $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-1).$options.'">'.$nbpages.''; } } else { - $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="active"':'data-role="button"').'>'.($page+1).""; + $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="active"':'data-role="button"').'>'.($page+1).""; } } print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtml, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist @@ -3315,7 +3315,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee } if ($page > 0) { - if (empty($conf->dol_use_jmobile)) print ''; + if (($conf->dol_use_jmobile != 4)) print ''; else print '
  • '.$langs->trans("Previous").'
  • '; } if ($betweenarrows) @@ -3324,7 +3324,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee } if ($nextpage > 0) { - if (empty($conf->dol_use_jmobile)) print ''; + if (($conf->dol_use_jmobile != 4)) print ''; else print '
  • '.$langs->trans("Next").'
  • '; } if ($afterarrows) @@ -5479,7 +5479,7 @@ function printCommonFooter($zone='private') // Google Analytics (need Google module) if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)) { - if (empty($conf->dol_use_jmobile)) + if (($conf->dol_use_jmobile != 4)) { print "\n"; print ''; - } - if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n"; + // 3=??? + // 4=all pages, not only menu + $tmp=basename($_SERVER["PHP_SELF"]); + if ($tmp == 'get_menudiv.php' || $conf->dol_use_jmobile == 4) + { + if (empty($conf->dol_use_jmobile) || ($conf->dol_use_jmobile != 2 && $conf->dol_use_jmobile != 3)) + { + print ''; + } + if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n"; + } } } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index accff491427..0220f775d7b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -994,10 +994,11 @@ else if ($conf->use_javascript_ajax) { print '
    '; - print ''; + print ''; print ''; - print ''; + // Title + print ''; print ''; } @@ -1070,9 +1071,9 @@ else // Zip / Town print ''; // Country @@ -1092,15 +1093,15 @@ else // Email web print ''; - print ''; + print ''; print ''; - print ''; - + print ''; + // Skype if (! empty($conf->skype->enabled)) { print ''; - print ''; + print ''; } // Phone / Fax diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ae45643c9cb..19f1a68f0fa 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -257,6 +257,10 @@ a.tab { font-weight: bold !important; } a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } a:hover { text-decoration: underline; color: rgb(); } +input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { + background-color: #FFF; +} + input:focus, textarea:focus, button:focus, select:focus { @@ -270,8 +274,6 @@ textarea.cke_source:focus input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { font-size: px; font-family: ; - background: #FFF; - /* color: #111; */ border: 1px solid #C0C0C0; margin: 0px 0px 0px 0px; } @@ -618,6 +620,7 @@ div.myavailability { .minwidth400imp { min-width: 400px !important; } .minwidth500imp { min-width: 500px !important; } } +.maxwidth50 { max-width: 50px; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } @@ -630,7 +633,7 @@ div.myavailability { .titlefield { width: 25%; } .titlefieldmiddle { width: 50%; } -/* Force values for small screen */ +/* Force values for small screen 1400 */ @media only screen and (max-width: 1400px) { .titlefield { width: 30% !important; } @@ -643,6 +646,7 @@ div.myavailability { .minwidth500imp { min-width: 300px !important; } } +/* Force values for small screen 1000 */ @media only screen and (max-width: 1000px) { .maxwidthonsmartphone { max-width: 100px; } @@ -654,14 +658,26 @@ div.myavailability { .minwidth500imp { min-width: 100px !important; } } -/* Force values for small screen */ +/* Force values for small screen 570 */ @media only screen and (max-width: 570px) { - input[type=text] { min-width: 20px; } - + div.titre { + line-height: 2em; + } + + input[type=text], select, textarea { + min-width: 20px; + min-height: 1.4em; + line-height: 1.4em; + margin: .5em 0; + padding: .4em .1em; + border: 1px solid #BBB; + } + .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } + .maxwidth50onsmartphone { max-width: 50px; } .maxwidth100onsmartphone { max-width: 100px; } .maxwidth150onsmartphone { max-width: 150px; } .maxwidth200onsmartphone { max-width: 200px; } @@ -2449,7 +2465,7 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile)?'3':'7'; ?>px; + padding-top: dol_use_jmobile != 4)?'3':'7'; ?>px; } div.refid { font-weight: bold; @@ -2485,7 +2501,7 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; -dol_use_jmobile)) { ?> +dol_use_jmobile != 4) { ?> padding-top: 6px; padding-bottom: 5px; @@ -2497,7 +2513,7 @@ div.pagination li { } div.pagination li.pagination a, div.pagination li.pagination span { -dol_use_jmobile)) { ?> +dol_use_jmobile != 4) { ?> padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; @@ -2544,13 +2560,13 @@ div.pagination li.litext a:hover { background-color: transparent; background-image: none; } -dol_use_jmobile)) { ?> +dol_use_jmobile == 4) { ?> div.pagination li.litext { padding-top: 13px; vertical-align: top; } -dol_use_jmobile)) { ?> +dol_use_jmobile != 4) { ?> div.pagination li.noborder a:hover { border: none; background-color: transparent; @@ -4629,9 +4645,9 @@ img.demothumb { width: px; } select { - width: 100%; - max-width: 100px; - min-width: 50px; + width: 98%; + dol_use_jmobile)) { ?>max-width: 100px; + min-width: 40px; } div.divphotoref { padding-right: 5px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3922fbf4bef..9935c3b2231 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -163,14 +163,20 @@ $tmppart=explode(',',$colorbackhmenu1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); if ($tmpval <= 360) $colortextbackhmenu='FFFFFF'; else $colortextbackhmenu='000000'; + $tmppart=explode(',',$colorbackvmenu1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; } else { $colortextbackvmenu='000000'; } + $tmppart=explode(',',$colorbacktitle1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); -if ($tmpval <= 260) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } -else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; } +if ($colortexttitle == '') +{ + $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); + if ($tmpval <= 260) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } + else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; } +} + $tmppart=explode(',',$colorbacktabcard1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } @@ -251,6 +257,10 @@ a.tab { font-weight: bold !important; } a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } a:hover { text-decoration: underline; color: rgb(); } +input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { + background-color: #FDFDFD; +} + input:focus, textarea:focus, button:focus, select:focus { @@ -264,7 +274,6 @@ textarea.cke_source:focus input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { font-size: px; font-family: ; - background: #FDFDFD; border: 1px solid #C0C0C0; margin: 0px 0px 0px 0px; } @@ -286,7 +295,7 @@ input.removedassigned { vertical-align: text-bottom; margin-bottom: -3px; } -input.smallpadd { +input.smallpadd { /* Used for timesheet input */ padding-left: 1px !important; padding-right: 1px !important; } @@ -304,9 +313,6 @@ span.timesheetalreadyrecorded input { select.flat, form.flat select { font-weight: normal; } -input:disabled { - background:#f4f4f4; -} .optiongrey, .opacitymedium { opacity: 0.5; } @@ -316,6 +322,10 @@ input:disabled { .opacitytransp { opacity: 0; } +select:invalid { color: gray; } +input:disabled { + background:#f4f4f4; +} input.liste_titre { box-shadow: none !important; @@ -331,6 +341,7 @@ input.removedfile { textarea:disabled { background:#f4f4f4; } +input[type=file ] { background-color: transparent; border-top: none; border-left: none; border-right: none; box-shadow: none; } input[type=checkbox] { background-color: transparent; border: none; box-shadow: none; } input[type=radio] { background-color: transparent; border: none; box-shadow: none; } input[type=image] { background-color: transparent; border: none; box-shadow: none; } @@ -600,17 +611,22 @@ div.myavailability { .clearboth { clear:both; } .hideobject { display: none; } .minwidth50 { min-width: 50px; } -.minwidth100 { min-width: 100px; } -.minwidth200 { min-width: 200px; } -.minwidth300 { min-width: 300px; } -.minwidth400 { min-width: 400px; } -.minwidth500 { min-width: 500px; } -.minwidth50imp { min-width: 50px !important; } -.minwidth100imp { min-width: 100px !important; } -.minwidth200imp { min-width: 200px !important; } -.minwidth300imp { min-width: 300px !important; } -.minwidth400imp { min-width: 400px !important; } -.minwidth500imp { min-width: 500px !important; } +/* rule to reduce top menu - 3rd reduction */ +@media only screen and (min-width: px) +{ + .minwidth100 { min-width: 100px; } + .minwidth200 { min-width: 200px; } + .minwidth300 { min-width: 300px; } + .minwidth400 { min-width: 400px; } + .minwidth500 { min-width: 500px; } + .minwidth50imp { min-width: 50px !important; } + .minwidth100imp { min-width: 100px !important; } + .minwidth200imp { min-width: 200px !important; } + .minwidth300imp { min-width: 300px !important; } + .minwidth400imp { min-width: 400px !important; } + .minwidth500imp { min-width: 500px !important; } +} +.maxwidth50 { max-width: 50px; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } @@ -623,7 +639,7 @@ div.myavailability { .titlefield { width: 25%; } .titlefieldmiddle { width: 50%; } -/* Force values for small screen */ +/* Force values for small screen 1400 */ @media only screen and (max-width: 1400px) { .titlefield { width: 30% !important; } @@ -636,6 +652,7 @@ div.myavailability { .minwidth500imp { min-width: 300px !important; } } +/* Force values for small screen 1000 */ @media only screen and (max-width: 1000px) { .maxwidthonsmartphone { max-width: 100px; } @@ -647,12 +664,26 @@ div.myavailability { .minwidth500imp { min-width: 100px !important; } } -/* Force values for small screen */ +/* Force values for small screen 570 */ @media only screen and (max-width: 570px) { + div.titre { + line-height: 2em; + } + + input[type=text], select, textarea { + min-width: 20px; + min-height: 1.4em; + line-height: 1.4em; + margin: .5em 0; + padding: .4em .1em; + border: 1px solid #BBB; + } + .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } + .maxwidth50onsmartphone { max-width: 50px; } .maxwidth100onsmartphone { max-width: 100px; } .maxwidth150onsmartphone { max-width: 150px; } .maxwidth200onsmartphone { max-width: 200px; } @@ -2083,7 +2114,7 @@ span.butAction, span.butActionDelete { color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #006dcc; - dol_use_jmobile)) { ?> + dol_use_jmobile != 4)) { ?> background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); @@ -2351,7 +2382,7 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile)?'3':'14'; ?>px; + padding-top: dol_use_jmobile != 4)?'3':'14'; ?>px; } div.refid { font-weight: bold; @@ -2387,7 +2418,7 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; -dol_use_jmobile)) { ?> +dol_use_jmobile != 4)) { ?> padding-top: 6px; padding-bottom: 5px; @@ -2400,7 +2431,7 @@ div.pagination li { div.pagination li.pagination a, div.pagination li.pagination span { -dol_use_jmobile)) { ?> +dol_use_jmobile != 4) { ?> padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; @@ -2427,13 +2458,13 @@ border: none; padding-left: 4px; font-weight: bold; } -dol_use_jmobile)) { ?> +dol_use_jmobile == 4) { ?> div.pagination li.litext { padding-top: 13px; vertical-align: top; } -dol_use_jmobile)) { ?> +dol_use_jmobile != 4) { ?> div.pagination li.noborder a:hover { border: none; background-color: transparent; @@ -4362,6 +4393,8 @@ border-top-right-radius: 6px; img.demothumb { box-shadow: 2px 2px 8px #888; margin-bottom: 4px; + margin-right: 20px; + margin-left: 10px; } @@ -4509,8 +4542,8 @@ img.demothumb { width: px; } select { - width: 100%; - max-width: 100px; + width: 98%; + dol_use_jmobile)) { ?>max-width: 100px; min-width: 0 !important; } div.divphotoref { From 31acffbb13e19bc9ca08ab6a72acf720560aedaf Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 5 Nov 2016 10:58:55 +0100 Subject: [PATCH 23/96] error on get tva_tx on product customer price --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6b47d5205b6..06b5f5ac4a5 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -777,7 +777,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $tva_tx = $prodcustprice->lines [0]->tva_tx; } } } From 06c6a1107d4945b5debd0cf38a019a763dd4db91 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 5 Nov 2016 11:00:40 +0100 Subject: [PATCH 24/96] same error --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 313fef16e2c..e1e50000df3 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -730,7 +730,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $tva_tx = $prodcustprice->lines [0]->tva_tx; } } else From 85c57e76e098d6ded44b35f41ee19684452b200d Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 5 Nov 2016 11:01:38 +0100 Subject: [PATCH 25/96] Update facture.php --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 3ee875b5d93..2bf69038e78 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1433,7 +1433,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines[0]->price); $pu_ttc = price($prodcustprice->lines[0]->price_ttc); $price_base_type = $prodcustprice->lines[0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines[0]->tva_tx; + $tva_tx = $prodcustprice->lines[0]->tva_tx; } } } From f7294d5c3f433993c60b581352ab2c5a5fb635d9 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 5 Nov 2016 11:04:16 +0100 Subject: [PATCH 26/96] Update fiche-rec.php --- htdocs/compta/facture/fiche-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 33da64e3221..b5467f74a02 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -504,7 +504,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines[0]->price); $pu_ttc = price($prodcustprice->lines[0]->price_ttc); $price_base_type = $prodcustprice->lines[0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines[0]->tva_tx; + $tva_tx = $prodcustprice->lines[0]->tva_tx; } } } From 614a0f2077c871e32ed9d57dcf995450abcae96e Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 5 Nov 2016 11:05:14 +0100 Subject: [PATCH 27/96] Update card.php --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 86e45ade086..3c29f4e8fca 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -494,7 +494,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $tva_tx = $prodcustprice->lines [0]->tva_tx; } } } From 6da82762f2f654fa38e3132ec66f94de849cc75b Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 5 Nov 2016 11:09:54 +0100 Subject: [PATCH 28/96] Update card.php --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 0a493ef60bc..b4a3f8ab420 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -636,7 +636,7 @@ if (empty($reshook)) $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; - $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + $tva_tx = $prodcustprice->lines [0]->tva_tx; } } } From 4c712866a0036d291e7cf82ab6962196383e409e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2016 13:52:24 +0100 Subject: [PATCH 29/96] FIX No tooltip if dol_no_mouse_hover is on --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index df74013fba1..b64da2c0b2d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1907,7 +1907,7 @@ if (! function_exists("llxFooter")) if (! empty($delayedhtmlcontent)) print $delayedhtmlcontent; // Wrapper to show tooltips - if ($conf->use_javascript_ajax) + if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover)) { print "\n\n"; print ' + @@ -52,9 +54,26 @@ if (empty($usedolheader)) } else { - $arraycss=array(); - $arrayjs=array(); - + $arraycss=array(); + $arrayjs=array(); + /* + $arraycss=array('/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css', + '/includes/jquery/plugins/datatables/extensions/Buttons/css/buttons.dataTables.min.css', + '/includes/jquery/plugins/datatables/extensions/ColReorder/css/colReorder.dataTables.min.css' + ); + $arrayjs=array('/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/dataTables.buttons.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.colVis.min.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.html5.min.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.flash.min.js', + '/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.print.min.js', + '/includes/jquery/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js', + '/includes/jszip/jszip.min.js', + '/includes/pdfmake/pdfmake.min.js', + '/includes/pdfmake/vfs_fonts.js' + ); + */ + llxHeader('','','','',0,0,$arrayjs,$arraycss); } @@ -66,7 +85,8 @@ else

    This page is a sample of page using tables. It is designed to make test with
    - css (add parameter &theme=newtheme to test another theme or edit css of current theme)
    -- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 960 to enable view with jmobile)
    +- jmobile (add parameter ">dol_use_jmobile=4&dol_optimize_smallscreen=1 and switch to small screen < 1000 to enable view with jmobile)
    +- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
    - no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
    - dataTables
    - tablednd
    @@ -79,10 +99,10 @@ This page is a sample of page using tables. It is designed to make test with
    - +
    - +
    @@ -92,10 +112,10 @@ This page is a sample of page using tables. It is designed to make test with
    - +
    - +
    @@ -105,10 +125,10 @@ This page is a sample of page using tables. It is designed to make test with

    '; - print ''; print ''; print ''; + print '
    '.$acc->getNomUrl(1).''.$acc->label.''; print $acc->type_lib[$acc->type]; print ''.$acc->bank.''.$acc->number.''; if ($acc->rappro) @@ -421,7 +432,9 @@ foreach ($accounts as $key=>$type) } else print $langs->trans("FeatureDisabled"); print ''.$acc->getLibStatut(2).''.$acc->getLibStatut(5).''; print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print '
    '.$langs->trans("None").'
    '.$langs->trans("None").'
    '; - print ''; + print ''; print ''; - print ''; + print ''; print '  
    '.fieldLabel('FirstName','firstname').'
    '.fieldLabel('UserTitle','civility_id').''; - print $formcompany->select_civility($object->civility_id).'
    '.fieldLabel('UserTitle','civility_id').''; + print $formcompany->select_civility($object->civility_id, 'civility_id', 'maxwidth100').'
    '.fieldLabel('Zip','zipcode').''; - print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); + print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print ''.fieldLabel('Town','town').''; - print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); + print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print '
    '.fieldLabel('EMail','email').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
    '.fieldLabel('Web','url').'
    '.fieldLabel('Skype','skype').'
    - + - +
    diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 6b540b7c2c5..2c639df7c9d 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -692,6 +692,30 @@ div.myavailability { .minwidth500imp { min-width: 50px !important; } .titlefield { width: auto; } .titlefieldcreate { width: auto; } + + #tooltip { + position: absolute; + width: px; + } + select { + width: 98%; + dol_use_jmobile)) { ?>max-width: 100px; + min-width: 40px; + } + div.divphotoref { + padding-right: 5px; + } + img.photoref, div.photoref { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + padding: 4px; + height: 20px; + width: 20px; + object-fit: contain; + } + } .linkobject { cursor: pointer; } @@ -4640,30 +4664,6 @@ img.demothumb { div.mainmenu { min-width: 20px; } - - #tooltip { - position: absolute; - width: px; - } - select { - width: 98%; - dol_use_jmobile)) { ?>max-width: 100px; - min-width: 40px; - } - div.divphotoref { - padding-right: 5px; - } - img.photoref, div.photoref { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - padding: 4px; - height: 20px; - width: 20px; - object-fit: contain; - } - } Date: Tue, 8 Nov 2016 17:21:26 +0100 Subject: [PATCH 58/96] NEW Add type "url" as possible extrafield. --- htdocs/admin/supplier_order.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/facture/apercu.php | 4 +- htdocs/compta/facture/prelevement.php | 4 +- htdocs/core/class/extrafields.class.php | 29 +++++++++----- htdocs/core/class/html.form.class.php | 38 +++++++++++-------- .../core/tpl/admin_extrafields_edit.tpl.php | 8 ++-- htdocs/expedition/shipment.php | 2 +- htdocs/langs/en_US/admin.lang | 3 +- htdocs/public/test/test_arrays.php | 1 - htdocs/public/test/test_forms.php | 3 +- 12 files changed, 58 insertions(+), 40 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 5d0cf665d7c..5c288b9e78a 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -497,7 +497,7 @@ $var=false; print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
    '; print $langs->trans("IfSetToYesDontForgetPermission"); print ''; - print ''; + print ''; print ''; print ''; print "\n"; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6b47d5205b6..5af6fbe3733 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1808,7 +1808,7 @@ if ($action == 'create') // Remise dispo de type non avoir $filter = 'fk_facture_source IS NULL'; print '
    '; - $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?id=' . $object->id, 0, 'remise_id', $soc->id, $absolute_discount, $filter); + $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?id=' . $object->id, 0, 'remise_id', $soc->id, $absolute_discount, $filter, 0, '', 1); } } if ($absolute_creditnote) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 313fef16e2c..e0e569a99b2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2019,7 +2019,7 @@ if ($action == 'create' && $user->rights->commande->creer) } else { // Remise dispo de type remise fixe (not credit note) print '
    '; - $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?id=' . $object->id, 0, 'remise_id', $soc->id, $absolute_discount, $filterabsolutediscount); + $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?id=' . $object->id, 0, 'remise_id', $soc->id, $absolute_discount, $filterabsolutediscount, 0, '', 1); } } if ($absolute_creditnote) { diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index 8300545cb22..258b2434f60 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -188,7 +188,7 @@ if ($id > 0 || ! empty($ref)) // Remise dispo de type remise fixe (not credit note) $filter='fk_facture_source IS NULL'; print '
    '; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id',$soc->id, $absolute_discount, $filter, $resteapayer, ' - '.$addabsolutediscount); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id',$soc->id, $absolute_discount, $filter, $resteapayer, ' - '.$addabsolutediscount, 1); } } else @@ -220,7 +220,7 @@ if ($id > 0 || ! empty($ref)) // Remise dispo de type avoir $filter='fk_facture_source IS NOT NULL'; if (! $absolute_discount) print '
    '; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filter, $resteapayer); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filter, $resteapayer, '', 1); } } if (! $absolute_discount && ! $absolute_creditnote) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 87a27166ae8..879d5abfee4 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -263,7 +263,7 @@ if ($object->id > 0) // Remise dispo de type non avoir $filter='fk_facture_source IS NULL'; print '
    '; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$object->thirdparty->id,$absolute_discount,$filter,$resteapayer); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$object->thirdparty->id,$absolute_discount,$filter,$resteapayer,'',1); } } if ($absolute_creditnote > 0) @@ -283,7 +283,7 @@ if ($object->id > 0) // Remise dispo de type avoir $filter='fk_facture_source IS NOT NULL'; if (! $absolute_discount) print '
    '; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id_for_payment',$object->thirdparty->id,$absolute_creditnote,$filter,$resteapayer); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id_for_payment',$object->thirdparty->id,$absolute_creditnote,$filter,$resteapayer,'',1); } } if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9bed1ed9a82..5034be1c901 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -76,14 +76,15 @@ class ExtraFields 'price'=>'ExtrafieldPrice', 'phone'=>'ExtrafieldPhone', 'mail'=>'ExtrafieldMail', + 'url'=>'ExtrafieldUrl', 'select' => 'ExtrafieldSelect', 'sellist' => 'ExtrafieldSelectList', 'radio' => 'ExtrafieldRadio', 'checkbox' => 'ExtrafieldCheckBox', 'chkbxlst' => 'ExtrafieldCheckBoxFromList', 'link' => 'ExtrafieldLink', - 'separate' => 'ExtrafieldSeparator', 'password' => 'ExtrafieldPassword', + 'separate' => 'ExtrafieldSeparator', ); /** @@ -195,6 +196,9 @@ class ExtraFields } elseif($type=='mail') { $typedb='varchar'; $lengthdb='128'; + } elseif($type=='url') { + $typedb='varchar'; + $lengthdb='255'; } elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox') ||($type=='chkbxlst')){ $typedb='text'; $lengthdb=''; @@ -425,6 +429,9 @@ class ExtraFields } elseif($type=='mail') { $typedb='varchar'; $lengthdb='128'; + } elseif($type=='url') { + $typedb='varchar'; + $lengthdb='255'; } elseif (($type=='select') || ($type=='sellist') || ($type=='radio') || ($type=='checkbox') || ($type=='chkbxlst')) { $typedb='text'; $lengthdb=''; @@ -693,6 +700,10 @@ class ExtraFields //$showsize=10; $showsize = 'minwidth100imp'; } + elseif ($type == 'url') + { + $showsize='minwidth400imp'; + } else { if (round($size) < 12) @@ -738,6 +749,10 @@ class ExtraFields { $out=''; } + elseif (in_array($type, array('mail', 'phone', 'url'))) + { + $out=''; + } elseif ($type == 'text') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -754,14 +769,6 @@ class ExtraFields } $out=''; } - elseif ($type == 'mail') - { - $out=''; - } - elseif ($type == 'phone') - { - $out=''; - } elseif ($type == 'price') { $out=' '.$langs->getCurrencySymbol($conf->currency); @@ -1238,6 +1245,10 @@ class ExtraFields { $value=dol_print_email($value); } + elseif ($type == 'url') + { + $value=dol_print_url($value,'_blank',32,1); + } elseif ($type == 'phone') { $value=dol_print_phone($value); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b3e1c162102..b5fc9fbc560 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3910,15 +3910,16 @@ class Form * * @param string $page Page URL where form is shown * @param int $selected Value pre-selected - * @param string $htmlname Nom du formulaire select. Si 'none', non modifiable. Example 'remise_id'. + * @param string $htmlname Name of SELECT component. If 'none', not changeable. Example 'remise_id'. * @param int $socid Third party id * @param float $amount Total amount available * @param string $filter SQL filter on discounts * @param int $maxvalue Max value for lines that can be selected * @param string $more More string to add + * @param int $hidelist 1=Hide list * @return void */ - function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='') + function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0) { global $conf,$langs; if ($htmlname != "none") @@ -3929,25 +3930,30 @@ class Form print '
    '; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice - else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; + if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); // If we want deposit to be substracted to payments only and not to total of final invoice + else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)); } else { - if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; - else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; - } - print '
    '; - $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles - if ($filter) $newfilter.=' AND ('.$filter.')'; - $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue); - if ($nbqualifiedlines > 0) - { - print '   '; + if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); + else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)); } + if (empty($hidelist)) print ': '; print '
    '; + if (empty($hidelist)) + { + print '
    '; + $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles + if ($filter) $newfilter.=' AND ('.$filter.')'; + $nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue); + if ($nbqualifiedlines > 0) + { + print '   '; + } + print '
    '; + } if ($more) { print '
    '; diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 6788a24baaa..881ec69190b 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -129,10 +129,10 @@ elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') ) array('varchar', 'phone', 'mail', 'select'), - 'mail'=>array('varchar', 'phone', 'mail', 'select'), - 'phone'=>array('varchar', 'phone', 'mail', 'select'), - 'select'=>array('varchar', 'phone', 'mail', 'select') + 'varchar'=>array('varchar', 'phone', 'mail', 'url', 'select'), + 'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'), + 'phone'=>array('varchar', 'phone', 'mail', 'url', 'select'), + 'select'=>array('varchar', 'phone', 'mail', 'url', 'select') ); if (in_array($type, array_keys($typewecanchangeinto))) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index d16cd64f0ff..fdb4bf76359 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -254,7 +254,7 @@ if ($id > 0 || ! empty($ref)) // Remise dispo de type non avoir $filter='fk_facture_source IS NULL'; print '
    '; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$commande->id,0,'remise_id',$soc->id,$absolute_discount,$filter); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$commande->id,0,'remise_id',$soc->id,$absolute_discount,$filter, 0, '', 1); } } if ($absolute_creditnote) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 746d0ec7d77..27d86696b82 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -354,6 +354,7 @@ Boolean=Boolean (Checkbox) ExtrafieldPhone = Phone ExtrafieldPrice = Price ExtrafieldMail = Email +ExtrafieldUrl = Url ExtrafieldSelect = Select list ExtrafieldSelectList = Select from table ExtrafieldSeparator=Separator @@ -398,7 +399,7 @@ EnableAndSetupModuleCron=If you want to have this recurring invoice beeing gener ModuleCompanyCodeAquarium=Return an accountancy code built by:
    %s followed by third party supplier code for a supplier accountancy code,
    %s followed by third party customer code for a customer accountancy code. ModuleCompanyCodePanicum=Return an empty accountancy code. ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code. -Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1 validation, 2=first approval and 3=second approval if amount is enough).
    Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval is always required. +Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).
    Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required. UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than... # Modules diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 9f337d2eb5a..5eaa20003af 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -88,7 +88,6 @@ This page is a sample of page using tables. It is designed to make test with
    - jmobile (add parameter ">dol_use_jmobile=4&dol_optimize_smallscreen=1 and switch to small screen < 1000 to enable view with jmobile)
    - jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
    - no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
    -- dataTables
    - tablednd
    diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index a697b371438..a53f812611a 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -17,7 +17,8 @@ llxHeader();

    This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
    - css (add parameter &theme=newtheme to test another theme or edit css of current theme)
    -- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
    +- jmobile (add parameter ">dol_use_jmobile=4&dol_optimize_smallscreen=1 and switch to small screen < 1000 to enable view with jmobile)
    +- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
    - no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)


    From 3346fb1c75ed4bed8e3bfbdac3f3d25ac4d9be1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Nov 2016 17:30:48 +0100 Subject: [PATCH 59/96] Fix can change type from url to other string --- htdocs/core/class/extrafields.class.php | 4 ++-- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 5034be1c901..8479bab7563 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1243,7 +1243,7 @@ class ExtraFields } elseif ($type == 'mail') { - $value=dol_print_email($value); + $value=dol_print_email($value,0,0,0,64,1,1); } elseif ($type == 'url') { @@ -1251,7 +1251,7 @@ class ExtraFields } elseif ($type == 'phone') { - $value=dol_print_phone($value); + $value=dol_print_phone($value, '', 0, 0, '', ' ', 1); } elseif ($type == 'price') { diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 881ec69190b..b6c43b10ce9 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -131,6 +131,7 @@ elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') ) $typewecanchangeinto=array( 'varchar'=>array('varchar', 'phone', 'mail', 'url', 'select'), 'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'), + 'url'=>array('varchar', 'phone', 'mail', 'url', 'select'), 'phone'=>array('varchar', 'phone', 'mail', 'url', 'select'), 'select'=>array('varchar', 'phone', 'mail', 'url', 'select') ); From d1446bb7ef56c28e6b4ce4af6845940b5a77642b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Nov 2016 19:19:30 +0100 Subject: [PATCH 60/96] NEW Show subtotal into list of linked elements --- htdocs/.gitignore | 1 + .../comm/propal/tpl/linkedobjectblock.tpl.php | 47 ++++++++----- htdocs/commande/tpl/linkedobjectblock.tpl.php | 67 ++++++++++++------- .../facture/tpl/linkedobjectblock.tpl.php | 49 +++++++++----- htdocs/core/class/html.form.class.php | 15 +++-- .../expedition/tpl/linkedobjectblock.tpl.php | 63 ++++++++++------- .../commande/tpl/linkedobjectblock.tpl.php | 49 +++++++++----- .../facture/tpl/linkedobjectblock.tpl.php | 49 +++++++++----- htdocs/langs/en_US/sendings.lang | 2 +- .../tpl/linkedobjectblock.tpl.php | 47 ++++++++----- htdocs/theme/eldy/style.css.php | 2 +- 11 files changed, 260 insertions(+), 131 deletions(-) diff --git a/htdocs/.gitignore b/htdocs/.gitignore index 608ef55d106..1650ea7e5ae 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -22,3 +22,4 @@ /cabinetmed* /webmail* /conf/conf.php +/subtotal/ diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index cc84e87ddba..dd325da7297 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -35,27 +35,44 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("propal"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("Proposal"); ?> - getNomUrl(1); ?> - ref_client; ?> - date,'day'); ?> - rights->propale->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - + + trans("Proposal"); ?> + getNomUrl(1); ?> + ref_client; ?> + date,'day'); ?> + rights->propale->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 98e931db9f8..38efbc91ca2 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -24,41 +24,60 @@ load("orders"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("CustomerOrder"); ?> - getNomUrl(1); ?> - ref_client; ?> - date,'day'); ?> - rights->commande->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - - element != 'shipping') { - ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - - - + + trans("CustomerOrder"); ?> + getNomUrl(1); ?> + ref_client; ?> + date,'day'); ?> + rights->commande->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + + element != 'shipping') { + ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + + + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + \ No newline at end of file diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 56e8645b8c7..16aa54e229d 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -24,32 +24,51 @@ load("bills"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("CustomerInvoice"); ?> - getNomUrl(1); ?> - ref_client; ?> - date,'day'); ?> - rights->facture->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - + + trans("CustomerInvoice"); ?> + getNomUrl(1); ?> + ref_client; ?> + date,'day'); ?> + rights->facture->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + \ No newline at end of file diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b5fc9fbc560..8a6c97e794c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5215,7 +5215,7 @@ class Form if (empty($reshook)) { - $num = count($object->linkedObjects); + $nbofdifferenttypes = count($object->linkedObjects); print '
    '; print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, ''); @@ -5232,7 +5232,7 @@ class Form print ''; print ''; - $numoutput=0; + $nboftypesoutput=0; foreach($object->linkedObjects as $objecttype => $objects) { @@ -5292,23 +5292,28 @@ class Form $dirtpls=array_merge($conf->modules_parts['tpl'],array('/'.$tplpath.'/tpl')); foreach($dirtpls as $reldir) { + if ($nboftypesoutput == ($nbofdifferenttypes - 1)) // No more type to show after + { + global $noMoreLinkedObjectBlockAfter; + $noMoreLinkedObjectBlockAfter=1; + } $res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); if ($res) { - $numoutput++; + $nboftypesoutput++; break; } } } - if (! $numoutput) + if (! $nboftypesoutput) { print ''.$langs->trans("None").''; } print ''; - return $num; + return $nbofdifferenttypes; } } diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index 276eb5ed8fa..f66ff148d66 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -29,35 +29,52 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("sendings"); -$total=0; +$total=0; $ilink=0; $var=true; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("Shipment"); ?> - getNomUrl(1); ?> - - date_delivery,'day'); ?> - rights->expedition->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - - element != 'commande') { - ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - - + + trans("Shipment"); ?> + getNomUrl(1); ?> + + date_delivery,'day'); ?> + rights->expedition->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + + element != 'commande') { + ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index 4cb232add74..5afde3a4427 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -23,32 +23,49 @@ load("orders"); -$total=0; +$total=0; $ilink=0; $var=true; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("SupplierOrder"); ?> - trans("ShowOrder"),"order").' '.$objectlink->ref; ?> - ref_supplier; ?> - date,'day'); ?> - rights->fournisseur->commande->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - -"> + trans("SupplierOrder"); ?> + trans("ShowOrder"),"order").' '.$objectlink->ref; ?> + ref_supplier; ?> + date,'day'); ?> + rights->fournisseur->commande->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 6762d836d52..4df741b8ad4 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -24,32 +24,49 @@ load("bills"); -$total=0; +$total=0; $ilink=0; $var=true; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("SupplierInvoice"); ?> - trans("ShowBill"),"bill").' '.$objectlink->ref; ?> - ref_supplier; ?> - date,'day'); ?> - rights->fournisseur->facture->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - -"> + trans("SupplierInvoice"); ?> + trans("ShowBill"),"bill").' '.$objectlink->ref; ?> + ref_supplier; ?> + date,'day'); ?> + rights->fournisseur->facture->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index cbbeb092a1a..b85b61bc334 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -23,7 +23,7 @@ QtyReceived=Qty received QtyInOtherShipments=Qty in other shipments KeepToShip=Remain to ship OtherSendingsForSameOrder=Other shipments for this order -SendingsAndReceivingForSameOrder=Shipments and receivings for this order +SendingsAndReceivingForSameOrder=Shipments and receipts for this order SendingsToValidate=Shipments to validate StatusSendingCanceled=Canceled StatusSendingDraft=Draft diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php index 8f72744486a..8ba1f958918 100644 --- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php @@ -28,27 +28,44 @@ global $user; $langs = $GLOBALS['langs']; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > - trans("SupplierProposal"); ?> - trans("ShowSupplierProposal"),"supplier_proposal").' '.$objectlink->ref; ?> - - datec,'day'); ?> - rights->supplier_proposal->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); - } ?> - getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink")); ?> - + + trans("SupplierProposal"); ?> + trans("ShowSupplierProposal"),"supplier_proposal").' '.$objectlink->ref; ?> + + datec,'day'); ?> + rights->supplier_proposal->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } ?> + getLibStatut(3); ?> + ">transnoentitiesnoconv("RemoveLink")); ?> + 1) +{ + ?> + + trans("Total"); ?> + + + + + + + + diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 2c639df7c9d..f1368099864 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2859,7 +2859,7 @@ form.liste_total div { border-top: 1px solid #DDDDDD; } tr.liste_sub_total, tr.liste_sub_total td { - border-bottom: 2px solid #aaa; + border-bottom: 1px solid #aaa; } .tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair { From 52080fb917914760054b2a8265a6ae2ff17fc75f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Nov 2016 20:06:50 +0100 Subject: [PATCH 61/96] Fix code not reachable --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 -- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index ece59790fc3..dab925eef1d 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -580,8 +580,6 @@ class pdf_rouget extends ModelePdfExpedition $this->error=$langs->transnoentities("ErrorConstantNotDefined","EXP_OUTPUTDIR"); return 0; } - $this->error=$langs->transnoentities("ErrorUnknown"); - return 0; // Erreur par defaut } /** diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 0c57cf644bc..1701f82c47b 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -691,8 +691,6 @@ class pdf_crabe extends ModelePDFFactures $this->error=$langs->transnoentities("ErrorConstantNotDefined","FAC_OUTPUTDIR"); return 0; } - $this->error=$langs->transnoentities("ErrorUnknown"); - return 0; // Erreur par defaut } From c45c24f80c39bbf733c6acf36d7c04cf7883b91a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Nov 2016 23:03:58 +0100 Subject: [PATCH 62/96] FIX Must use external link into a forged email content. --- htdocs/langs/en_US/members.lang | 2 +- htdocs/langs/en_US/users.lang | 2 +- htdocs/user/class/user.class.php | 24 +++++++++++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 527a5bd7db3..498985a5e3a 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -13,7 +13,7 @@ ListOfValidatedPublicMembers=List of validated public members ErrorThisMemberIsNotPublic=This member is not public ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: %s, login: %s) is already linked to a third party %s. Remove this link first because a third party can't be linked to only a member (and vice versa). ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours. -ThisIsContentOfYourCard=This is details of your card +ThisIsContentOfYourCard=Hi.

    This is a remind of the information we get about you. Feel free to contact us if something looks wrong.

    CardContent=Content of your member card SetLinkToUser=Link to a Dolibarr user SetLinkToThirdParty=Link to a Dolibarr third party diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index a723053fa43..6f6dc24d037 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -8,7 +8,7 @@ EditPassword=Edit password SendNewPassword=Regenerate and send password ReinitPassword=Regenerate password PasswordChangedTo=Password changed to: %s -SubjectNewPassword=Your new password for Dolibarr +SubjectNewPassword=Your new password for %s GroupRights=Group permissions UserRights=User permissions UserGUISetup=User display setup diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 5b79447736e..fb27aef9d2e 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1645,38 +1645,48 @@ class User extends CommonObject $outputlangs->load("users"); $outputlangs->load("other"); - $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword"); + $appli=constant('DOL_APPLICATION_TITLE'); + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; + + $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli); // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); - //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - $urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current if (! $changelater) { + $url = $urlwithroot.'/'; + $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; - $url = $urlwithroot.'/'; - $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $conf->global->MAIN_APPLICATION_TITLE).': '.$url."\n\n"; + + $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n"; $mesg.= "--\n"; $mesg.= $user->getFullName($outputlangs); // Username that make then sending + + dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); } else { + $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); + $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyWillBe")." :\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; $mesg.= $outputlangs->transnoentitiesnoconv("YouMustClickToChange")." :\n"; - $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); $mesg.= $url."\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("ForgetIfNothing")."\n\n"; - dol_syslog(get_class($this)."::send_password url=".$url); + + dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } + $mailfile = new CMailFile( $subject, $this->email, From e30622cbd890b44067b9e8a0bc2f10808ed3e215 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Nov 2016 00:10:02 +0100 Subject: [PATCH 63/96] FIX Bcc must not appears to recipient when using SMTPs lib --- htdocs/core/class/CMailFile.class.php | 4 ++-- htdocs/core/class/smtps.class.php | 32 +++++++++++++++++++-------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 03f7e39bde8..94ee2a5fd1e 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -527,7 +527,7 @@ class CMailFile if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail(); if (! empty($bounce)) $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers, $bounce); - else $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers); + else $res = mail($dest, $this->encodetorfc2822($this->subject), $this->message, $this->headers); if (! $res) { @@ -840,7 +840,7 @@ class CMailFile // Receiver if (isset($this->addr_cc) && $this->addr_cc) $out.= "Cc: ".$this->getValidAddress($this->addr_cc,2).$this->eol2; - if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; + if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ? // Delivery receipt if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out.= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol2; diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 83e30a05413..7f2eb4a633f 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -484,14 +484,20 @@ class SMTPs // and send it out "single file" foreach ( $this->get_RCPT_list() as $_address ) { - /* + /* Note: + * BCC email addresses must be listed in the RCPT TO command list, + * but the BCC header should not be printed under the DATA command. + * http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server + */ + + /* * TODO - * After each 'RCPT TO:' is sent, we need to make sure it was kosher, - * if not, the whole message will fail - * If any email address fails, we will need to RESET the connection, - * mark the last address as "bad" and start the address loop over again. - * If any address fails, the entire message fails. - */ + * After each 'RCPT TO:' is sent, we need to make sure it was kosher, + * if not, the whole message will fail + * If any email address fails, we will need to RESET the connection, + * mark the last address as "bad" and start the address loop over again. + * If any address fails, the entire message fails. + */ $this->socket_send_str('RCPT TO: <' . $_address . '>', '250'); } @@ -1020,7 +1026,7 @@ class SMTPs /** * Returns an array of addresses for a specific type; TO, CC or BCC * - * @param string $_which Which collection of adresses to return + * @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc') * @return string|false Array of emaill address */ function get_email_list($_which = null) @@ -1169,9 +1175,17 @@ class SMTPs if ( $this->getCC() ) $_header .= 'Cc: ' . $this->getCC() . "\r\n"; + /* Note: + * BCC email addresses must be listed in the RCPT TO command list, + * but the BCC header should not be printed under the DATA command. + * So it is included into the function sendMsg() but not here. + * http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server + */ + /* if ( $this->getBCC() ) $_header .= 'Bcc: ' . $this->getBCC() . "\r\n"; - + */ + $host=$this->getHost(); $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix From 0b594eab594d7df40e9ebb1443509ea59f481309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 9 Nov 2016 11:28:05 +0100 Subject: [PATCH 64/96] FIX #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them --- htdocs/comm/propal/class/propal.class.php | 64 ++++++++++++++--------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 463c81266f8..aa1a59e025a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2734,34 +2734,46 @@ class Propal extends CommonObject */ function getNomUrl($withpicto=0,$option='', $get_params='') { - global $langs, $conf; + global $langs, $conf, $user; $result=''; - $label = '' . $langs->trans("ShowPropal") . ''; - if (! empty($this->ref)) - $label.= '
    '.$langs->trans('Ref').': '.$this->ref; - if (! empty($this->ref_client)) - $label.= '
    '.$langs->trans('RefCustomer').': '.$this->ref_client; - if (! empty($this->total_ht)) - $label.= '
    ' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_tva)) - $label.= '
    ' . $langs->trans('VAT') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_ttc)) - $label.= '
    ' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); - $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; - if ($option == '') { - $link = ''; + $label = ''; + + if ($user->rights->propal->lire) { + $label .= ''.$langs->trans("ShowPropal").''; + if (!empty($this->ref)) { + $label .= '
    '.$langs->trans('Ref').': '.$this->ref; + } + if (!empty($this->ref_client)) { + $label .= '
    '.$langs->trans('RefCustomer').': '.$this->ref_client; + } + if (!empty($this->total_ht)) { + $label .= '
    '.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, + $conf->currency); + } + if (!empty($this->total_tva)) { + $label .= '
    '.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, + $conf->currency); + } + if (!empty($this->total_ttc)) { + $label .= '
    '.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, + $conf->currency); + } + $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; + if ($option == '') { + $link = '
    '; + } $picto='propal'; From c6f96a81d130a82fa1e21805212e419ae818b715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 9 Nov 2016 11:30:55 +0100 Subject: [PATCH 65/96] Little correction --- htdocs/comm/propal/class/propal.class.php | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index aa1a59e025a..25ed1acb27e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2759,22 +2759,23 @@ class Propal extends CommonObject $label .= '
    '.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); } - $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; - if ($option == '') { - $link = '
    '; } + $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; + if ($option == '') { + $link = ''; + $picto='propal'; From 24c12df356a83fcb1bc44c72edac1533d4e49e10 Mon Sep 17 00:00:00 2001 From: philazerty Date: Wed, 9 Nov 2016 12:16:41 +0100 Subject: [PATCH 66/96] Update companies.lang Ajout du Gabon --- htdocs/langs/fr_FR/companies.lang | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 21c8e740334..e246848c9d8 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -184,6 +184,12 @@ ProfId3FR=Id. prof. 3 (NAF-APE) ProfId4FR=Id. prof. 4 (RCS/RM) ProfId5FR=- ProfId6FR=- +ProfId1GA=Id. prof. 1 (NIF) +ProfId2GA=Id. prof. 2 (RCCM) +ProfId3GA=Id. prof. 3 (CAE) +ProfId4GA=Id. prof. 4 +ProfId5GA=- +ProfId6GA=- ProfId1GB=Numéro d'enregistrement ProfId2GB=- ProfId3GB=SIC From bc6d655cfb110555fa33a25c157deb5ae3462f7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Nov 2016 16:11:02 +0100 Subject: [PATCH 67/96] Uniformize code --- htdocs/contrat/services.php | 66 ++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 8e37e392603..dc4d229dc6e 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -50,6 +50,7 @@ $search_contract=GETPOST("search_contract"); $search_service=GETPOST("search_service"); $search_status=GETPOST("search_status","alpha"); $statut=GETPOST('statut')?GETPOST('statut'):1; +$search_product_category=GETPOST('search_product_category','int'); $socid=GETPOST('socid','int'); $opouvertureprevuemonth=GETPOST('opouvertureprevuemonth'); @@ -99,6 +100,9 @@ $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); $companystatic=new Societe($db); +$arrayfields=array(); + + /* * Actions */ @@ -153,8 +157,10 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; $sql.= " ".MAIN_DB_PREFIX."contratdet as cd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; +if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product'; $sql.= " WHERE c.entity = ".$conf->entity; $sql.= " AND c.rowid = cd.fk_contrat"; +if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; $sql.= " AND c.fk_soc = s.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($mode == "0") $sql.= " AND cd.statut = 0"; @@ -206,17 +212,67 @@ if ($resql) if ($filter_date2 != '') $param.='&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year; if ($filter_datecloture != '') $param.='&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year; + // List of mass actions available + $arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + //if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); + //if ($massaction == 'presend') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + print '
    '; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $title=$langs->trans("ListOfServices"); if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use == "0" if ($mode == "4" && $filter != "expired") $title=$langs->trans("ListOfRunningServices"); if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices"); if ($mode == "5") $title=$langs->trans("ListOfClosedServices"); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png'); - - print ''; - print ''; - print ''; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit); + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + + $morefilter = ''; + + // If the user can view categories of products + if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) + { + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter.='
    '; + $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); + $moreforfilter.='
    '; + } + + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; + else $moreforfilter = $hookmanager->resPrint; + + + if (! empty($moreforfilter)) + { + print '
    '; + print $moreforfilter; + print '
    '; + } + + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + + print '
    '."\n"; + print ''; print_liste_field_titre($langs->trans("Contract"),$_SERVER["PHP_SELF"], "c.rowid",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Service"),$_SERVER["PHP_SELF"], "p.description",$param,"","",$sortfield,$sortorder); From ff4eddb8dc53ff16a62f53b6a7a4ed1aac2dd4fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Nov 2016 17:37:58 +0100 Subject: [PATCH 68/96] Fix warning on project late --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 692b3038909..6e7ccc26dd5 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -574,7 +574,7 @@ if ($resql) $projectstatic->user_author_id = $obj->fk_user_creat; $projectstatic->public = $obj->public; $projectstatic->ref = $obj->ref; - $projectstatic->datee = $obj->date_end; + $projectstatic->datee = $db->jdate($obj->date_end); $projectstatic->statut = $obj->fk_statut; $projectstatic->opp_status = $obj->fk_opp_status; From 71a573df619d1e5736d18b4f81951286e1beb81f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Nov 2016 17:46:30 +0100 Subject: [PATCH 69/96] FIX Pb in management of date end of projects --- htdocs/projet/card.php | 1 + htdocs/projet/class/project.class.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 633633aad7f..adc55131a10 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -785,6 +785,7 @@ else // Date end print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 38135a898e0..1de78f46021 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -237,7 +237,15 @@ class Project extends CommonObject $this->description = trim($this->description); if ($this->opp_amount < 0) $this->opp_amount=''; if ($this->opp_percent < 0) $this->opp_percent=''; - + if ($this->date_end && $this->date_end < $this->date_start) + { + $this->error = $langs->trans("ErrorDateEndLowerThanDateStart"); + $this->errors[] = $this->error; + $this->db->rollback(); + dol_syslog(get_class($this)."::update error -3 " . $this->error, LOG_ERR); + return -3; + } + if (dol_strlen(trim($this->ref)) > 0) { $this->db->begin(); @@ -1721,11 +1729,11 @@ class Project extends CommonObject global $conf; if (! ($this->statut == 1)) return false; - if (! $this->datee) return false; + if (! $this->datee && ! $this->date_end) return false; $now = dol_now(); - return $this->datee < ($now - $conf->projet->warning_delay); + return ($this->datee ? $this->datee : $this->date_end) < ($now - $conf->projet->warning_delay); } From 9fd5ddf807604f699da73a27dcf0bdc5b7725a56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Nov 2016 22:54:51 +0100 Subject: [PATCH 70/96] NEW Add REST API for projects --- htdocs/api/class/api.class.php | 6 +- htdocs/api/index.php | 12 +- htdocs/commande/class/api_orders.class.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- htdocs/projet/class/api_projects.class.php | 568 +++++++++++++++++++++ htdocs/projet/class/project.class.php | 33 +- htdocs/projet/class/task.class.php | 11 +- 7 files changed, 615 insertions(+), 19 deletions(-) create mode 100644 htdocs/projet/class/api_projects.class.php diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 45f2be3e4da..e3081d10400 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -23,8 +23,7 @@ use Luracast\Restler\Defaults; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; /** - * Class for API - * + * Class for API REST v1 */ class DolibarrApi { @@ -55,6 +54,8 @@ class DolibarrApi $this->db = $db; $production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true ); $this->r = new Restler($production_mode); + + $this->r->setAPIVersion(1); } /** @@ -97,6 +98,7 @@ class DolibarrApi unset($object->statuts); unset($object->statuts_short); unset($object->statuts_logo); + unset($object->statuts_long); // Remove the $oldcopy property because it is not supported by the JSON // encoder. The following error is generated when trying to serialize diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 80cfb5485df..7fe3e6437ac 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -106,7 +106,10 @@ foreach ($modulesdir as $dir) elseif ($module == 'facture') { $moduledirforclass = 'compta/facture'; } - + elseif ($module == 'project') { + $moduledirforclass = 'projet'; + } + // Defined if module is enabled $enabled=true; if (empty($conf->$moduleforperm->enabled)) $enabled=false; @@ -135,7 +138,7 @@ foreach ($modulesdir as $dir) require_once $dir_part.$file_searched; if (class_exists($classname)) { - dol_syslog("Found deprecated API classname=".$classname." into ".$dir); + dol_syslog("Found deprecated API by index.php classname=".$classname." into ".$dir); $api->r->addAPIClass($classname, '/'); } } @@ -145,7 +148,7 @@ foreach ($modulesdir as $dir) require_once $dir_part.$file_searched; if (class_exists($classname)) { - dol_syslog("Found API classname=".$classname." into ".$dir); + dol_syslog("Found API by index.php classname=".$classname." into ".$dir); $listofapis[] = $classname; } } @@ -161,13 +164,14 @@ foreach ($modulesdir as $dir) // shows the classes in the order they are added and it's a mess if they are // not sorted. sort($listofapis); +//var_dump($listofapis); foreach ($listofapis as $classname) { $api->r->addAPIClass($classname); } // TODO If not found, redirect to explorer - +//var_dump($api); // Call API (we suppose we found it) $api->r->handle(); diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index f000e4ce201..c9931ac6f2a 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -371,7 +371,7 @@ class Orders extends DolibarrApi } $request_data = (object) $request_data; $updateRes = $this->commande->deleteline(DolibarrApiAccess::$user,$lineid); - if ($updateRes == 1) { + if ($updateRes > 0) { return $this->get($id); } return false; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 27d86696b82..f57dcfdc69d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1626,7 +1626,7 @@ AddOtherPagesOrServices=Add other pages or services AddModels=Add document or numbering templates AddSubstitutions=Add keys substitutions DetectionNotPossible=Detection not possible -UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and will be checked on each future access) +UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and must be provided on each API call) ListOfAvailableAPIs=List of available APIs activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is missing, so module "%1$s" may not work correclty. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise CommandIsNotInsideAllowedCommands=The command you try to run is not inside list of allowed commands defined into parameter $dolibarr_main_restrict_os_commands into conf.php file. diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php new file mode 100644 index 00000000000..74650407f87 --- /dev/null +++ b/htdocs/projet/class/api_projects.class.php @@ -0,0 +1,568 @@ + + * Copyright (C) 2016 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + use Luracast\Restler\RestException; + + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + +/** + * API class for projects + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ +class Projects extends DolibarrApi +{ + + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + static $FIELDS = array( + 'ref', + 'title' + ); + + /** + * @var Project $project {@type Project} + */ + public $project; + + /** + * Constructor + */ + function __construct() + { + global $db, $conf; + $this->db = $db; + $this->project = new Project($this->db); + } + + /** + * Get properties of a project object + * + * Return an array with project informations + * + * @param int $id ID of project + * @return array|mixed data without useless information + * + * @throws RestException + */ + function get($id) + { + if(! DolibarrApiAccess::$user->rights->projet->lire) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $this->project->fetchObjectLinked(); + return $this->_cleanObjectDatas($this->project); + } + + + + /** + * List projects + * + * Get a list of projects + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter projects of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @return array Array of project objects + */ + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') { + global $db, $conf; + + $obj_ret = array(); + // case of external user, $thirdpartyid param is ignored and replaced by user's socid + $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + + // If the internal user must only see his customers, force searching by him + if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id; + + $sql = "SELECT t.rowid"; + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) + $sql.= " FROM ".MAIN_DB_PREFIX."projet as t"; + + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale + + $sql.= ' WHERE t.entity IN ('.getEntity('project', 1).')'; + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; + if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; + if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale + // Insert sale filter + if ($search_sale > 0) + { + $sql .= " AND sc.fk_user = ".$search_sale; + } + // Add sql filters + if ($sqlfilters) + { + if (! DolibarrApi::_checkFilters($sqlfilters)) + { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + + $sql.= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) + { + $page = 0; + } + $offset = $limit * $page; + + $sql.= $db->plimit($limit + 1, $offset); + } + + dol_syslog("API Rest request"); + $result = $db->query($sql); + + if ($result) + { + $num = $db->num_rows($result); + while ($i < min($num, ($limit <= 0 ? $num : $limit))) + { + $obj = $db->fetch_object($result); + $project_static = new Project($db); + if($project_static->fetch($obj->rowid)) { + $obj_ret[] = parent::_cleanObjectDatas($project_static); + } + $i++; + } + } + else { + throw new RestException(503, 'Error when retrieve project list'); + } + if( ! count($obj_ret)) { + throw new RestException(404, 'No project found'); + } + return $obj_ret; + } + + /** + * Create project object + * + * @param array $request_data Request data + * @return int ID of project + */ + function post($request_data = NULL) + { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401, "Insuffisant rights"); + } + // Check mandatory fields + $result = $this->_validate($request_data); + + foreach($request_data as $field => $value) { + $this->project->$field = $value; + } + /*if (isset($request_data["lines"])) { + $lines = array(); + foreach ($request_data["lines"] as $line) { + array_push($lines, (object) $line); + } + $this->project->lines = $lines; + }*/ + if ($this->project->create(DolibarrApiAccess::$user) <= 0) { + $errormsg = $this->project->error; + throw new RestException(500, $errormsg ? $errormsg : "Error while creating project"); + } + + return $this->project->id; + } + + /** + * Get tasks of a project + * + * @param int $id Id of project + * + * @url GET {id}/tasks + * + * @return int + */ + function getLines($id) { + if(! DolibarrApiAccess::$user->rights->projet->lire) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + $this->project->getLinesArray(DolibarrApiAccess::$user); + $result = array(); + foreach ($this->project->lines as $line) { + array_push($result,$this->_cleanObjectDatas($line)); + } + return $result; + } + + + /** + * Get users and roles assigned to a project + * + * @param int $id Id of project + * + * @url GET {id}/roles + * + * @return int + */ + function getRoles($id) { + if(! DolibarrApiAccess::$user->rights->projet->lire) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $taskstatic=new Task($this->db); + $this->project->roles = $taskstatic->getUserRolesForProjectsOrTasks(DolibarrApiAccess::$user, 0, $id, 0); + $result = array(); + foreach ($this->project->roles as $line) { + array_push($result,$this->_cleanObjectDatas($line)); + } + return $result; + } + + + /** + * Add a task to given project + * + * @param int $id Id of project to update + * @param array $request_data Projectline data + * + * @url POST {id}/tasks + * + * @return int + */ + /* + function postLine($id, $request_data = NULL) { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + $request_data = (object) $request_data; + $updateRes = $this->project->addline( + $request_data->desc, + $request_data->subprice, + $request_data->qty, + $request_data->tva_tx, + $request_data->localtax1_tx, + $request_data->localtax2_tx, + $request_data->fk_product, + $request_data->remise_percent, + $request_data->info_bits, + $request_data->fk_remise_except, + 'HT', + 0, + $request_data->date_start, + $request_data->date_end, + $request_data->product_type, + $request_data->rang, + $request_data->special_code, + $fk_parent_line, + $request_data->fk_fournprice, + $request_data->pa_ht, + $request_data->label, + $request_data->array_options, + $request_data->fk_unit, + $this->element, + $request_data->id + ); + + if ($updateRes > 0) { + return $this->get($id)->line->rowid; + + } + return false; + } + */ + + /** + * Update a task to given project + * + * @param int $id Id of project to update + * @param int $lineid Id of line to update + * @param array $request_data Projectline data + * + * @url PUT {id}/tasks/{lineid} + * + * @return object + */ + /* + function putLine($id, $lineid, $request_data = NULL) { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + $request_data = (object) $request_data; + $updateRes = $this->project->updateline( + $lineid, + $request_data->desc, + $request_data->subprice, + $request_data->qty, + $request_data->remise_percent, + $request_data->tva_tx, + $request_data->localtax1_tx, + $request_data->localtax2_tx, + 'HT', + $request_data->info_bits, + $request_data->date_start, + $request_data->date_end, + $request_data->product_type, + $request_data->fk_parent_line, + 0, + $request_data->fk_fournprice, + $request_data->pa_ht, + $request_data->label, + $request_data->special_code, + $request_data->array_options, + $request_data->fk_unit + ); + + if ($updateRes > 0) { + $result = $this->get($id); + unset($result->line); + return $this->_cleanObjectDatas($result); + } + return false; + }*/ + + + /** + * Delete a tasks of given project + * + * + * @param int $id Id of project to update + * @param int $taskid Id of task to delete + * + * @url DELETE {id}/tasks/{taskid} + * + * @return int + */ + function delLine($id, $taskid) { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! ($result > 0) ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $taskstatic=new Task($this->db); + $result = $taskstatic->fetch($taskid); + if( ! ($result > 0) ) { + throw new RestException(404, 'Task not found'); + } + + $deleteRes = $taskstatic->delete(DolibarrApiAccess::$user); + + if( ! ($deleteRes > 0)) { + throw new RestException(500, 'Error when delete tasks : '.$taskstatic->error); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Task deleted' + ) + ); + } + + + /** + * Update project general fields (won't touch lines of project) + * + * @param int $id Id of project to update + * @param array $request_data Datas + * + * @return int + */ + function put($id, $request_data = NULL) { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + foreach($request_data as $field => $value) { + $this->project->$field = $value; + } + + if($this->project->update(DolibarrApiAccess::$user, 0)) + return $this->get($id); + + return false; + } + + /** + * Delete project + * + * @param int $id Project ID + * + * @return array + */ + function delete($id) + { + if(! DolibarrApiAccess::$user->rights->projet->supprimer) { + throw new RestException(401); + } + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + if( ! $this->project->delete(DolibarrApiAccess::$user)) { + throw new RestException(500, 'Error when delete project : '.$this->project->error); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Project deleted' + ) + ); + + } + + /** + * Validate a project + * + * @param int $id Project ID + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * + * @url POST {id}/validate + * + * @return array + * FIXME An error 403 is returned if the request has an empty body. + * Error message: "Forbidden: Content type `text/plain` is not supported." + * Workaround: send this in the body + * { + * "notrigger": 0 + * } + */ + function validate($id, $notrigger=0) + { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $result = $this->project->setValid(DolibarrApiAccess::$user, $notrigger); + if ($result == 0) { + throw new RestException(500, 'Error nothing done. May be object is already validated'); + } + if ($result < 0) { + throw new RestException(500, 'Error when validating Project: '.$this->project->error); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Project validated' + ) + ); + } + + /** + * Validate fields before create or update object + * + * @param array $data Array with data to verify + * @return array + * @throws RestException + */ + function _validate($data) + { + $object = array(); + foreach (self::$FIELDS as $field) { + if (!isset($data[$field])) + throw new RestException(400, "$field field missing"); + $object[$field] = $data[$field]; + + } + return $object; + } + + + // TODO + // getSummaryOfTimeSpent +} diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 4ac568182de..3efb1a4cfcc 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -695,10 +695,11 @@ class Project extends CommonObject /** * Validate a project * - * @param User $user User that validate - * @return int <0 if KO, >0 if OK + * @param User $user User that validate + * @param int $notrigger 1=Disable triggers + * @return int <0 if KO, >0 if OK */ - function setValid($user) + function setValid($user, $notrigger=0) { global $langs, $conf; @@ -725,10 +726,13 @@ class Project extends CommonObject if ($resql) { // Call trigger - $result=$this->call_trigger('PROJECT_VALIDATE',$user); - if ($result < 0) { $error++; } - // End call triggers - + if (empty($notrigger)) + { + $result=$this->call_trigger('PROJECT_VALIDATE',$user); + if ($result < 0) { $error++; } + // End call triggers + } + if (!$error) { $this->statut=1; @@ -1866,5 +1870,20 @@ class Project extends CommonObject return 1; } + + /** + * Create an array of tasks of current project + * + * @param User $user Object user we want project allowed to + * @return int >0 if OK, <0 if KO + */ + function getLinesArray($user) + { + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $taskstatic = new Task($this->db); + + $this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0); + } + } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ad2f5faecbe..2baccfb3382 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -176,7 +176,7 @@ class Task extends CommonObject * * @param int $id Id object * @param int $ref ref object - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0 if not found, >0 if OK */ function fetch($id,$ref='') { @@ -214,7 +214,9 @@ class Task extends CommonObject $resql=$this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql)) + $num_rows = $this->db->num_rows($resql); + + if ($num_rows) { $obj = $this->db->fetch_object($resql); @@ -241,7 +243,8 @@ class Task extends CommonObject $this->db->free($resql); - return 1; + if ($num_rows) return 1; + else return 0; } else { @@ -754,7 +757,7 @@ class Task extends CommonObject * Return list of roles for a user for each projects or each tasks (or a particular project or a particular task). * * @param User $userp Return roles on project for this internal user. If set, usert and taskid must not be defined. - * @param User $usert Return roles on task for this internal user. If set userp must not be defined. + * @param User $usert Return roles on task for this internal user. If set userp must not be defined. -1 means no filter. * @param int $projectid Project id list separated with , to filter on project * @param int $taskid Task id to filter on a task * @param string $filteronprojstatus Filter on project status if userp is set. Not used if userp not defined. From 77eaa635fe3275fbda1bf49699163ce4e5e6d86e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 10 Nov 2016 06:29:11 +0100 Subject: [PATCH 71/96] Align actions buttons --- htdocs/fourn/facture/card.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 923d226a57c..47198891a5a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2623,7 +2623,7 @@ else // Modify a validated invoice with no payments if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer) { - print ''.$langs->trans('Modify').''; + print ''; } // Reopen a standard paid invoice @@ -2631,11 +2631,11 @@ else { if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice { - print ''.$langs->trans('ReOpen').''; + print ''; } else { - print ''.$langs->trans('ReOpen').''; + print '
    '.$langs->trans('ReOpen').'
    '; } } @@ -2644,22 +2644,22 @@ else { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send) { - print ''.$langs->trans('SendByMail').''; + print ''; } - else print ''.$langs->trans('SendByMail').''; + else print '
    '.$langs->trans('SendByMail').'
    '; } // Make payments if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { - print ''.$langs->trans('DoPayment').''; // must use facid because id is for payment id not invoice + print ''; // must use facid because id is for payment id not invoice } // Classify paid if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { - print ''.$langs->trans('ClassifyPaid').''; + print ''; //print ''.$langs->trans('ClassifyPaid').''; } @@ -2672,13 +2672,13 @@ else if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))) { - print ''.$langs->trans('Validate').''; + print ''; } else { - print ''.$langs->trans('Validate').''; + print ''; } } } @@ -2692,7 +2692,7 @@ else // Clone if ($action != 'edit' && $user->rights->fournisseur->facture->creer) { - print 'socid.'">'.$langs->trans('ToClone').''; + print ''; } // Create a credit note @@ -2710,7 +2710,7 @@ else if ($object->getSommePaiement()) { print ''; } else { - print ''.$langs->trans('Delete').''; + print ''; } } print ''; From f3da39c0a76184affa2312ec6b5e1708842c43a4 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 10 Nov 2016 06:51:15 +0100 Subject: [PATCH 72/96] Add buttons to convert to reduction or money back --- htdocs/fourn/facture/card.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 47198891a5a..ecad08da51a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2650,7 +2650,7 @@ else } // Make payments - if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) + if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { print ''; // must use facid because id is for payment id not invoice } @@ -2664,6 +2664,32 @@ else //print ''.$langs->trans('ClassifyPaid').''; } + // Reverse back money or convert to reduction + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT) { + // For credit note only + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0) + { + if ($resteapayer == 0) + { + print '
    '.$langs->trans('DoPaymentBack').'
    '; + } + else + { + print ''; + } + } + + // For credit note + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() == 0) { + print ''; + } + // For deposit invoice + if ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->paye == 1 && $resteapayer == 0 && $user->rights->fournisseur->facture->creer && empty($discount->id)) + { + print ''; + } + } + // Validate if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT) { From 9daac25519420e0ece7e2e19944a1cc4de58f933 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 10 Nov 2016 08:31:08 +0100 Subject: [PATCH 73/96] Fix translation for CRON --- htdocs/compta/facture/fiche-rec.php | 165 ++++++++++++++-------------- 1 file changed, 83 insertions(+), 82 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 10e542acf1d..c7bf362ab7d 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load('bills'); $langs->load('compta'); +$langs->load('admin'); // Security check $id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int')); @@ -148,14 +149,14 @@ if ($action == 'add') $remin=GETPOST('remin'); $nb_gen_max=GETPOST('nb_gen_max', 'int'); //if (empty($nb_gen_max)) $nb_gen_max =0; - + if (GETPOST('frequency')) { - if (empty($reyear) || empty($remonth) || empty($reday)) + if (empty($reyear) || empty($remonth) || empty($reday)) { setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("Date")), null, 'errors'); $action = "create"; - $error++; + $error++; } if ($nb_gen_max === '') { @@ -171,14 +172,14 @@ if ($action == 'add') $object->note_private = GETPOST('note_private'); $object->note_public = GETPOST('note_public'); $object->usenewprice = GETPOST('usenewprice'); - + $object->frequency = $frequency; $object->unit_frequency = GETPOST('unit_frequency', 'alpha'); $object->nb_gen_max = $nb_gen_max; $object->auto_validate = GETPOST('auto_validate', 'int'); - + $object->fk_project = $projectid; - + $date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear); $object->date_when = $date_next_execution; @@ -187,9 +188,9 @@ if ($action == 'add') { $srcObject = new Facture($db); $srcObject->fetch(GETPOST('facid','int')); - + $srcObject->fetchObjectLinked(); - + if (! empty($srcObject->linkedObjectsIds['contrat'])) { $contractidid = reset($srcObject->linkedObjectsIds['contrat']); @@ -199,12 +200,12 @@ if ($action == 'add') $object->linked_objects[$object->origin] = $object->origin_id; } } - + $db->begin(); $oldinvoice = new Facture($db); $oldinvoice->fetch($id); - + $result = $object->create($user, $oldinvoice->id); if ($result > 0) { @@ -222,18 +223,18 @@ if ($action == 'add') setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; } - + if (! $error) { $db->commit(); - + header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); exit; } else { $db->rollback(); - + $error++; setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -311,16 +312,16 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->factu $object->fetch_thirdparty(); $db->begin(); - + $line=new FactureLigneRec($db); - + // For triggers $line->id = $lineid; - + if ($line->delete() > 0) { $result=$object->update_price(1); - + if ($result > 0) { $db->commit(); @@ -401,7 +402,7 @@ if ($action == 'addline' && $user->rights->facture->creer) setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); $error ++; } - + if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) { $ret = $object->fetch($id); if ($ret < 0) { @@ -435,7 +436,7 @@ if ($action == 'addline' && $user->rights->facture->creer) $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id); $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id); if (empty($tva_tx)) $tva_npr=0; - + $pu_ht = $prod->price; $pu_ttc = $prod->price_ttc; $price_min = $prod->price_min; @@ -542,7 +543,7 @@ if ($action == 'addline' && $user->rights->facture->creer) $type = GETPOST('type'); $fk_unit= GETPOST('units', 'alpha'); } - + // Margin $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value @@ -550,7 +551,7 @@ if ($action == 'addline' && $user->rights->facture->creer) // Local Taxes $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr); $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr); - + $info_bits = 0; if ($tva_npr) $info_bits |= 0x01; @@ -582,7 +583,7 @@ if ($action == 'addline' && $user->rights->facture->creer) if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); }*/ $object->fetch($object->id); // Reload lines - + unset($_POST['prod_entry_mode']); unset($_POST['qty']); @@ -745,7 +746,7 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST(' }*/ $object->fetch($object->id); // Reload lines - + unset($_POST['qty']); unset($_POST['type']); unset($_POST['productid']); @@ -820,7 +821,7 @@ $companystatic = new Societe($db); $now = dol_now(); $tmparray=dol_getdate($now); $today = dol_mktime(23,59,59,$tmparray['mon'],$tmparray['mday'],$tmparray['year']); // Today is last second of current day - + /* * Create mode @@ -832,11 +833,11 @@ if ($action == 'create') $object = new Facture($db); // Source invoice $product_static = new Product($db); $formproject = new FormProjets($db); - + if ($object->fetch($id, $ref) > 0) { $result = $object->getLinesArray(); - + print ''; print ''; print ''; @@ -870,7 +871,7 @@ if ($action == 'create') print '
    '; - + // Author print ""; @@ -894,7 +895,7 @@ if ($action == 'create') print '   id).'">' . $langs->trans("AddProject") . ''; print ''; } - + // Bank account if ($object->fk_account > 0) { @@ -907,24 +908,24 @@ if ($action == 'create') print '

    '; - + // Autogeneration $title = $langs->trans("Recurrence"); print load_fiche_titre($title, '', 'calendar'); - + print '
    '.$langs->trans("DateEnd").''; print dol_print_date($object->date_end,'day'); + if ($object->hasDelay()) print img_warning($langs->trans('Late')); print '
    '.$langs->trans("NotePrivate").''; print ''; print '
    ".$langs->trans("Author")."".$user->getFullName($langs)."
    '; - + // Frequency print '"; - + // First date of execution for cron print ""; - + // Number max of generation print "
    '.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')).""; print " ".$form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m')); print "
    ".$langs->trans('NextDateToExecution').""; $date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); print $form->select_date($date_next_execution, '', 1, 1, '', "add", 1, 1, 1); print "
    ".$langs->trans("MaxPeriodNumber").""; print ''; @@ -960,9 +961,9 @@ if ($action == 'create') $disableremove=1; $ret = $object->printObjectLines('', $mysoc, $soc, $lineid, 0); // No date selector for template invoice } - + print "
    \n"; - + print ''; if ($flag_price_may_change) @@ -1004,10 +1005,10 @@ else } print $formconfirm; - + $author = new User($db); $author->fetch($object->user_author); - + $head=array(); $h=0; $head[$h][0] = $_SERVER["PHP_SELF"].'?id='.$object->id; @@ -1029,8 +1030,8 @@ else $morehtmlref = $form->editfieldval($langs->trans("Ref"), 'ref', $object->ref, $object, $user->rights->facture->creer, 'string'); print $form->showrefnav($object, 'ref', $linkback, 1, 'titre', 'none', $morehtmlref); print ''; - - + + print ''.$langs->trans("Customer").''; print ''.$object->thirdparty->getNomUrl(1,'customer').''; @@ -1092,7 +1093,7 @@ else print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':60'); print ''; print ''; - + // Note private print ''; print $form->editfieldkey($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer); @@ -1100,13 +1101,13 @@ else print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':60'); print ''; print ''; - + // Project if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''; print ''; - + print ''; @@ -1116,7 +1117,7 @@ else print ''; } print '
    '; print $langs->trans('Project'); print '
    '; - + print ''; if ($action == 'classify') { $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); @@ -1156,7 +1157,7 @@ else */ $title = $langs->trans("Recurrence"); print load_fiche_titre($title, '', 'calendar'); - + print ''; // if "frequency" is empty or = 0, the reccurence is disabled @@ -1180,7 +1181,7 @@ else print ''; print '
    '; } - else + else { if ($object->frequency > 0) { @@ -1192,7 +1193,7 @@ else } } print ''; - + // Date when print ''; if ($action == 'date_when' || $object->frequency > 0) @@ -1210,7 +1211,7 @@ else } print ''; print ''; - + // Max period / Rest period print ''; if ($action == 'nb_gen_max' || $object->frequency > 0) @@ -1232,7 +1233,7 @@ else } print ''; print ''; - + // Status of generated invoices print ''; if ($action == 'auto_validate' || $object->frequency > 0) @@ -1247,28 +1248,28 @@ else } print ''; print ''; - + print ''; - + print '
    '; - + // Frequencry/Recurring section if ($object->frequency > 0) { if (empty($conf->cron->enabled)) { - print info_admin($langs->trans("EnableAndSetupModuleCron", $langs->transnoentitiesnoconv("Module2300Name"))); + print info_admin($langs->trans("EnableAndSetupModuleCron", $langs->transnoentitiesnoconv("Module2300Name"))); } - + print ''; - + // Nb of generation already done print ''; print ''; print ''; - + // Date last print ''; print ''; - + print '
    '.$langs->trans("NbOfGenerationDone").''; print $object->nb_gen_done?$object->nb_gen_done:'0'; print '
    '; print $langs->trans("DateLastGeneration"); @@ -1276,12 +1277,12 @@ else print dol_print_date($object->date_last_gen, 'dayhour'); print '
    '; - + print '
    '; - } - + } + // Lines print '
    @@ -1289,11 +1290,11 @@ else '; - + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } - + print ''; // Show object lines if (! empty($object->lines)) @@ -1302,28 +1303,28 @@ else //$disablemove=1; $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 0); // No date selector for template invoice } - + // Form to add new line if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline') { if ($action != 'editline') { $var = true; - + // Add free products/services - $object->formAddObjectLine(0, $mysoc, $soc); // No date selector for template invoice - + $object->formAddObjectLine(0, $mysoc, $soc); // No date selector for template invoice + $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } } - + print "
    \n"; - + print "
    \n"; dol_fiche_end(); - + /** * Barre d'actions @@ -1363,15 +1364,15 @@ else } print '
    '; - - + + print '
    '; print ''; // ancre - + // Linked object block $somethingshown = $form->showLinkedObjectBlock($object); - + print '
    '; } @@ -1416,7 +1417,7 @@ else else if ($year_date_when > 0) { $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($year_date_when,12,false))."'"; - } + } $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -1424,15 +1425,15 @@ else $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } - + $sql.= $db->order($sortfield, $sortorder); $sql.= $db->plimit($limit+1,$offset); - + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - + $param='&socid='.$socid; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -1457,9 +1458,9 @@ else $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + $massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); - + print '
    '."\n"; if ($optioncss != '') print ''; print ''; @@ -1486,7 +1487,7 @@ else print_liste_field_titre(''); // Field may contains ling text print "\n"; - + // Filters lines print ''; // Ref @@ -1592,8 +1593,8 @@ else print $searchpitco; print ''; print "\n"; - - + + if ($num > 0) { $var=true; @@ -1617,7 +1618,7 @@ else print ''.yn($objp->frequency?1:0).''; print ''.($objp->frequency ? dol_print_date($objp->date_last_gen,'day') : '').''; print ''.($objp->frequency ? dol_print_date($objp->date_when,'day') : '').''; - + print ''; if ($user->rights->facture->creer) { From cc64994f300831137e487df4ac08a2dea4ffda1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Nov 2016 11:33:25 +0100 Subject: [PATCH 74/96] Better responsive design --- htdocs/core/class/html.form.class.php | 21 +++++----- htdocs/core/lib/functions.lib.php | 58 +++++++++++++-------------- htdocs/core/tpl/contacts.tpl.php | 7 ++-- htdocs/core/tpl/notes.tpl.php | 8 ++-- htdocs/projet/card.php | 4 +- htdocs/theme/eldy/style.css.php | 20 +++++---- htdocs/theme/md/style.css.php | 41 +++++++++++++++---- 7 files changed, 95 insertions(+), 64 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8a6c97e794c..8ca311af082 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -211,9 +211,10 @@ class Form if (empty($notabletag)) $ret.=''; if (empty($notabletag)) $ret.=''; - $ret.=''; - if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='
    '."\n"; - $ret.=''; + else $ret.='
    '; + $ret.=''; + if (preg_match('/ckeditor|textarea/',$typeofdata) && empty($notabletag)) $ret.='
    '."\n"; + $ret.=''; if (empty($notabletag)) $ret.=''; if (empty($notabletag)) $ret.=''."\n"; @@ -4485,7 +4486,7 @@ class Form if ($usecalendar == "eldy") { // Zone de saisie manuelle de la date - $retstring.='trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript $retstring.='>'; @@ -4513,7 +4514,7 @@ class Form { //$retstring.='
    '; // Day - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { @@ -4527,7 +4528,7 @@ class Form $retstring.=""; - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { $retstring.=''; @@ -4545,11 +4546,11 @@ class Form // Year if ($emptydate || $set_time == -1) { - $retstring.=''; + $retstring.=''; } else { - $retstring.=''; + $retstring.=''; for ($year = $syear - 5; $year < $syear + 10 ; $year++) { @@ -4566,7 +4567,7 @@ class Form if ($h) { // Show hour - $retstring.=''; + $retstring.=''; if ($emptyhours) $retstring.=''; for ($hour = 0; $hour < 24; $hour++) { @@ -4580,7 +4581,7 @@ class Form if ($m) { // Show minutes - $retstring.=''; + $retstring.=''; if ($emptyhours) $retstring.=''; for ($min = 0; $min < 60 ; $min++) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b1a9c0b2735..d102e264913 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2241,14 +2241,14 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) - * @param string $options Add more attribute on img tag (For example 'style="float: right"') + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @param int $pictoisfullpath If 1, image path is a full path * @param int $srconly Return only content of the src attribute of img. * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @return string Return img tag * @see #img_object, #img_picto_common */ -function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0) +function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $srconly=0, $notitle=0) { global $conf; @@ -2300,7 +2300,7 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $ if (preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB $title=$tmparray[0]; $alt=empty($tmparray[1])?'':$tmparray[1]; - return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup + return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } } @@ -2310,16 +2310,16 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $ * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...) * For external modules use imagename@mymodule to search into directory "img" of module. - * @param string $options Add more attribute on img tag (ie: class="datecallink") + * @param string $morealt Add more attribute on img tag (ie: class="datecallink") * @param int $pictoisfullpath If 1, image path is a full path * @param int $srconly Return only content of the src attribute of img. * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @return string Return img tag * @see #img_picto, #img_picto_common */ -function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0) +function img_object($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $srconly=0, $notitle=0) { - return img_picto($titlealt, 'object_'.$picto, $options, $pictoisfullpath, $srconly, $notitle); + return img_picto($titlealt, 'object_'.$picto, $morealt, $pictoisfullpath, $srconly, $notitle); } /** @@ -2327,12 +2327,12 @@ function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false, * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. - * @param string $options Add more attribute on img tag + * @param string $morealt Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path * @return string Return img tag * @see #img_object, #img_picto */ -function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0) +function img_weather($titlealt, $picto, $morealt = '', $pictoisfullpath = 0) { global $conf; @@ -2340,7 +2340,7 @@ function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0) $path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto; - return img_picto($titlealt, $path, $options, 1); + return img_picto($titlealt, $path, $morealt, 1); } /** @@ -2348,12 +2348,12 @@ function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0) * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. - * @param string $options Add more attribute on img tag + * @param string $morealt Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path * @return string Return img tag * @see #img_object, #img_picto */ -function img_picto_common($titlealt, $picto, $options = '', $pictoisfullpath = 0) +function img_picto_common($titlealt, $picto, $morealt = '', $pictoisfullpath = 0) { global $conf; @@ -2372,7 +2372,7 @@ function img_picto_common($titlealt, $picto, $options = '', $pictoisfullpath = 0 } } - return img_picto($titlealt, $path, $options, 1); + return img_picto($titlealt, $path, $morealt, 1); } /** @@ -2478,9 +2478,9 @@ function img_view($titlealt = 'default', $float = 0, $other = '') if ($titlealt == 'default') $titlealt = $langs->trans('View'); - $options = ($float ? 'style="float: right" ' : '').$other; + $morealt = ($float ? 'style="float: right" ' : '').$other; - return img_picto($titlealt, 'view.png', $options); + return img_picto($titlealt, 'view.png', $morealt); } /** @@ -2552,16 +2552,16 @@ function img_info($titlealt = 'default') * Show warning logo * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @param string $options Add more attribute on img tag (For example 'style="float: right"'). If 1 + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"'). If 1 * @return string Return img tag */ -function img_warning($titlealt = 'default', $options = '') +function img_warning($titlealt = 'default', $morealt = '') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Warning'); - return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($options ? ($options == '1' ? ' style="float: right"' : ' '.$options): '')); + return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($morealt ? ($morealt == '1' ? ' style="float: right"' : ' '.$morealt): '')); } /** @@ -2583,32 +2583,32 @@ function img_error($titlealt = 'default') * Show next logo * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. -* @param string $options Add more attribute on img tag (For example 'style="float: right"') +* @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_next($titlealt = 'default', $options='') +function img_next($titlealt = 'default', $morealt='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Next'); - return img_picto($titlealt, 'next.png', $options); + return img_picto($titlealt, 'next.png', $morealt); } /** * Show previous logo * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @param string $options Add more attribute on img tag (For example 'style="float: right"') + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_previous($titlealt = 'default', $options='') +function img_previous($titlealt = 'default', $morealt='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Previous'); - return img_picto($titlealt, 'previous.png', $options); + return img_picto($titlealt, 'previous.png', $morealt); } /** @@ -2650,16 +2650,16 @@ function img_up($titlealt = 'default', $selected = 0, $moreclass='') * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected - * @param string $options Add more attribute on img tag (For example 'style="float: right"') + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_left($titlealt = 'default', $selected = 0, $options='') +function img_left($titlealt = 'default', $selected = 0, $morealt='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Left'); - return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $options); + return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $morealt); } /** @@ -2667,16 +2667,16 @@ function img_left($titlealt = 'default', $selected = 0, $options='') * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected - * @param string $options Add more attribute on img tag (For example 'style="float: right"') + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_right($titlealt = 'default', $selected = 0, $options='') +function img_right($titlealt = 'default', $selected = 0, $morealt='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Right'); - return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $options); + return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $morealt); } /** diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 28a02fcd38a..845bc30ce13 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -110,11 +110,10 @@ if ($permission) {
    socid; ?> dol_use_jmobile)) + // add company icon before select list + if ($selectedCompany) { - $companystatic->fetch($selectedCompany); - echo $companystatic->getNomUrl(2, '', 0, 1); + echo img_object('', 'company', 'class="hideonsmartphone"'); } ?> selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0); ?> diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index bc7cf44ce66..f0e69b01b81 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -72,14 +72,14 @@ else $typeofdata='textarea:12:100';
    -
    >editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?>
    -
    editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
    +
    >editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); ?>
    +
    editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?>
    societe_id)) { ?>
    -
    >editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?>
    -
    editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
    +
    >editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); ?>
    +
    editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?>
    diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index f4c5d871fc6..5d8674eb261 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -698,7 +698,7 @@ else // Label print ''.$langs->trans("Label").''; - print ''; + print ''; // Thirdparty if ($conf->societe->enabled) @@ -752,7 +752,7 @@ else // Date start print ''.$langs->trans("DateStart").''; print $form->select_date($object->date_start?$object->date_start:-1,'projectstart',0,0,0,'',1,0,1); - print '     '. $langs->trans("ProjectReportDate"); print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f1368099864..a2471cd8aa8 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -542,7 +542,7 @@ div.myavailability { margin-top: 6px; margin-left: 4px; } -.selectlimit { +.selectlimit, .marginrightonly { margin-right: 10px !important; } .strikefordisabled { @@ -622,6 +622,7 @@ div.myavailability { .minwidth500imp { min-width: 500px !important; } } .maxwidth50 { max-width: 50px; } +.maxwidth75 { max-width: 75px; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } @@ -665,12 +666,18 @@ div.myavailability { div.titre { line-height: 2em; } + .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { + height: 40px !important; + } - input[type=text], select, textarea { + .quatrevingtpercent, .inputsearch { + width: 95%; + } + + input, input[type=text], input[type=password], select, textarea { min-width: 20px; min-height: 1.4em; line-height: 1.4em; - margin: .5em 0; padding: .4em .1em; border: 1px solid #BBB; } @@ -679,6 +686,7 @@ div.myavailability { .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } .maxwidth50onsmartphone { max-width: 50px; } + .maxwidth75onsmartphone { max-width: 75px; } .maxwidth100onsmartphone { max-width: 100px; } .maxwidth150onsmartphone { max-width: 150px; } .maxwidth200onsmartphone { max-width: 200px; } @@ -699,7 +707,6 @@ div.myavailability { } select { width: 98%; - dol_use_jmobile)) { ?>max-width: 100px; min-width: 40px; } div.divphotoref { @@ -2357,10 +2364,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord table.borderplus { border: 1px solid #BBB; } -.border tbody tr, .border tbody tr td { - height: 20px; -} -div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { +.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { height: 20px; } div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9935c3b2231..de92d29361b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -549,7 +549,7 @@ div.myavailability { margin-top: 6px; margin-left: 4px; } -.selectlimit { +.selectlimit, .marginrightonly { margin-right: 10px !important; } .strikefordisabled { @@ -627,6 +627,7 @@ div.myavailability { .minwidth500imp { min-width: 500px !important; } } .maxwidth50 { max-width: 50px; } +.maxwidth75 { max-width: 75px; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } @@ -670,12 +671,18 @@ div.myavailability { div.titre { line-height: 2em; } + .border tbody tr, .border tbody tr td, div.tabBar table.border tr { + height: 40px !important; + } - input[type=text], select, textarea { + .quatrevingtpercent, .inputsearch { + width: 95%; + } + + input, input[type=text], input[type=password], select, textarea { min-width: 20px; min-height: 1.4em; line-height: 1.4em; - margin: .5em 0; padding: .4em .1em; border: 1px solid #BBB; } @@ -684,6 +691,7 @@ div.myavailability { .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } .maxwidth50onsmartphone { max-width: 50px; } + .maxwidth75onsmartphone { max-width: 75px; } .maxwidth100onsmartphone { max-width: 100px; } .maxwidth150onsmartphone { max-width: 150px; } .maxwidth200onsmartphone { max-width: 200px; } @@ -697,6 +705,28 @@ div.myavailability { .minwidth500imp { min-width: 50px !important; } .titlefield { width: auto; } .titlefieldcreate { width: auto; } + + #tooltip { + position: absolute; + width: px; + } + select { + width: 98%; + min-width: 40px; + } + div.divphotoref { + padding-right: 5px; + } + img.photoref, div.photoref { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + padding: 4px; + height: 20px; + width: 20px; + object-fit: contain; + } } .linkobject { cursor: pointer; } @@ -2245,10 +2275,7 @@ table.borderplus { border: 1px solid #BBB; } -.border tbody tr, .border tbody tr td { - height: 20px; -} -div.tabBar table.border tr { +.border tbody tr, .border tbody tr td, div.tabBar table.border tr { height: 20px; } From c2ce5c4eeb3da051c1892371df34ddba0ceccd72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Nov 2016 11:54:02 +0100 Subject: [PATCH 75/96] FIX False positive on services not activated --- htdocs/contrat/services.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 8e37e392603..577e850b2f4 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -308,11 +308,16 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $var=!$var; - print ""; - print ''; + $contractstatic->id=$obj->cid; $contractstatic->ref=$obj->ref?$obj->ref:$obj->cid; + + $var=!$var; + + print ""; + + // Ref + print ''; print $contractstatic->getNomUrl(1,16); print ''; @@ -348,7 +353,7 @@ if ($resql) { print ''; print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' '); - if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay))) + if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)) && $obj->statut == 0) print ' '.img_picto($langs->trans("Late"),"warning"); else print '    '; print ''; @@ -357,7 +362,7 @@ if ($resql) { print ''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').''; } - // Date fin + // End date if (($mode == "" || $mode == -1) || $mode < 5) { print ''.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' '); From fe9c880984c4c4c63c4f659c972d772e1278e0a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Nov 2016 14:24:29 +0100 Subject: [PATCH 76/96] NEW Add missing unique key on table llx_links --- htdocs/core/class/html.form.class.php | 9 +++++++- htdocs/core/class/html.formfile.class.php | 13 ++++++----- htdocs/core/tpl/notes.tpl.php | 4 ++-- .../install/mysql/migration/4.0.0-5.0.0.sql | 14 ++++++++++++ htdocs/install/mysql/migration/repair.sql | 12 +++++++++- htdocs/install/mysql/tables/llx_links.key.sql | 22 +++++++++++++++++++ 6 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 htdocs/install/mysql/tables/llx_links.key.sql diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8ca311af082..62bd4cde742 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -181,7 +181,14 @@ class Form else if (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) { $tmp=explode(':',$typeofdata); - $ret.=''; + $cols=$tmp[2]; + $morealt=''; + if (preg_match('/%/',$cols)) + { + $morealt=' style="width: '.$cols.'"'; + $cols=''; + } + $ret.=''; } else if ($typeofdata == 'day' || $typeofdata == 'datepicker') { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a05d8b27c5e..d79eaae65f0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -62,7 +62,7 @@ class FormFile * @param int $addcancel 1=Add 'Cancel' button * @param int $sectionid If upload must be done inside a particular ECM section * @param int $perm Value of permission to allow upload - * @param int $size Length of input file area + * @param int $size Length of input file area. Deprecated. * @param Object $object Object to use (when attachment is done on an element) * @param string $options Add an option column * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. @@ -106,7 +106,7 @@ class FormFile if (! empty($options)) $out .= ''.$options.''; - $out .= ''; + $out .= ''; $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $maxphp=@ini_get('upload_max_filesize'); // En inconnu @@ -121,10 +121,10 @@ class FormFile { $out .= ''; } - $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; - $out .= ' '; + $out .= ' '; $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; @@ -183,11 +183,11 @@ class FormFile $out .= '
    '; $out .= '
    '; if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= ' '; - $out .= ''; + $out .= ''; $out .= '
    '; $out .= '
    '; if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= ' '; - $out .= ''; + $out .= ''; $out .= ''; $out .= ''; $out .= '
    '; @@ -1451,6 +1451,7 @@ class FormFile else { print ''; + print img_picto('', 'object_globe').' '; print ''; print $link->label; print ''; diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index f0e69b01b81..c971a49148f 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -63,8 +63,8 @@ elseif ($module == 'shipping') { $permission=$user->rights->expedition->cr elseif ($module == 'product') { $permission=$user->rights->produit->creer;} //else dol_print_error('','Bad value '.$module.' for param module'); -if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:100'; // Rem: This var is for all notes, not only thirdparties note. -else $typeofdata='textarea:12:100'; +if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%'; // Rem: This var is for all notes, not only thirdparties note. +else $typeofdata='textarea:12:95%'; ?> diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index 1e0f92a1cac..faffe9e53f5 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -202,3 +202,17 @@ create table llx_user_employment )ENGINE=innodb; + + +-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate. +drop table tmp_links_double; +--select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2; +create table tmp_links_double as (select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2); +--select * from tmp_links_double; +delete from llx_links where (rowid, label) in (select max_rowid, label from tmp_links_double); --update to avoid duplicate, delete to delete +drop table tmp_links_double; + +ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label); + + + diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 99e4a7c556c..3ba06daabce 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -176,6 +176,7 @@ update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; update llx_opensurvey_sondage set tms = now(); + -- ALTER TABLE llx_facture_fourn ALTER COLUMN fk_cond_reglement DROP NOT NULL; @@ -183,12 +184,21 @@ update llx_product set barcode = null where barcode in ('', '-1', '0'); update llx_societe set barcode = null where barcode in ('', '-1', '0'); +-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate. +drop table tmp_links_double; +--select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2; +create table tmp_links_double as (select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2); +--select * from tmp_links_double; +delete from llx_links where (rowid, label) in (select max_rowid, label from tmp_links_double); --update to avoid duplicate, delete to delete +drop table tmp_links_double; + + -- Sequence to removed duplicated values of barcode in llx_product. Use serveral times if you still have duplicate. drop table tmp_product_double; --select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_product where barcode is not null group by barcode having count(rowid) >= 2; create table tmp_product_double as (select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_product where barcode is not null group by barcode having count(rowid) >= 2); --select * from tmp_product_double; -update llx_product set barcode = null where (rowid, barcode) in (select max_rowid, barcode from tmp_product_double); +update llx_product set barcode = null where (rowid, barcode) in (select max_rowid, barcode from tmp_product_double); --update to avoid duplicate, delete to delete drop table tmp_product_double; diff --git a/htdocs/install/mysql/tables/llx_links.key.sql b/htdocs/install/mysql/tables/llx_links.key.sql new file mode 100644 index 00000000000..7ba509e9d58 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_links.key.sql @@ -0,0 +1,22 @@ +-- ======================================================================== +-- Copyright (C) 2016 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- +-- Linked files +-- ======================================================================== + +ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label); + From 9606f67bdb2cd855965ba2bf9754ef00afece630 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Nov 2016 14:57:50 +0100 Subject: [PATCH 77/96] Better responsive design --- htdocs/core/lib/company.lib.php | 4 ++-- htdocs/theme/eldy/style.css.php | 1 + htdocs/theme/md/style.css.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a5866527b50..e99a6913773 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1159,7 +1159,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=''; } $out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder); - $out.=''.$langs->trans("Label").''; + $out.=''.$langs->trans("Label").''; $out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep, a.id', '', $param, '', $sortfield, $sortorder); $out.=''.$langs->trans("Type").''; $out.=''; @@ -1176,7 +1176,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=''; } $out.=''; - $out.=''; + $out.=''; $out.=''; $out.=''; $out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index a2471cd8aa8..e4dd4d64888 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -680,6 +680,7 @@ div.myavailability { line-height: 1.4em; padding: .4em .1em; border: 1px solid #BBB; + max-width: inherit; } .hideonsmartphone { display: none; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index de92d29361b..dd9c18291d5 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -685,6 +685,7 @@ div.myavailability { line-height: 1.4em; padding: .4em .1em; border: 1px solid #BBB; + max-width: inherit; } .hideonsmartphone { display: none; } From 66ff13903059e02aa761cf02aff2dce9cb20ad1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Nov 2016 18:03:35 +0100 Subject: [PATCH 78/96] Fix travis --- htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php | 3 ++- htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index 5afde3a4427..ff16f267431 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -52,7 +52,8 @@ foreach($linkedObjectBlock as $key => $objectlink) getLibStatut(3); ?> ">transnoentitiesnoconv("RemoveLink")); ?> - 1) { ?> diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 4df741b8ad4..2ab3b4d215b 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -54,6 +54,7 @@ foreach($linkedObjectBlock as $key => $objectlink) ">transnoentitiesnoconv("RemoveLink")); ?> 1) { ?> From ff4e61e70a50a793f34bb130c5ed518cf9f5f4a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Nov 2016 18:45:28 +0100 Subject: [PATCH 79/96] Fix doc debian --- build/debian/README.howto | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/debian/README.howto b/build/debian/README.howto index cd7cd93c24e..696ea9a2bef 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -295,12 +295,16 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER * Edit orig.tar.gz file to remove - debian - htdocs/includes/ckeditor -- htdocs/includes/jszip +- htdocs/includes/jquery/css +- htdocs/includes/jquery/js +- htdocs/includes/jquery/plugins/flot +- htdocs/includes/jquery/plugins/multiselect - htdocs/includes/jquery/plugins/datatables +- htdocs/includes/jszip - htdocs/includes/mike42 - htdocs/includes/phpexcel or htdocs/includes/phpoffice -- htdocs/includes/swiftmailer - htdocs/includes/restler/framework/Luracast/Restler/explorer +- htdocs/includes/swiftmailer - htdocs/includes/tcpdf or htdocs/includes/tecnickcom And rename file into dolibarr-x.y.z+dfsgw.tgz From ab269bd7a6e0ab42251a8d78c8e304976c0b03c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 01:15:41 +0100 Subject: [PATCH 80/96] Better responsive --- htdocs/accountancy/admin/productaccount.php | 2 +- htdocs/comm/mailing/card.php | 77 ++++++++++--------- htdocs/comm/mailing/cibles.php | 6 +- htdocs/comm/mailing/index.php | 4 +- htdocs/compta/index.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/don/index.php | 2 +- htdocs/ecm/search.php | 6 +- .../product/stock/tpl/stockcorrection.tpl.php | 2 +- .../product/stock/tpl/stocktransfer.tpl.php | 2 +- htdocs/theme/eldy/style.css.php | 46 ++--------- htdocs/theme/md/style.css.php | 34 +------- 12 files changed, 62 insertions(+), 123 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 5de8be91d20..1cb37e92baa 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -329,7 +329,7 @@ if ($result) print ''; print ''; - print ''; + print ''; if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print ''; // On sell print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 92dc2726030..8f41c6f336a 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -788,10 +788,10 @@ else } } - print ''; - $linkback = ''.$langs->trans("BackToList").''; + print '
    '; + print ''; print ''; - print ''; - print ''; - - print '
    '.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); @@ -987,11 +987,19 @@ else print '
    '; } + + $htmltext = ''.$langs->trans("CommonSubstitutions").':
    '; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
    '; + } + $htmltext.='
    '; + // Print mail content - print load_fiche_titre($langs->trans("EMail"),'',''); - + print load_fiche_titre($form->textwithpicto($langs->trans("EMail"), $htmltext), '','title_generic'); + dol_fiche_head(''); - + print ''; // Subject @@ -1019,16 +1027,11 @@ else /*print '';*/ - + + print '
    '.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
    '; + // Message - print '
    '.$langs->trans("MailMessage").'
    '; - print '
    '.$langs->trans("CommonSubstitutions").':
    '; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
    '; - } - print '
    '; + print '
    '; if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff') { $readonly=1; @@ -1038,12 +1041,10 @@ else $doleditor->Create(); } else print dol_htmlentitiesbr($object->body); - print '
    '; + print '
    '; dol_fiche_end(); + } else { @@ -1051,10 +1052,10 @@ else * Mailing en mode edition */ - print ''; - $linkback = ''.$langs->trans("BackToList").''; + print '
    '; + print ''; print ''; - print ''; + print ''; - print '
    '.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); @@ -1100,21 +1101,29 @@ else - print "\n"; + print "
    \n"; + print ''."\n"; print ''; print ''; print ''; - + + $htmltext = ''.$langs->trans("CommonSubstitutions").':
    '; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
    '; + } + $htmltext.='
    '; + // Print mail content - print load_fiche_titre($langs->trans("EMail"),'',''); + print load_fiche_titre($form->textwithpicto($langs->trans("EMail"), $htmltext), '','title_generic'); dol_fiche_head(); - + print ''; // Subject - print ''; + print ''; $trackid=''; // TODO To avoid conflicts with 2 mass emailing, we should set a trackid here, even if we use another one into email header. dol_init_file_process($upload_dir, $trackid); @@ -1159,23 +1168,17 @@ else print ''; - + + print '
    '.$langs->trans("MailTopic").'
    '.$langs->trans("MailTopic").'
    '.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
    '; + // Message - print '
    '.$langs->trans("MailMessage").'
    '; - print '
    '.$langs->trans("CommonSubstitutions").':
    '; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
    '; - } - print '
    '; + print '
    '; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,120); $doleditor->Create(); - print '
    '; dol_fiche_end(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index cc5b16f1935..abf903cd6ea 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -441,15 +441,15 @@ if ($object->fetch($id) >= 0) print ''; // EMail print ''; - print ''; + print ''; print ''; // Name print ''; - print ''; + print ''; print ''; // Firstname print ''; - print ''; + print ''; print ''; // Other print ''; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index bf7c4624c1e..ba8c2481411 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -56,10 +56,10 @@ print ''; print ''; print ''; print ''; +print $langs->trans("Ref").':'; print ''; print ''; +print $langs->trans("Other").':'; print "
    '.$langs->trans("SearchAMailing").'
    '; -print $langs->trans("Ref").':
    '; -print $langs->trans("Other").':

    \n"; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 40e3b80a510..0d0552b41ad 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -117,7 +117,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''.$langs->trans("Search").''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 62bd4cde742..097557de909 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -742,7 +742,7 @@ class Form } $out.= ''; - $out .= ''; + $out .= ''; if (!empty($page)) { diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 9894de3a2b5..5e4b2966051 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -96,7 +96,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''.$langs->trans("Search").''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 729543eff56..dd37c86592a 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -140,9 +140,9 @@ print ''; print ''; print ""; print ''; -print "'; -print "'; -print "'; +print "'; +print "'; +print "'; print "'; print "
    '.$langs->trans("ECMSearchByKeywords").'
    ".$langs->trans("Ref").':
    ".$langs->trans("Title").':
    ".$langs->trans("Keyword").':
    ".$langs->trans("Ref").':
    ".$langs->trans("Title").':
    ".$langs->trans("Keyword").':
    "; //print $langs->trans("ECMSectionManualDesc"); diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 9277de5b498..0b48be2b0d5 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -110,7 +110,7 @@ print ''; print ''; print ''; - print ''.$langs->trans("InventoryCode").''; + print ''.$langs->trans("InventoryCode").''; print ''; print ''; diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index 98fe80f7c90..dfddd1e19f1 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -117,7 +117,7 @@ print ''; print ''; print ''; - print ''.$langs->trans("InventoryCode").''; + print ''.$langs->trans("InventoryCode").''; print ''; print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index e4dd4d64888..0edce826479 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -71,7 +71,6 @@ $dol_hide_topmenu=$conf->dol_hide_topmenu; $dol_hide_leftmenu=$conf->dol_hide_leftmenu; $dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; $dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; //$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; @@ -221,7 +220,6 @@ print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; -print 'dol_use_jmobile='.$dol_use_jmobile."\n"; print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n"; print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n"; print 'fontsize='.$fontsize."\n"; @@ -261,8 +259,6 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla background-color: #FFF; } - - input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; } @@ -306,7 +302,6 @@ span.timesheetalreadyrecorded input { border: none; /*background: transparent;*/ } - select.flat, form.flat select { font-weight: normal; @@ -341,9 +336,9 @@ input[type=checkbox] { background-color: transparent; border: none; box-shadow: input[type=radio] { background-color: transparent; border: none; box-shadow: none; } input[type=image] { background-color: transparent; border: none; box-shadow: none; } input:-webkit-autofill { - background-color: !important; + background-color: #FBFFEA !important; background-image:none !important; - -webkit-box-shadow: 0 0 0 50px inset; + -webkit-box-shadow: 0 0 0 50px #FBFFEA inset; } ::-webkit-input-placeholder { color:#ccc; } :-moz-placeholder { color:#bbb; } /* firefox 18- */ @@ -351,9 +346,6 @@ input:-webkit-autofill { :-ms-input-placeholder { color:#ccc; } /* ie */ input:-moz-placeholder { color:#ccc; } - -legend { margin-bottom: 8px; } - fieldset { border: 1px solid #AAAAAA !important; } @@ -841,7 +833,6 @@ div.fiche { margin-: px; margin-: dol_optimize_smallscreen)?'12':'6')); ?>px; dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?> - dol_use_jmobile)) print ' margin-bottom: 10px;'."\n"; ?> } div.fichecenter { width: 100%; @@ -1937,10 +1928,7 @@ div.tabs { } div.tabsElem { margin-top: 1px; - dol_use_jmobile)) { ?>; - margin-bottom: -1px; - -} /* To avoid overlap of tabs when not browser */ +} /* To avoid overlap of tabs when not browser */ div.tabBar { color: #; @@ -2495,7 +2483,7 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile != 4)?'3':'7'; ?>px; + padding-top: 3px; } div.refid { font-weight: bold; @@ -2531,10 +2519,8 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; -dol_use_jmobile != 4) { ?> padding-top: 6px; padding-bottom: 5px; - } .pagination { display: inline-block; @@ -2543,22 +2529,12 @@ div.pagination li { } div.pagination li.pagination a, div.pagination li.pagination span { -dol_use_jmobile != 4) { ?> padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; color: #000; text-decoration: none; - /* - border-color: #ccc; - background-color: #f5f5f5; - background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); - background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); - background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);*/ - background-repeat: repeat-x; - + background-repeat: repeat-x; } div.pagination li.pagination span.inactive { cursor: default; @@ -2590,13 +2566,6 @@ div.pagination li.litext a:hover { background-color: transparent; background-image: none; } -dol_use_jmobile == 4) { ?> -div.pagination li.litext { - padding-top: 13px; - vertical-align: top; -} - -dol_use_jmobile != 4) { ?> div.pagination li.noborder a:hover { border: none; background-color: transparent; @@ -2656,7 +2625,6 @@ div.pagination .disabled a:focus { background-color: #fff; border-color: #ddd; } - div.pagination li.pagination .active { text-decoration: underline; } @@ -4235,11 +4203,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i min-width: .4em; padding-left: 6px; padding-right: 6px; - - font-size: 13px; - font-size: px; - /* white-space: normal; */ /* Warning, enable this break the truncate feature */ } .ui-btn-icon-right .ui-btn-inner { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index dd9c18291d5..3dc4a122aca 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -72,7 +72,6 @@ $dol_hide_topmenu=$conf->dol_hide_topmenu; $dol_hide_leftmenu=$conf->dol_hide_leftmenu; $dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; $dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; //$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; @@ -221,7 +220,6 @@ print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; -print 'dol_use_jmobile='.$dol_use_jmobile."\n"; print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n"; print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n"; print 'fontsize='.$fontsize."\n"; @@ -261,8 +259,6 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla background-color: #FDFDFD; } - - input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; } @@ -308,8 +304,6 @@ span.timesheetalreadyrecorded input { /*background: transparent;*/ } - - select.flat, form.flat select { font-weight: normal; } @@ -347,9 +341,9 @@ input[type=radio] { background-color: transparent; border: none; box-shadow: input[type=image] { background-color: transparent; border: none; box-shadow: none; } input[type=text] { min-width: 20px; } input:-webkit-autofill { - background-color: !important; + background-color: #FBFFEA !important; background-image:none !important; - -webkit-box-shadow: 0 0 0 50px inset; + -webkit-box-shadow: 0 0 0 50px #FBFFEA inset; } ::-webkit-input-placeholder { color:#ccc; } :-moz-placeholder { color:#bbb; } /* firefox 18- */ @@ -357,9 +351,6 @@ input:-webkit-autofill { :-ms-input-placeholder { color:#ccc; } /* ie */ input:-moz-placeholder { color:#ccc; } - -legend { margin-bottom: 8px; } - fieldset { border: 1px solid #AAAAAA !important; } @@ -2145,13 +2136,11 @@ span.butAction, span.butActionDelete { color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #006dcc; - dol_use_jmobile != 4)) { ?> background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(to bottom, #0088cc, #0044cc); - background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; @@ -2410,7 +2399,7 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile != 4)?'3':'14'; ?>px; + padding-top: 3px; } div.refid { font-weight: bold; @@ -2446,10 +2435,8 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; -dol_use_jmobile != 4)) { ?> padding-top: 6px; padding-bottom: 5px; - } .pagination { display: inline-block; @@ -2459,7 +2446,6 @@ div.pagination li { div.pagination li.pagination a, div.pagination li.pagination span { -dol_use_jmobile != 4) { ?> padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; @@ -2473,7 +2459,6 @@ div.pagination li.pagination span { background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); background-repeat: repeat-x; - } div.pagination li.pagination span.inactive { cursor: default; @@ -2486,13 +2471,6 @@ border: none; padding-left: 4px; font-weight: bold; } -dol_use_jmobile == 4) { ?> -div.pagination li.litext { - padding-top: 13px; - vertical-align: top; -} - -dol_use_jmobile != 4) { ?> div.pagination li.noborder a:hover { border: none; background-color: transparent; @@ -2544,7 +2522,6 @@ div.pagination .disabled a:focus { background-color: #fff; border-color: #ddd; } - div.pagination li.pagination .active { text-decoration: underline; } @@ -4142,11 +4119,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i min-width: .4em; padding-left: 6px; padding-right: 6px; - - font-size: 13px; - font-size: px; - /* white-space: normal; */ /* Warning, enable this break the truncate feature */ } .ui-btn-icon-right .ui-btn-inner { @@ -4571,7 +4544,6 @@ img.demothumb { } select { width: 98%; - dol_use_jmobile)) { ?>max-width: 100px; min-width: 0 !important; } div.divphotoref { From e4c4ced5a3de072601390e28db984eb4ab10e766 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 01:55:53 +0100 Subject: [PATCH 81/96] Complete work on usin dol_banner --- htdocs/comm/mailing/card.php | 40 +++++++++++++++------ htdocs/comm/mailing/cibles.php | 21 +++++++---- htdocs/comm/mailing/class/mailing.class.php | 3 +- htdocs/comm/mailing/info.php | 31 ++++++++++------ htdocs/langs/en_US/mails.lang | 1 - 5 files changed, 65 insertions(+), 31 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 8f41c6f336a..d2c1ecd5938 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -790,15 +790,22 @@ else $linkback = ''.$langs->trans("BackToList").''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '
    '; + print ''; - print ''; +/* print ''; print ''; - +*/ // Description - print ''; @@ -813,10 +820,12 @@ else print ''; // Status + /* print ''; - + */ + // Nb of distinct emails print ''; - print '
    '.$langs->trans("Ref").'
    '.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
    '.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').''; + print '
    '.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').''; print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string'); print '
    '.$langs->trans("Status").''.$object->getLibStatut(4); if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')'; print'
    '; print $langs->trans("TotalNbOfDistinctRecipients"); @@ -988,7 +997,7 @@ else } - $htmltext = ''.$langs->trans("CommonSubstitutions").':
    '; + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
    '; foreach($object->substitutionarray as $key => $val) { $htmltext.=$key.' = '.$langs->trans($val).'
    '; @@ -996,7 +1005,7 @@ else $htmltext.='
    '; // Print mail content - print load_fiche_titre($form->textwithpicto($langs->trans("EMail"), $htmltext), '','title_generic'); + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); dol_fiche_head(''); @@ -1054,17 +1063,26 @@ else $linkback = ''.$langs->trans("BackToList").''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '
    '; + print ''; + /* print ''; print ''; - + */ + // Topic - print ''; + print ''; // From - print ''; + print ''; // To print ''; @@ -1108,7 +1126,7 @@ else print ''; print ''; - $htmltext = ''.$langs->trans("CommonSubstitutions").':
    '; + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
    '; foreach($object->substitutionarray as $key => $val) { $htmltext.=$key.' = '.$langs->trans($val).'
    '; @@ -1116,7 +1134,7 @@ else $htmltext.='
    '; // Print mail content - print load_fiche_titre($form->textwithpicto($langs->trans("EMail"), $htmltext), '','title_generic'); + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); dol_fiche_head(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index abf903cd6ea..b12121293d7 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -178,17 +178,24 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'targets', $langs->trans("Mailing"), 0, 'email'); - - print '
    '.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
    '.$langs->trans("MailTitle").''.$object->titre.'
    '.$langs->trans("MailTitle").''.$object->titre.'
    '.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
    '.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
    '.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto,0,0,0,0,1).'
    '; - $linkback = ''.$langs->trans("BackToList").''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + + print '
    '; + + print '
    '; +/* print ''; print ''; - - print ''; +*/ + print ''; print ''; @@ -197,10 +204,10 @@ if ($object->fetch($id) >= 0) print ''; // Status - print ''; - +*/ // Nb of distinct emails print ''; - print ''; - print '
    '.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
    '.$langs->trans("MailTitle").''.$object->titre.'
    '.$langs->trans("MailTitle").''.$object->titre.'
    '.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
    '.$langs->trans("Status").''.$object->getLibStatut(4); +/* print '
    '.$langs->trans("Status").''.$object->getLibStatut(4); if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')'; print '
    '; print $langs->trans("TotalNbOfDistinctRecipients"); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 6a7ae2cefbe..79201115ea1 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -33,7 +33,8 @@ class Mailing extends CommonObject { public $element='mailing'; public $table_element='mailing'; - + public $picto='email'; + var $titre; var $sujet; var $body; diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 77245f74766..5280fcfad59 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -43,24 +43,33 @@ llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:M $form = new Form($db); -$mil = new Mailing($db); +$object = new Mailing($db); -if ($mil->fetch($_REQUEST["id"]) >= 0) +if ($object->fetch($_REQUEST["id"]) >= 0) { - $head = emailing_prepare_head($mil); + $head = emailing_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Mailing"), 0, 'email'); + $linkback = ''.$langs->trans("BackToList").''; - print '
    '; - $mil->user_creation=$mil->user_creat; - $mil->date_creation=$mil->date_creat; - $mil->user_validation=$mil->user_valid; - $mil->date_validation=$mil->date_valid; - dol_print_object_info($mil); - print '
    '; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '

    '; + + //print '
    '; + $object->user_creation=$object->user_creat; + $object->date_creation=$object->date_creat; + $object->user_validation=$object->user_valid; + $object->date_validation=$object->date_valid; + dol_print_object_info($object, 0); + //print '
    '; + - print ''; + dol_fiche_end(); } llxFooter(); diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 45e8246261a..1c1a3bf3245 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -50,7 +50,6 @@ NbOfEMails=Nb of EMails TotalNbOfDistinctRecipients=Number of distinct recipients NoTargetYet=No recipients defined yet (Go on tab 'Recipients') RemoveRecipient=Remove recipient -CommonSubstitutions=Common substitutions YouCanAddYourOwnPredefindedListHere=To create your email selector module, see htdocs/core/modules/mailings/README. EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions variables are replaced by generic values MailingAddFile=Attach this file From 2cfcca82b4a90bcec2de96fac69c6eeaab01a3c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 02:18:48 +0100 Subject: [PATCH 82/96] Fix list of linked object block --- htdocs/comm/mailing/card.php | 27 ++++++++++--------- .../tpl/linkedobjectblockForRec.tpl.php | 9 +++++-- htdocs/contrat/tpl/linkedobjectblock.tpl.php | 11 +++++--- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index d2c1ecd5938..b2020b71222 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -668,7 +668,15 @@ if ($action == 'create') print ''; print ''; - print load_fiche_titre($langs->trans("NewMailing")); + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
    '; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
    '; + } + $htmltext.='
    '; + + // Print mail form + print load_fiche_titre($langs->trans("NewMailing"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); dol_fiche_head(); @@ -693,21 +701,16 @@ if ($action == 'create') print '
    '.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0); print '
    '.$langs->trans("MailMessage").'
    '; - print '
    '.$langs->trans("CommonSubstitutions").':
    '; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
    '; - } - print '
    '; + + print '
    '; + + print '
    '; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%'); $doleditor->Create(); - print '
    '; - + print '
    '; + dol_fiche_end(); print '
    '; diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index ce94e4a1212..781f5609915 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -24,16 +24,21 @@ load("bills"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> > trans("RepeatableInvoice"); ?> diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index aa8d83bb803..9ea21f890fc 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -13,7 +13,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ ?> @@ -22,19 +21,23 @@ load("contracts"); +$total=0; $ilink=0; $var=true; foreach($linkedObjectBlock as $key => $objectlink) { - $objectlink->fetch_lines(); - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - > + trans("Contract"); ?> getNomUrl(1); ?> From 60219fa84d97349250cd18f7213b487ea13f3faf Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 11 Nov 2016 07:06:45 +0100 Subject: [PATCH 83/96] Update tulip model --- .../mod_facture_fournisseur_tulip.php | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index ba31d979864..b7a3801a9cd 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -3,7 +3,8 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Philippe Grand - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,6 +60,9 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices $texte.= ''; $texte.= ''; $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= ''; $texte.= ''; $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Invoice"),$langs->transnoentities("Invoice")); @@ -68,13 +72,28 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices $tooltip.=$langs->trans("GenericMaskCodes5"); // Parametrage du prefix - $texte.= ''; + $texte.= ''; $texte.= ''; $texte.= ''; $texte.= ''; + // Parametrage du prefix des replacement + $texte.= ''; + $texte.= ''; + $texte.= ''; + + // Parametrage du prefix des avoirs + $texte.= ''; + $texte.= ''; + $texte.= ''; + + // Parametrage du prefix des acomptes + $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= '
    '.$langs->trans("Mask").':
    '.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'.$form->textwithpicto('',$tooltip,1,1).' 
    '.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'.$form->textwithpicto('',$tooltip,1,1).'
    '.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'.$form->textwithpicto('',$tooltip,1,1).'
    '.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'.$form->textwithpicto('',$tooltip,1,1).'
    '; $texte.= ''; @@ -106,7 +125,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices * Return next value * * @param Societe $objsoc Object third party - * @param Object $object Object + * @param Object $object Object invoice * @param string $mode 'next' for next value or 'last' for last value * @return string Value if OK, 0 if KO */ @@ -116,16 +135,26 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; - // On defini critere recherche compteur - $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK; - + // Get Mask value + $mask = ''; + if (is_object($object) && $object->type == 1) + { + $mask=$conf->global->SUPPLIER_REPLACEMENT_TULIP_MASK; + if (! $mask) + { + $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK; + } + } + else if (is_object($object) && $object->type == 2) $mask=$conf->global->SUPPLIER_CREDIT_TULIP_MASK; + else if (is_object($object) && $object->type == 3) $mask=$conf->global->SUPPLIER_DEPOSIT_TULIP_MASK; + else $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK; if (! $mask) { $this->error='NotConfigured'; return 0; } - //Supplier invoices take invoice date instead of creation date for the mask + // Supplier invoices take invoice date instead of creation date for the mask $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc,$object->date); return $numFinal; From c65678d00a718bfa6779eb742a5be0475df444ce Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 11 Nov 2016 07:36:26 +0100 Subject: [PATCH 84/96] Update cactus numbering model --- .../mod_facture_fournisseur_cactus.php | 109 +++++++++++++----- htdocs/langs/en_US/bills.lang | 1 + 2 files changed, 81 insertions(+), 29 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index ea0456bc3ff..0a4f5d98c46 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,14 +22,15 @@ /** * \file htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php * \ingroup supplier invoice - * \brief File containing the Cactus Class of numbering models of suppliers invoices references + * \brief File containing class for the numbering module Cactus */ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_invoice/modules_facturefournisseur.php'; /** - * Cactus Class of numbering models of suppliers invoices references + * \class mod_facture_fournisseur_cactus + * \brief Cactus Class of numbering models of suppliers invoices references */ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices { @@ -36,6 +38,8 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices var $error = ''; var $nom = 'Cactus'; var $prefixinvoice='SI'; + var $prefixcreditnote='SA'; + var $prefixdeposit='SD'; /** @@ -46,7 +50,8 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices function info() { global $langs; - return $langs->trans("SimpleNumRefModelDesc",$this->prefixinvoice); + $langs->load("bills"); + return $langs->trans("CactusNumRefModelDesc1",$this->prefixinvoice,$this->prefixcreditnote,$this->prefixdeposit); } @@ -61,45 +66,90 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices } - /** - * Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. - * - * @return boolean false if conflict, true if ok - */ - function canBeActivated() - { - global $conf,$langs,$db; + /** + * Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. + * + * @return boolean false if conflict, true if ok + */ + function canBeActivated() + { + global $conf,$langs,$db; - $siyymm=''; $max=''; + $langs->load("bills"); + + // Check invoice num + $siyymm=''; $max=''; $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; $sql.= " WHERE ref LIKE '".$this->prefixinvoice."____-%'"; - $sql.= " AND entity = ".$conf->entity; - $resql=$db->query($sql); - if ($resql) - { - $row = $db->fetch_row($resql); - if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } - } - if (! $siyymm || preg_match('/'.$this->prefixinvoice.'[0-9][0-9][0-9][0-9]/i',$siyymm)) - { - return true; - } - else - { + $sql.= " AND entity = ".$conf->entity; + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } + } + if (! $siyymm || preg_match('/'.$this->prefixinvoice.'[0-9][0-9][0-9][0-9]/i',$siyymm)) + { + return true; + } + else + { $langs->load("errors"); $this->error=$langs->trans('ErrorNumRefModel',$max); - return false; - } + return false; + } + + // Check credit note num + $siyymm=''; + + $posindice=8; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " WHERE ref LIKE '".$this->prefixcreditnote."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } + } + if ($siyymm && ! preg_match('/'.$this->prefixcreditnote.'[0-9][0-9][0-9][0-9]/i',$siyymm)) + { + $this->error=$langs->trans('ErrorNumRefModel',$max); + return false; + } + + // Check deposit num + $siyymm=''; + + $posindice=8; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " WHERE ref LIKE '".$this->prefixdeposit."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } + } + if ($siyymm && ! preg_match('/'.$this->prefixdeposit.'[0-9][0-9][0-9][0-9]/i',$siyymm)) + { + $this->error=$langs->trans('ErrorNumRefModel',$max); + return false; + } } /** * Return next value * * @param Societe $objsoc Object third party - * @param Object $object Object + * @param Object $object Object invoice * @param string $mode 'next' for next value or 'last' for last value * @return string Value if OK, 0 if KO */ @@ -108,6 +158,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices global $db,$conf; if ($object->type == 2) $prefix=$this->prefixcreditnote; + else if ($facture->type == 3) $prefix=$this->prefixdeposit; else $prefix=$this->prefixinvoice; // D'abord on recupere la valeur max diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 3f4898630ba..825c31744e0 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -446,6 +446,7 @@ PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice templat TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for deposit invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. +CactusNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for deposit invoices where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 ##### Types de contacts ##### TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice TypeContact_facture_external_BILLING=Customer invoice contact From b20c4bdfe4f2e8f4a6c0b798d4bec8d2b2b901d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 12:55:03 +0100 Subject: [PATCH 85/96] Responsive design --- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/projet/graph_opportunities.inc.php | 4 ++-- htdocs/projet/index.php | 2 +- htdocs/theme/eldy/style.css.php | 4 ++++ htdocs/theme/md/style.css.php | 1 + htdocs/user/agenda_extsites.php | 10 +++++----- htdocs/user/card.php | 16 ++++++++-------- htdocs/user/perms.php | 8 ++++---- 8 files changed, 27 insertions(+), 22 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 097557de909..1aa2ac6705c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4521,7 +4521,7 @@ class Form { //$retstring.='
    '; // Day - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { @@ -4553,7 +4553,7 @@ class Form // Year if ($emptydate || $set_time == -1) { - $retstring.=''; + $retstring.=''; } else { diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 673fbc973ad..b763240500f 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -83,8 +83,8 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) } //if ($totalinprocess != $total) //print ''.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')'.$totalinprocess.''; - print ''.$langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')'.price($totalamount, 0, '', 1, -1, -1, $conf->currency).''; - print ''; + print ''.$langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')'.price($totalamount, 0, '', 1, -1, -1, $conf->currency).''; + print ''; //print $langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')'; print $form->textwithpicto($langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')', $langs->trans("OpportunityPonderatedAmountDesc"), 1); print ''.price(price2num($ponderated_opp_amount,'MT'), 0, '', 1, -1, -1, $conf->currency).''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 752e3615464..96f98111c2e 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -140,7 +140,7 @@ print '
    '; print ''; print ''; -print_liste_field_titre($langs->trans("OpenedProjectsByThirdparties"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder); +print_liste_field_titre($langs->trans("OpenedProjectsByThirdparties"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("NbOfProjects"),"","","","",'align="right"',$sortfield,$sortorder); print "\n"; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 0edce826479..70b75650133 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -621,6 +621,7 @@ div.myavailability { .maxwidth300 { max-width: 300px; } .maxwidth400 { max-width: 400px; } .maxwidth500 { max-width: 500px; } +.maxwidth50imp { max-width: 50px !important; } .minheight20 { min-height: 20px; } .minheight40 { min-height: 40px; } .titlefieldcreate { width: 20%; } @@ -698,10 +699,13 @@ div.myavailability { position: absolute; width: px; } + + /* intput, input[type=text], */ select { width: 98%; min-width: 40px; } + div.divphotoref { padding-right: 5px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3dc4a122aca..570369bf182 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -625,6 +625,7 @@ div.myavailability { .maxwidth300 { max-width: 300px; } .maxwidth400 { max-width: 400px; } .maxwidth500 { max-width: 500px; } +.maxwidth50imp { max-width: 50px !important; } .minheight20 { min-height: 20px; } .minheight40 { min-height: 40px; } .titlefieldcreate { width: 20%; } diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 823f5ad307e..ef7ffd9f70b 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -169,7 +169,7 @@ print "
    "; print ""; print ""; print ""; -print "'; +print "'; print "'; print ''; print ""; @@ -187,13 +187,13 @@ while ($i <= $MAXAGENDA) $var=!$var; print ""; // Nb - print '"; + print '"; // Name - print ''; + print ''; // URL - print ''; + print ''; // Offset TZ - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; @@ -747,7 +747,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } else { - print ''; + print ''; } print ''; @@ -1802,7 +1802,7 @@ else print ''; print ''; @@ -1992,7 +1992,7 @@ else } // Type - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Picto and label of permission - print ''; + print ''; // Permission and tick if (! empty($object->admin) && ! empty($objMod->rights_admin_allowed)) // Permission own because admin @@ -403,7 +403,7 @@ if ($result) } $permlabel=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->libelle))); - print ''; + print ''; print ''."\n"; From 448cd8c38a4cb46978e1c73c32c2bb7f7980ee1d Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 11 Nov 2016 12:57:59 +0100 Subject: [PATCH 86/96] subscription never filled with "yes" --- htdocs/adherents/class/adherent.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 79c12e68561..79aa64fb1ab 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1146,12 +1146,12 @@ class Adherent extends CommonObject $this->birth = $this->db->jdate($obj->birthday); $this->note_private = $obj->note_private; - $this->note_public = $obj->note_public; + $this->note_public = $obj->note_public; $this->morphy = $obj->morphy; $this->typeid = $obj->fk_adherent_type; - $this->type = $obj->type; - $this->need_subscription = ($obj->subscription=='yes'?1:0); + $this->type = $obj->type; + $this->need_subscription = $obj->subscription; $this->user_id = $obj->user_id; $this->user_login = $obj->user_login; From 360d697fc31d6ba93f1e45bc17c2ae20ca70b147 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 13:45:18 +0100 Subject: [PATCH 87/96] Add missing field to store result of email sending --- htdocs/core/class/html.form.class.php | 6 +++--- htdocs/install/mysql/migration/4.0.0-5.0.0.sql | 3 ++- .../install/mysql/tables/llx_mailing_cibles.sql | 6 +++--- htdocs/user/card.php | 6 +++--- htdocs/user/document.php | 15 +++++++++------ 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1aa2ac6705c..1297ad6c0c5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5798,10 +5798,10 @@ class Form if ($caneditfield) { if ($object->photo) $ret.="
    \n"; - $ret.='
    ".$langs->trans("Parameter")."".$langs->trans("Name")."".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)".$langs->trans("ExtSiteUrlAgenda").'
    '." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)
    ".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).''.$langs->trans("Color").'
    '.$langs->trans("AgendaExtNb",$key)."'.$langs->trans("AgendaExtNb",$key)."'; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index d2c96ab7950..d2188a6a283 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -733,7 +733,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } else { - print ''; + print ''; } print '
    '; if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { @@ -1817,7 +1817,7 @@ else print ''; if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { @@ -1902,7 +1902,7 @@ else if(! empty($conf->api->enabled) && $user->admin) { print '
    '.$langs->trans("ApiKey").''; - print ''; + print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_api_key" class="linkobject"'); print '
    '.$langs->trans("Type").'
    '.$langs->trans("Type").''; if ($user->id == $object->id || ! $user->admin) { @@ -2104,7 +2104,7 @@ else print ''; if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { @@ -2135,7 +2135,7 @@ else print ''; if ($caneditfield) { - print ''; + print ''; } else { diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 3240ae2d5ec..87d96a46638 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -329,8 +329,8 @@ if ($result) { // On affiche ligne pour modifier droits print '
    '.img_object('',$picto).' '.$objMod->getName(); - print ' '.img_object('',$picto).' '.$objMod->getName(); + print ''; print ''.$langs->trans("All").""; print '/'; @@ -344,7 +344,7 @@ if ($result) print '
    '.img_object('',$picto).' '.$objMod->getName().''.img_object('',$picto).' '.$objMod->getName().''.$permlabel. ''.$permlabel.'
    '; - if ($object->photo) $ret.=''; + $ret.='
    '.$langs->trans("Delete").'

    '; + if ($object->photo) $ret.=''; $ret.=''; - $ret.=''; + $ret.=''; $ret.='
    '.$langs->trans("Delete").'

    '.$langs->trans("PhotoFile").'
    '; } diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index faffe9e53f5..0f57378465f 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -180,6 +180,8 @@ ALTER TABLE llx_bank_account ADD COLUMN import_key varchar(14); ALTER TABLE llx_overwrite_trans ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; +ALTER TABLE llx_mailing_cibles ADD COLUMN error_text varchar(255); + create table llx_user_employment ( @@ -215,4 +217,3 @@ drop table tmp_links_double; ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label); - diff --git a/htdocs/install/mysql/tables/llx_mailing_cibles.sql b/htdocs/install/mysql/tables/llx_mailing_cibles.sql index 72fdeca2925..f3031069220 100644 --- a/htdocs/install/mysql/tables/llx_mailing_cibles.sql +++ b/htdocs/install/mysql/tables/llx_mailing_cibles.sql @@ -1,6 +1,6 @@ -- ======================================================================== -- Copyright (C) 2005 Rodolphe Quiedeville --- Copyright (C) 2009-2012 Laurent Destailleur +-- Copyright (C) 2009-2016 Laurent Destailleur -- Copyright (C) 2011-2012 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify @@ -33,6 +33,6 @@ create table llx_mailing_cibles source_url varchar(160), source_id integer, source_type varchar(16), - date_envoi datetime - + date_envoi datetime, + error_text varchar(255) -- text with error if statut is -1 )ENGINE=innodb; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index d2188a6a283..0cd5b077996 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1829,8 +1829,8 @@ else // Photo print ''; print ''.$langs->trans("Photo").''; - print ''; - print $form->showphoto('userphoto',$object,100,0,$caneditfield,'photowithmargin','small'); + print ''; + print $form->showphoto('userphoto',$object,60,0,$caneditfield,'photowithmargin','small'); print ''; print ''; @@ -2035,7 +2035,7 @@ else // State if (empty($conf->global->USER_DISABLE_STATE)) { - print ''.fieldLabel('State','state_id').''; + print ''.fieldLabel('State','state_id').''; print $formcompany->select_state($object->state_id,$object->country_code, 'state_id'); print ''; } diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 36338f03e10..d1922371909 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -96,6 +96,7 @@ if ($id > 0 || ! empty($ref)) // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('usercard','globalcard')); + /* * Actions */ @@ -108,6 +109,7 @@ if (empty($reshook)) { include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; } + /* * View */ @@ -144,20 +146,21 @@ if ($object->id) } - print ''; + print '
    '; // Login - print ''; + print ''; - // Nbre fichiers - print ''; + // Nbre files + print ''; //Total taille - print ''; + print ''; print '
    '.$langs->trans("Login").''.$object->login.' 
    '.$langs->trans("Login").''.$object->login.' 
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
    '; - print '
    '; + dol_fiche_end(); + $modulepart = 'user'; $permission = $user->rights->user->user->creer; From da387db166d6aef459ab59726cea2fcb5733f78a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 14:03:57 +0100 Subject: [PATCH 88/96] NEW Error code of each email sent is visible in list of email targets --- dev/skeletons/skeleton_list.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/cibles.php | 26 +++++++++++---------- htdocs/comm/mailing/class/mailing.class.php | 14 ++++++----- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php index c47a87a8033..0eac0c761c7 100644 --- a/dev/skeletons/skeleton_list.php +++ b/dev/skeletons/skeleton_list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2016 Laurent Destailleur * Copyright (C) 2014-2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index b2020b71222..d7fd92f365b 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -333,7 +333,7 @@ if (empty($reshook)) dol_syslog("comm/mailing/card.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING); $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; - $sql.=" SET statut=-1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid; + $sql.=" SET statut=-1, error_text='".$db->escape($mail->error)."', date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid; $resql2=$db->query($sql); if (! $resql2) { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index b12121293d7..3767ba17add 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -38,16 +38,17 @@ $langs->load("mails"); if (! $user->rights->mailing->lire || $user->societe_id > 0) accessforbidden(); +// Load variable for pagination $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); if ($page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="email"; +if (! $sortorder) $sortorder="ASC"; $id=GETPOST('id','int'); $rowid=GETPOST('rowid','int'); @@ -370,7 +371,7 @@ if ($object->fetch($id) >= 0) } // List of selected targets - $sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type"; + $sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type, mc.error_text"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.fk_mailing=".$object->id; if ($search_lastname) $sql.= " AND mc.lastname LIKE '%".$db->escape($search_lastname)."%'"; @@ -452,11 +453,11 @@ if ($object->fetch($id) >= 0) print ''; // Name print ''; - print ''; + print ''; print ''; // Firstname print ''; - print ''; + print ''; print ''; // Other print ''; @@ -475,10 +476,10 @@ if ($object->fetch($id) >= 0) print ''; print $formmailing->selectDestinariesStatus($search_dest_status,'search_dest_status',1); print ''; - //Search Icon + // Action column print ''; - print ''; - print ''; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; print ''; print ''; @@ -487,9 +488,10 @@ if ($object->fetch($id) >= 0) if ($num) { - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); + $var=!$var; print ""; @@ -544,7 +546,7 @@ if ($object->fetch($id) >= 0) { print ''.$obj->date_envoi.''; print ''; - print $object::libStatutDest($obj->statut,2); + print $object::libStatutDest($obj->statut,2,$obj->error_text); print ''; } diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 79201115ea1..dc39c2e9399 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -578,12 +578,14 @@ class Mailing extends CommonObject /** * Renvoi le libelle d'un statut donne + * TODO Add class mailin_target.class.php * * @param int $statut Id statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param strin $desc Desc error * @return string Label */ - static public function libStatutDest($statut,$mode=0) + static public function libStatutDest($statut,$mode=0,$desc='') { global $langs; $langs->load('mails'); @@ -598,28 +600,28 @@ class Mailing extends CommonObject } if ($mode == 2) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 3) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 4) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 5) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); From 899ba6d90b526fb47bd57aa68c4c5cd444e78b3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 14:17:11 +0100 Subject: [PATCH 89/96] NEW Add option to include parent products too in stats of orders --- htdocs/product/class/product.class.php | 42 ++++++++++++-------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index fc5f613d08d..56a00b2419d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1987,31 +1987,29 @@ class Product extends CommonObject $this->stats_commande['rows']=$obj->nb_rows; $this->stats_commande['qty']=$obj->qty?$obj->qty:0; - // if it's a virtual product, maybe it is in order by extension - $TFather = $this->getFather(); - if(is_array($TFather) && !empty($TFather)) { - - foreach($TFather as &$fatherData) { - - $pFather = new Product($this->db); - $pFather->id = $fatherData['id']; - $qtyCoef = $fatherData['qty']; - - if($fatherData['incdec']) { - $pFather->load_stats_commande($socid, $filtrestatut); - - $this->stats_commande['customers']+=$pFather->stats_commande['customers']; - $this->stats_commande['nb']+=$pFather->stats_commande['nb']; - $this->stats_commande['rows']+=$pFather->stats_commande['rows']; - $this->stats_commande['qty']+=$pFather->stats_commande['qty'] * $qtyCoef; - + // if it's a virtual product, maybe it is in order by extension + if (! empty($conf->global->ORDER_ADD_ORDERS_WITH_PARENT_PROD_IF_INCDEC)) + { + $TFather = $this->getFather(); + if (is_array($TFather) && !empty($TFather)) { + foreach($TFather as &$fatherData) { + $pFather = new Product($this->db); + $pFather->id = $fatherData['id']; + $qtyCoef = $fatherData['qty']; + + if ($fatherData['incdec']) { + $pFather->load_stats_commande($socid, $filtrestatut); + + $this->stats_commande['customers']+=$pFather->stats_commande['customers']; + $this->stats_commande['nb']+=$pFather->stats_commande['nb']; + $this->stats_commande['rows']+=$pFather->stats_commande['rows']; + $this->stats_commande['qty']+=$pFather->stats_commande['qty'] * $qtyCoef; + + } } - - } - } - + return 1; } else From 44a6bc8960ac804132fdbde018657cb70908ac78 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 11 Nov 2016 14:19:21 +0100 Subject: [PATCH 90/96] Cancel typo profit --- htdocs/compta/resultat/clientfourn.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index c2ef7fc7a45..b39e5c47f7f 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -541,7 +541,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujetti print ' '; print ''; - print ''.$langs->trans("Result").''; + print ''.$langs->trans("Profit").''; if ($modecompta == 'CREANCES-DETTES') print ''.price($total_ht).''; print ''.price($total_ttc).''; @@ -1001,7 +1001,7 @@ if ($mysoc->tva_assuj != 'franchise') // Assujetti print ' '; print ''; - print ''.$langs->trans("Result").''; + print ''.$langs->trans("Profit").''; if ($modecompta == 'CREANCES-DETTES') print ''.price(price2num($total_ht,'MT')).''; print ''.price(price2num($total_ttc,'MT')).''; From 787f50817257ded6c3fddb6c2bee1510f3bbdc91 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 14:25:22 +0100 Subject: [PATCH 91/96] More complete fix for #5974 --- htdocs/install/mysql/migration/4.0.0-5.0.0.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index 0f57378465f..0e478820af9 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -108,8 +108,10 @@ ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafield ALTER TABLE llx_cotisation RENAME TO llx_subscription; ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh); ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real; -ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT 'yes'; - +ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT '1'; + +UPDATE llx_adherent_type SET subscription = '1' WHERE subscription = 'yes'; + CREATE TABLE llx_product_lot_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, From a605e0b972a5e6894bca972cecfe28800b4306a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 15:06:31 +0100 Subject: [PATCH 92/96] Fix phpcs --- htdocs/core/lib/ajax.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index acf7aa326e6..0193a33b305 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -356,6 +356,7 @@ function ajax_dialog($title,$message,$w=350,$h=150) * @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete * @param int $forcefocus Force focus on field + * @param string $widthTypeOfAutocomplete 'resolve' or 'off' * @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason. */ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve') From 1082997f6291d062b212ca887a0ed79381b5945c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 15:19:25 +0100 Subject: [PATCH 93/96] FIX #5972 #5734 --- .../restler/framework/Luracast/Restler/CommentParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php index e8248a385fa..8a3023cab20 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php @@ -505,7 +505,7 @@ class CommentParser $data = explode('|', $data); $r['type'] = count($data) == 1 ? $data[0] : $data; } - if (isset($r['type']) && Text::endsWith($r['type'], '[]')) { + if (isset($r['type']) && is_string($r['type']) && Text::endsWith($r['type'], '[]')) { $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); $r['type'] = 'array'; } From 071ba4fbfde6002d0a99dcf4ed1cdb67f3534edf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 15:27:29 +0100 Subject: [PATCH 94/96] Fix as suggested for #5960 --- htdocs/core/lib/price.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 8b017a5a9f3..840687ba69a 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -322,7 +322,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt { $result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; $result[2]=round($result[2]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; - $result[0]=price2num($result[2]-$result[0], 'MT'); + $result[0]=price2num($result[2]-$result[1], 'MT'); $result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; $result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; } From b1bd9e493077a38c74f29d3fd4faf3cc9281c678 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 23:17:37 +0100 Subject: [PATCH 95/96] Responsive design --- htdocs/core/class/commoninvoice.class.php | 16 +++---- htdocs/core/class/html.form.class.php | 56 ++++++++++++----------- htdocs/core/lib/functions.lib.php | 33 ++++++------- htdocs/theme/eldy/style.css.php | 10 ++-- htdocs/theme/md/style.css.php | 13 ++++-- 5 files changed, 68 insertions(+), 60 deletions(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index b3b0cc4042b..30ea6639196 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -337,17 +337,17 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye) { - if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); - if (($status == 3 || $status == 2) && $alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); - if (($status == 3 || $status == 2) && $alreadypaid > 0) return ''.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); - if ($alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); - return ''.$langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); + if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return ''.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); + if ($alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); + return ''.$langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); } else { - if ($type == 2) return ''.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' '.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6'); - elseif ($type == 3) return ''.$langs->trans('Bill'.$prefix.'StatusConverted').' '.img_picto($langs->trans('BillStatusConverted'),'statut6'); - else return ''.$langs->trans('Bill'.$prefix.'StatusPaid').' '.img_picto($langs->trans('BillStatusPaid'),'statut6'); + if ($type == 2) return ''.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' '.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6'); + elseif ($type == 3) return ''.$langs->trans('Bill'.$prefix.'StatusConverted').' '.img_picto($langs->trans('BillStatusConverted'),'statut6'); + else return ''.$langs->trans('Bill'.$prefix.'StatusPaid').' '.img_picto($langs->trans('BillStatusPaid'),'statut6'); } } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1297ad6c0c5..2b18dab3acd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5578,32 +5578,9 @@ class Form $next_ref = $object->ref_next?''.(($conf->dol_use_jmobile != 4)?'>':' ').'':''.(($conf->dol_use_jmobile != 4)?'>':' ').''; //print "xx".$previous_ref."x".$next_ref; - $ret.='
    '; - - if ($morehtmlleft) - { - if ($conf->browser->layout == 'phone') $ret.='
    '.$morehtmlleft.'
    '; - else $ret.='
    '.$morehtmlleft.'
    '; - } - - $ret.='
    '; - - // For thirdparty, contact, user, member, the ref is the id, so we show something else - if ($object->element == 'societe') - { - $ret.=dol_htmlentities($object->name); - } - else if (in_array($object->element, array('contact', 'user', 'member'))) - { - $ret.=dol_htmlentities($object->getFullName($langs)); - } - else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); - if ($morehtmlref) - { - $ret.=' '.$morehtmlref; - } - $ret.='
    '; + $ret.='
    '; + // Right part of banner if ($morehtmlright) $ret.='
    '.$morehtmlright.'
    '; if ($previous_ref || $next_ref || $morehtml) @@ -5624,7 +5601,34 @@ class Form $ret.='
    '; } if ($morehtmlstatus) $ret.='
    '.$morehtmlstatus.'
    '; - $ret.='
    '; + + // Left part of banner + if ($morehtmlleft) + { + if ($conf->browser->layout == 'phone') $ret.='
    '.$morehtmlleft.'
    '; // class="center" to have photo in middle + else $ret.='
    '.$morehtmlleft.'
    '; + } + + //if ($conf->browser->layout == 'phone') $ret.='
    '; + $ret.='
    '; + + // For thirdparty, contact, user, member, the ref is the id, so we show something else + if ($object->element == 'societe') + { + $ret.=dol_htmlentities($object->name); + } + else if (in_array($object->element, array('contact', 'user', 'member'))) + { + $ret.=dol_htmlentities($object->getFullName($langs)); + } + else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); + if ($morehtmlref) + { + $ret.=' '.$morehtmlref; + } + $ret.='
    '; + + $ret.='
    '; return $ret; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d102e264913..bc9dd52dd55 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -939,11 +939,12 @@ function dol_get_fiche_end($notab=0) * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name * @param string $morehtmlleft More html code to show before ref + * @param string $morehtmlstatus More html code to show under navigation arrows * @param string $morehtmlright More html code to show before navigation arrows * @param int $onlybanner Put this to 1, if the card will contains only a banner * @return void */ -function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlright='', $onlybanner=0) +function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='') { global $conf, $form, $user, $langs; @@ -1013,38 +1014,38 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } if ($showbarcode) $morehtmlleft.='
    '.$form->showbarcode($object).'
    '; if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + $morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); } elseif ($object->element == 'product') { - //$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Sell").') '; + //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Sell").') '; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlright.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); + $morehtmlstatus.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { - $morehtmlright.=$object->getLibStatut(5,0); + $morehtmlstatus.=$object->getLibStatut(5,0); } - $morehtmlright.='   '; - //$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Buy").') '; + $morehtmlstatus.='   '; + //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') '; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlright.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); + $morehtmlstatus.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { - $morehtmlright.=$object->getLibStatut(5,1); + $morehtmlstatus.=$object->getLibStatut(5,1); } } elseif ($object->element == 'facture' || $object->element == 'invoice' || $object->element == 'invoice_supplier') { $tmptxt=$object->getLibStatut(6, $object->totalpaye); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) $tmptxt=$object->getLibStatut(5, $object->totalpaye); - $morehtmlright.=$tmptxt; + if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye); + $morehtmlstatus.=$tmptxt; } elseif ($object->element == 'facturerec') { - $morehtmlright.=''; + $morehtmlstatus.=''; } - else { + else { // Generic case $tmptxt=$object->getLibStatut(6); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) $tmptxt=$object->getLibStatut(5); - $morehtmlright.=$tmptxt; + if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5); + $morehtmlstatus.=$tmptxt; } if (! empty($object->name_alias)) $morehtmlref.='
    '.$object->name_alias.'
    '; // For thirdparty if (! empty($object->label)) $morehtmlref.='
    '.$object->label.'
    '; // For product @@ -1062,7 +1063,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } print '
    '; - print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright); + print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright); print '
    '; print '
    '; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 70b75650133..f125bd6089b 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -673,16 +673,16 @@ div.myavailability { line-height: 1.4em; padding: .4em .1em; border: 1px solid #BBB; - max-width: inherit; + /* max-width: inherit; why this ? */ } .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } - .maxwidth50onsmartphone { max-width: 50px; } - .maxwidth75onsmartphone { max-width: 75px; } - .maxwidth100onsmartphone { max-width: 100px; } - .maxwidth150onsmartphone { max-width: 150px; } + .maxwidth50onsmartphone { max-width: 40px; } + .maxwidth75onsmartphone { max-width: 50px; } + .maxwidth100onsmartphone { max-width: 70px; } + .maxwidth150onsmartphone { max-width: 120px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } .maxwidth400onsmartphone { max-width: 400px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 570369bf182..7de2c6d9e82 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -677,16 +677,16 @@ div.myavailability { line-height: 1.4em; padding: .4em .1em; border: 1px solid #BBB; - max-width: inherit; + /* max-width: inherit; why this */ } .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } - .maxwidth50onsmartphone { max-width: 50px; } - .maxwidth75onsmartphone { max-width: 75px; } - .maxwidth100onsmartphone { max-width: 100px; } - .maxwidth150onsmartphone { max-width: 150px; } + .maxwidth50onsmartphone { max-width: 40px; } + .maxwidth75onsmartphone { max-width: 50px; } + .maxwidth100onsmartphone { max-width: 70px; } + .maxwidth150onsmartphone { max-width: 120px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } .maxwidth400onsmartphone { max-width: 400px; } @@ -703,10 +703,13 @@ div.myavailability { position: absolute; width: px; } + + /* intput, input[type=text], */ select { width: 98%; min-width: 40px; } + div.divphotoref { padding-right: 5px; } From 97d84ab4ab00b04281cea93cc87b8db0a7e1b089 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2016 23:47:56 +0100 Subject: [PATCH 96/96] Better responsive design --- htdocs/compta/bank/annuel.php | 21 +++++++++------ htdocs/compta/bank/card.php | 30 +++++++++++----------- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/theme/eldy/style.css.php | 1 + 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 9acf83db399..f82177e0b21 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $langs->load("banks"); $langs->load("categories"); +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); + $id=GETPOST('account')?GETPOST('account','alpha'):GETPOST('id'); $ref=GETPOST('ref'); @@ -53,6 +56,12 @@ else $year_end=$year_start+2; } + + +/* + * View + */ + $title = $langs->trans("FinancialAccount").' - '.$langs->trans("IOMonthlyReporting"); $helpurl = ""; llxHeader('',$title,$helpurl); @@ -276,10 +285,6 @@ if ($result < 0) } else { - // Definition de $width et $height - $width = 480; - $height = 300; - // Calcul de $min et $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -374,8 +379,8 @@ else $px1->SetMaxValue($px1->GetCeilMaxValue()<0?0:$px1->GetCeilMaxValue()); $px1->SetMinValue($px1->GetFloorMinValue()>0?0:$px1->GetFloorMinValue()); $px1->SetTitle($title); - $px1->SetWidth($width); - $px1->SetHeight($height); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); $px1->SetType(array('line','line','line')); $px1->SetShading(3); $px1->setBgColor('onglet'); @@ -461,8 +466,8 @@ else $px2->SetMaxValue($px2->GetCeilMaxValue()<0?0:$px2->GetCeilMaxValue()); $px2->SetMinValue($px2->GetFloorMinValue()>0?0:$px2->GetFloorMinValue()); $px2->SetTitle($title); - $px2->SetWidth($width); - $px2->SetHeight($height); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); $px2->SetType(array('line','line','line')); $px2->SetShading(3); $px2->setBgColor('onglet'); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index a608a71bf7d..43efcc93d57 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2014-2016 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry @@ -840,11 +840,11 @@ else // Label print ''.$langs->trans("Label").''; - print 'label).'">'; + print 'label).'">'; // Type print ''.$langs->trans("AccountType").''; - print ''; + print ''; $formbank->selectTypeOfBankAccount((isset($_POST["type"])?$_POST["type"]:$object->type),"type"); print ''; @@ -852,7 +852,7 @@ else print ''.$langs->trans("Currency"); print ''; print ''; - print ''; + print ''; $selectedcode=$object->currency_code; if (! $selectedcode) $selectedcode=$conf->currency; print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code'); @@ -862,8 +862,8 @@ else // Status print ''.$langs->trans("Status").''; - print ''; - print $form->selectarray("clos", $object->status,(isset($_POST["clos"])?$_POST["clos"]:$object->clos)); + print ''; + print $form->selectarray("clos", $object->status, (isset($_POST["clos"])?$_POST["clos"]:$object->clos)); print ''; // Country @@ -874,13 +874,13 @@ else $object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print ''.$langs->trans("Country").''; - print ''; + print ''; print $form->select_country($selectedcode,'account_country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''; // State - print ''.$langs->trans('State').''; + print ''.$langs->trans('State').''; if ($selectedcode) { print $formcompany->select_state(isset($_POST["account_state_id"])?$_POST["account_state_id"]:$object->state_id,$selectedcode,'account_state_id'); @@ -909,7 +909,7 @@ else // Web print ''.$langs->trans("Web").''; - print 'url).'">'; + print 'url).'">'; print ''; // Tags-Categories @@ -931,7 +931,7 @@ else print ''; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,70); + $doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,'95%'); $doleditor->Create(); print ''; @@ -1020,22 +1020,22 @@ else // IBAN print ''.$langs->trans($ibankey).''; - print ''; + print ''; print ''.$langs->trans($bickey).''; - print ''; + print ''; print ''.$langs->trans("BankAccountDomiciliation").''; - print ""; print ''.$langs->trans("BankAccountOwner").''; - print ''; + print ''; print ''; print ''.$langs->trans("BankAccountOwnerAddress").''; - print ""; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 29f04d8f82d..c25bc073d1f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -236,7 +236,7 @@ class Account extends CommonObject $this->status = array( self::STATUS_OPEN => $langs->trans("StatusAccountOpened"), - self::STATUS_CLOSED => $langs->trans("StatusAccountOpened") + self::STATUS_CLOSED => $langs->trans("StatusAccountClosed") ); } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f125bd6089b..4f7edd144d2 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -837,6 +837,7 @@ div.fiche { margin-: px; margin-: dol_optimize_smallscreen)?'12':'6')); ?>px; dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?> + dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?> } div.fichecenter { width: 100%;