From 7f5933adbc9f839d7f5be7a7df002743fed3357c Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 23 Oct 2019 15:57:56 +0200 Subject: [PATCH 01/38] FIX shipping extrafields line --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index e24198b9920..be5ed4c757a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -306,7 +306,7 @@ if (empty($reshook)) // Extrafields $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i); + $array_options[$i] = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $i); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -632,7 +632,7 @@ if (empty($reshook)) // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $line->array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $line->array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield POST Data if (is_array($extralabelsline)) { foreach ($extralabelsline as $key => $value) { From dae475bac1164e09882664c6b1596c0e16121c95 Mon Sep 17 00:00:00 2001 From: com4WEB <42214196+com4WEB@users.noreply.github.com> Date: Tue, 29 Oct 2019 12:37:08 +0100 Subject: [PATCH 02/38] Update ChangeLog some text erros in changelog --- ChangeLog | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index c430b258cda..9cb2225cd08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,7 +22,6 @@ FIX: Clean the + of categories on the product view only in POS module FIX: access to public interface when origin email has an alias. FIX: Alias name is not into the email recipient label. FIX: allow standalone credit note even if no invoice -FIX: an admin can not access his own permissions after enabling advanced FIX: an admin can not access his own permissions after enabling advanced permissions FIX: Attachement of linked files on ticket when sending a message FIX: avoid non numeric warning @@ -91,17 +90,17 @@ FIX: #11752 FIX: #11789 FIX: #11790 FIX: #11804 list of tickets from a customer card display ALL tickets FIX: #11834 -FIX: Add char $ and ; in sanitizing of filenames. -FIX: Add comment before protected functions -FIX: Add log and type of content in dolWebsiteOutput and -FIX: Add repair.php option 'restore' to restore user picture after v10 +FIX: add char $ and ; in sanitizing of filenames +FIX: add comment before protected functions +FIX: add log and type of content in dolWebsiteOutput and +FIX: add repair.php option 'restore' to restore user picture after v10 FIX: amount opened on thirdparty card dont care of credit note not converted -FIX: Api of documents work with value 'thirdparty' +FIX: API of documents work with value 'thirdparty' FIX: author in message / ticket API -FIX: avoid sql error if fk_project is empty during update +FIX: avoid SQL error if fk_project is empty during update FIX: avoid Warning: A non-numeric value encountered -FIX: bad consistency in list of invoice for direct debit order. -FIX: Bad error management in zip compress and web site export +FIX: bad consistency in list of invoice for direct debit order +FIX: bad error management in zip compress and web site export FIX: bad substitution for extrafields type checkbox FIX: better help message with multicompany FIX: calculation of $products_dispatched @@ -110,11 +109,11 @@ FIX: Can't delete a draft leave even if it should FIX: Can't save setup of mailman module FIX: column jabberid missing FIX: Confirmation of deletion -FIX: Consistency in direct debit order lists. +FIX: Consistency in direct debit order lists FIX: Content send before header warning FIX: credit note can be split FIX: credit note used on list -FIX: Css was saved on wrong website. +FIX: CSS was saved on wrong website FIX: delivery extrafields FIX: Disabling a website does not put it offline FIX: display only stripe sources for customer @@ -131,13 +130,13 @@ FIX: Fatal situation if payment removed on expense report. Action FIX: filepath of generated documents doesn't handle products with special characters FIX: for MAIN_MAXTABS_IN_CARD = $i card FIX: gzip and bzip2 must use option -f -FIX: It was possible to create cashfence without entering data. +FIX: it was possible to create cashfence without entering data FIX: javascript error when using dol_use_jmobile=1 FIX: logout redirect to takepos.php FIX: Look and feel v10 FIX: Make protected all pfd models functions FIX: management of extrafields in modulebuilder -FIX: Missing div for buttons in tax, loan, various payment modules +FIX: missing div for buttons in tax, loan, various payment modules FIX: missing include (dol_convert_file not found) FIX: Missing some replacements in website module FIX: missing test on permission on button to delete ledger record @@ -161,13 +160,13 @@ FIX: Return code of pdf_einstein.modules.php and proformat FIX: round for application fee in stripe FIX: Sens of the balance (Debit - Credit in accountancy not contrary) FIX: Several pb in export of documents -FIX: SQL syntax error and CSRF check on vat reports +FIX: SQL syntax error and CSRF check on VAT reports FIX: takepos layout clear or focus search -FIX: too many record in sql request. Whena criteria is a filter, we must +FIX: too many record in sql request. When a criteria is a filter, we must FIX: Translation of month FIX: USEDOLIBARREDITOR not always set FIX: VAT number for Monaco (it uses FR) -FIX: vulenrability in uploading file found by 美创科技安全实验室 +FIX: vulnerability in uploading file found by 美创科技安全实验室 FIX: wrong display (and hidden input) for already dispatched quantity FIX: wrong parameters (same error in branch 9, 10, develop) FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES From db86dff7d16bd7d03ae92ae8dff0e0dfd08af55e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 29 Oct 2019 17:10:10 +0100 Subject: [PATCH 03/38] Fix sign for VAT repaid in report --- htdocs/compta/resultat/clientfourn.php | 10 +++++----- htdocs/compta/resultat/index.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index efeffeb9b8c..2b74c167d83 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -1132,11 +1132,11 @@ else while ($i < $num) { $obj = $db->fetch_object($result); - $amount += $obj->amount; - $total_ht += $obj->amount; - $total_ttc += $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; + $amount += -$obj->amount; + $total_ht += -$obj->amount; + $total_ttc += -$obj->amount; + $subtotal_ht += -$obj->amount; + $subtotal_ttc += -$obj->amount; $i++; } diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 70129e80403..d12587eea6e 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -480,10 +480,10 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $obj = $db->fetch_object($result); if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; - $encaiss[$obj->dm] += $obj->amount; + $encaiss[$obj->dm] += -$obj->amount; if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; - $encaiss_ttc[$obj->dm] += $obj->amount; + $encaiss_ttc[$obj->dm] +=-$obj->amount; $i++; } From 8849cd9897a0cface1198a6108c12820b75b3ad0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Oct 2019 02:19:32 +0100 Subject: [PATCH 04/38] Update index.php --- htdocs/compta/resultat/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index d12587eea6e..d40f00a9c42 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -483,7 +483,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $encaiss[$obj->dm] += -$obj->amount; if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; - $encaiss_ttc[$obj->dm] +=-$obj->amount; + $encaiss_ttc[$obj->dm] += -$obj->amount; $i++; } From 15d0d6e2717006575d14a70bad970725eb50dea0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Oct 2019 02:39:51 +0100 Subject: [PATCH 05/38] FIX #12258 --- htdocs/contact/card.php | 12 ++++++------ htdocs/contact/class/contact.class.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index aaf1cd0a2b9..12e7db0f2b4 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -179,7 +179,7 @@ if (empty($reshook)) $object->socid = GETPOST("socid", 'int'); $object->lastname = GETPOST("lastname", 'alpha'); $object->firstname = GETPOST("firstname", 'alpha'); - $object->civility_id = GETPOST("civility_id", 'alpha'); + $object->civility_code = GETPOST("civility_code", 'alpha'); $object->poste = GETPOST("poste", 'alpha'); $object->address = GETPOST("address", 'alpha'); $object->zip = GETPOST("zipcode", 'alpha'); @@ -366,7 +366,7 @@ if (empty($reshook)) $object->socid = GETPOST("socid", 'int'); $object->lastname = GETPOST("lastname", 'alpha'); $object->firstname = GETPOST("firstname", 'alpha'); - $object->civility_id = GETPOST("civility_id", 'alpha'); + $object->civility_code = GETPOST("civility_code", 'alpha'); $object->poste = GETPOST("poste", 'alpha'); $object->address = GETPOST("address", 'alpha'); @@ -619,8 +619,8 @@ else } // Civility - print ''; - print $formcompany->select_civility(GETPOST("civility", 'alpha')?GETPOST("civility", 'alpha'):$object->civility_code); + print ''; + print $formcompany->select_civility(GETPOSTISSET("civility_code")?GETPOST("civility_code", 'alpha'):$object->civility_code, 'civility_code'); print ''; print ''; @@ -918,8 +918,8 @@ else } // Civility - print ''; - print $formcompany->select_civility(isset($_POST["civility"])?GETPOST("civility"):$object->civility_code); + print ''; + print $formcompany->select_civility(GETPOSTISSET("civility_code")?GETPOST("civility", "aZ09"):$object->civility_code, 'civility_code'); print ''; print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index eb25d0ad712..109b6298499 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -325,13 +325,13 @@ class Contact extends CommonObject $this->town=(empty($this->town)?'':$this->town); $this->country_id=($this->country_id > 0?$this->country_id:$this->country_id); if (empty($this->statut)) $this->statut = 0; - + if (empty($this->civility_code) && ! is_numeric($this->civility_id)) $this->civility_code = $this->civility_id; // For backward compatibility $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET "; if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',"; elseif ($this->socid == -1) $sql .= " fk_soc=null,"; - $sql .= " civility='".$this->db->escape($this->civility_id)."'"; + $sql .= " civility='".$this->db->escape($this->civility_code)."'"; $sql .= ", lastname='".$this->db->escape($this->lastname)."'"; $sql .= ", firstname='".$this->db->escape($this->firstname)."'"; $sql .= ", address='".$this->db->escape($this->address)."'"; From bc2a949bab5aae13a21eb915772c23f17017dbc3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 16:47:27 +0100 Subject: [PATCH 06/38] New Add option to disable idempotency when using Stripe payments. --- htdocs/public/payment/newpayment.php | 8 ++++++-- htdocs/stripe/class/stripe.class.php | 25 ++++++++++++++----------- htdocs/stripe/config.php | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 067c371bf67..4a3d08f6602 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1725,6 +1725,7 @@ if ($action != 'dopayment') { // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe print '
'; + print ''; print '
'; print ''.$langs->trans("CreditOrDebitCard").''; print '
'; @@ -1858,12 +1859,12 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment $service = 'StripeLive'; $servicestatus = 1; - if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')) { $service = 'StripeTest'; $servicestatus = 0; } + $stripe = new Stripe($db); $stripeacc = $stripe->getStripeAccount($service); $stripecu = null; @@ -1871,7 +1872,10 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { - $paymentintent=$stripe->getPaymentIntent($amount, $currency, $tag, 'Stripe payment: '.$fulltag.(is_object($object)?' ref='.$object->ref:''), $object, $stripecu, $stripeacc, $servicestatus); + $noidempotency_key = (GETPOSTISSET('noidempotency') ? GETPOST('noidempotency', 'int') : 0); // By default noidempotency is unset, so we must use a different tag/ref for each payment. If set, we can pay several times the same tag/ref. + $paymentintent=$stripe->getPaymentIntent($amount, $currency, $tag, 'Stripe payment: '.$fulltag.(is_object($object)?' ref='.$object->ref:''), $object, $stripecu, $stripeacc, $servicestatus, 0, 'automatic', false, null, 0, $noidempotency_key); + // The paymentintnent has status 'requires_payment_method' (even if paymentintent was already payed) + //var_dump($paymentintent); if ($stripe->error) setEventMessages($stripe->error, null, 'errors'); } } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 021a9fac1f9..c30e3169ee5 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -318,9 +318,10 @@ class Stripe extends CommonObject * @param boolean $confirmnow false=default, true=try to confirm immediatly after create (if conditions are ok) * @param string $payment_method 'pm_....' (if known) * @param string $off_session If we use an already known payment method to pay off line. + * @param string $noidempotency_key Do not use the idempotency_key when creating the PaymentIntent * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found and failed to create */ - public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0) + public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 0) { global $conf; @@ -352,9 +353,10 @@ class Stripe extends CommonObject if (is_object($object)) { // Warning. If a payment was tried and failed, a payment intent was created. - // But if we change someting on object to pay (amount or other), reusing same payment intent is not allowed. - // Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay), - // that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old that will not be used) + // But if we change someting on object to pay (amount or other that does not change the idempotency key), reusing same payment intent is not allowed. + // Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay), Stripe will + // automatically return the existing payment intent if idempotency is provided when we try to create the new one. + // That's why we can comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old ones that will not be used) /* $sql = "SELECT pi.ext_payment_id, pi.entity, pi.fk_facture, pi.sourcetype, pi.ext_payment_site"; $sql.= " FROM " . MAIN_DB_PREFIX . "prelevement_facture_demande as pi"; @@ -445,14 +447,15 @@ class Stripe extends CommonObject global $stripearrayofkeysbyenv; \Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$status]['secret_key']); - // Note: If all data for payment intent are same than a previous on, even if we use 'create', Stripe will return ID of the old existing payment intent. - if (empty($key)) { // If the Stripe connect account not set, we use common API usage - $paymentintent = \Stripe\PaymentIntent::create($dataforintent, array("idempotency_key" => "$description")); - //$paymentintent = \Stripe\PaymentIntent::create($dataforintent, array()); - } else { - $paymentintent = \Stripe\PaymentIntent::create($dataforintent, array("idempotency_key" => "$description", "stripe_account" => $key)); - //$paymentintent = \Stripe\PaymentIntent::create($dataforintent, array("stripe_account" => $key)); + $arrayofoptions = array(); + if (empty($noidempotency_key)) { + $arrayofoptions["idempotency_key"] = $description; } + // Note: If all data for payment intent are same than a previous on, even if we use 'create', Stripe will return ID of the old existing payment intent. + if (! empty($key)) { // If the Stripe connect account not set, we use common API usage + $arrayofoptions["stripe_account"] = $key; + } + $paymentintent = \Stripe\PaymentIntent::create($dataforintent, $arrayofoptions); // Store the payment intent if (is_object($object)) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 0030bdb5535..1070f605eb8 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/includes/stripe/init.php'; require_once DOL_DOCUMENT_ROOT.'/includes/stripe/lib/Stripe.php'; -global $stripe; +//global $stripe; global $conf; global $stripearrayofkeysbyenv; From 349175580a9a33c724c16ee1576cf64c0a0d591b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 16:53:55 +0100 Subject: [PATCH 07/38] Can force Stripe API version from setup --- htdocs/stripe/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 1070f605eb8..84766f8e206 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -55,4 +55,4 @@ else \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); \Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version -\Stripe\Stripe::setApiVersion("2019-05-16"); // force version API +\Stripe\Stripe::setApiVersion(empty($conf->global->STRIPE_FORCE_VERSION)?"2019-05-16":$conf->global->STRIPE_FORCE_VERSION); // force version API From 628018ca2b8948e0d5398f806a0c98931cf6b351 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 17:31:45 +0100 Subject: [PATCH 08/38] css --- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ad0f68bee43..aeb1cbf70c9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2756,6 +2756,7 @@ table.listwithfilterbefore { .tagtable, .table-border { display: table; } .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } +.confirmquestions .tagtr .tagtd:not(:first-child) { padding-left: 10px; } /* Pagination */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index df88a655280..d1a1c2025c0 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2840,6 +2840,8 @@ table.listwithfilterbefore { .tagtable, .table-border { display: table; } .tagtr, .table-border-row { display: table-row; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } +.confirmquestions .tagtr .tagtd:not(:first-child) { padding-left: 10px; } + /* Pagination */ div.refidpadding { From f98df3c8077b8aeacf1e69862d4bbb029e13a0fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 21:09:33 +0100 Subject: [PATCH 09/38] NEW Can edit link to the translation page in website module --- htdocs/admin/website.php | 2 +- htdocs/core/class/html.formwebsite.class.php | 74 ++++++- htdocs/core/lib/functions.lib.php | 5 +- htdocs/langs/en_US/website.lang | 3 +- htdocs/theme/eldy/global.inc.php | 5 + htdocs/theme/md/style.css.php | 6 + htdocs/ticket/css/styles.css.php | 2 +- htdocs/website/class/website.class.php | 54 +++--- htdocs/website/class/websitepage.class.php | 87 +++++---- htdocs/website/index.php | 194 +++++++++---------- 10 files changed, 253 insertions(+), 179 deletions(-) diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 0343fecf69d..5ea6ee66dd9 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -421,7 +421,7 @@ $h++; dol_fiche_head($head, 'website', '', -1); -print $langs->trans("WebsiteSetupDesc").'
'; +print ''.$langs->trans("WebsiteSetupDesc").'
'; print "
\n"; diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 6fc00605d77..12ec3e7f5ad 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -47,7 +47,7 @@ class FormWebsite /** - * Return HTML select list of export models + * Return HTML select list of websites * * @param string $selected Id modele pre-selectionne * @param string $htmlname Name of HTML select @@ -99,7 +99,7 @@ class FormWebsite /** - * Return a HTML select list of a dictionary + * Return a HTML select list of type of containers from the dictionary * * @param string $htmlname Name of select zone * @param string $selected Selected value @@ -162,7 +162,7 @@ class FormWebsite /** - * Return a HTML select list of type of containers + * Return a HTML select list of samples of containers content * * @param string $htmlname Name of select zone * @param string $selected Selected value @@ -217,4 +217,72 @@ class FormWebsite return $out; } + + + /** + * Return a HTML select list of containers of a website. + * Note: $website->lines must have been loaded. + * + * @param Website $website Object Website + * @param string $htmlname Name of select zone + * @param int $pageid Preselected container ID + * @param int $showempty Show empty record + * @param string $action Action on page that use this select list + * @return string HTML select component with list of type of containers + */ + public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '') + { + global $langs; + + $atleastonepage = (is_array($website->lines) && count($website->lines) > 0); + + $out=''; + if ($atleastonepage && $action != 'editsource') + { + $out.=''; + } + + if ($showempty || ! $atleastonepage) $out.=''; + + if ($atleastonepage) + { + if (empty($pageid) && $action != 'createcontainer') // Page id is not defined, we try to take one + { + $firstpageid=0;$homepageid=0; + foreach($website->lines as $key => $valpage) + { + if (empty($firstpageid)) $firstpageid=$valpage->id; + if ($website->fk_default_home && $key == $website->fk_default_home) $homepageid=$valpage->id; + } + $pageid=$homepageid?$homepageid:$firstpageid; // We choose home page and if not defined yet, we take first page + } + + foreach($website->lines as $key => $valpage) + { + $out.=''; + } + } + $out.=''; + + if ($atleastonepage && $action != 'editsource') + { + $out.=ajax_combobox($htmlname); + } + else + { + $out.=''; + $out.=ajax_combobox($htmlname); + } + return $out; + } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ca6a4a93e4e..4d4a20f3a5c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3028,7 +3028,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', - 'address', 'bank', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', 'bookmark', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', + 'address', 'bank', 'bookmark', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', + 'filter', 'file-code', 'grip', 'grip_title', 'list', 'listlight', 'note', 'object_list','object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', @@ -3058,12 +3059,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $morecss .= ($morecss ? ' ' : '').('picto'.$pictowithouttext); } elseif ($pictowithouttext == 'switch_off') { $facolor = '#999'; - $fasize = '2em'; $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; } elseif ($pictowithouttext == 'switch_on') { $facolor = '#227722'; - $fasize = '2em'; $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; } elseif ($pictowithouttext == 'off') { diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index be758c04890..62ce5a23531 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -117,4 +117,5 @@ ImportSite=Import site EditInLineOnOff=Mode 'Edit inline' is %s ShowSubContainersOnOff=Mode to execute 'dynamic content' is %s GlobalCSSorJS=Global CSS/JS/Header file of web site -BackToHomePage=Back to home page... \ No newline at end of file +BackToHomePage=Back to home page... +TranslationLinks=Translation links \ No newline at end of file diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index aeb1cbf70c9..c3bbc92af9c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -488,6 +488,9 @@ textarea.centpercent { .backgroundblank { background-color: #fff; } +.nobackground, .nobackground tr { + background: unset !important; +} .checkboxattachfilelabel { font-size: 0.85em; opacity: 0.7; @@ -517,6 +520,8 @@ body[class*="colorblind-"] .text-success{ color: rgb() !important; } +.fa-toggle-on, .fa-toggle-off { font-size: 2em; } +.websiteselectionsection .fa-toggle-on, .websiteselectionsection .fa-toggle-off { font-size: 1.5em; vertical-align: text-bottom; } /* Themes for badges */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d1a1c2025c0..320a03c2775 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -691,6 +691,9 @@ textarea.centpercent { .backgroundblank { background-color: #fff; } +.nobackground, .nobackground tr { + background: unset !important; +} .checkboxattachfilelabel { font-size: 0.85em; opacity: 0.7; @@ -720,6 +723,9 @@ body[class*="colorblind-"] .text-success{ color: rgb() !important; } +.fa-toggle-on, .fa-toggle-off { font-size: 2em; } +.websiteselectionsection .fa-toggle-on, .websiteselectionsection .fa-toggle-off { font-size: 1.5em; vertical-align: text-bottom; } + /* Themes for badges */ diff --git a/htdocs/ticket/css/styles.css.php b/htdocs/ticket/css/styles.css.php index 1d0626d190b..906d50602a1 100644 --- a/htdocs/ticket/css/styles.css.php +++ b/htdocs/ticket/css/styles.css.php @@ -31,7 +31,7 @@ if (! defined('NOLOGIN')) define('NOLOGIN', 1); // File must be if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); -session_cache_limiter(false); +session_cache_limiter('public'); require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index bd54b93438f..ac99001bf4b 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -92,6 +92,17 @@ class Website extends CommonObject */ public $virtualhost; + /** + * List of containers + * + * @var array + */ + public $lines; + + + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + /** * Constructor @@ -229,10 +240,10 @@ class Website extends CommonObject $sql .= " t.tms as date_modification"; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; $sql .= ' WHERE t.entity IN ('.getEntity('website').')'; - if (null !== $ref) { + if (! empty($ref)) { $sql .= " AND t.ref = '" . $this->db->escape($ref) . "'"; } else { - $sql .= ' AND t.rowid = ' . $id; + $sql .= ' AND t.rowid = ' . (int) $id; } $resql = $this->db->query($sql); @@ -691,8 +702,8 @@ class Website extends CommonObject $companylink = ''; $label = '' . $langs->trans("WebSite") . ''; - $label.= '
'; - $label.= '' . $langs->trans('Nom') . ': ' . $this->ref; + $label.= '
'; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; $linkstart = 'labelstatus) || empty($this->labelstatusshort)) { - if ($status == 1) return $langs->trans('Enabled'); - elseif ($status == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 2) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 3) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5'); - } - elseif ($mode == 4) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 5) - { - if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); - elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); + global $langs; + //$langs->load("mymodule"); + $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelstatusshort[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelstatusshort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); } + + $statusType = 'status5'; + if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + + return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); } diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 870e300e650..e85af6244e3 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -47,7 +47,7 @@ class WebsitePage extends CommonObject /** * @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png */ - public $picto = 'label'; + public $picto = 'file-code'; /** * @var int ID @@ -88,6 +88,11 @@ class WebsitePage extends CommonObject public $date_modification; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + + + // BEGIN MODULEBUILDER PROPERTIES /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. @@ -480,25 +485,39 @@ class WebsitePage extends CommonObject global $menumanager; $result = ''; - $companylink = ''; $label = '' . $langs->trans("Page") . ''; - $label.= '
'; - $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; + $label.= '
'; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref.'
'; + $label.= '' . $langs->trans('ID') . ': ' . $this->id.'
'; + $label.= '' . $langs->trans('Title') . ': ' . $this->title; - $linkstart = '
fk_website.'&pageid='.$this->id; + + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowMyObject"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } + else $linkclose = ($morecss?' class="'.$morecss.'"':''); + + $linkstart = ''; $linkend=''; - $linkstart = $linkend = ''; + //$linkstart = $linkend = ''; + + $result .= $linkstart; + if ($withpicto) $result.=img_picto(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + if ($withpicto != 2) $result.= $this->ref; + $result .= $linkend; - if ($withpicto) - { - $result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend); - if ($withpicto != 2) $result.=' '; - } - $result.= $linkstart . $this->ref . $linkend; return $result; } @@ -526,36 +545,20 @@ class WebsitePage extends CommonObject // phpcs:enable global $langs; - if ($mode == 0) + if (empty($this->labelstatus) || empty($this->labelstatusshort)) { - if ($status == 1) return $langs->trans('Enabled'); - elseif ($status == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 1) - { - if ($status == 1) return $langs->trans('Enabled'); - elseif ($status == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 2) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 3) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5'); - } - elseif ($mode == 4) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 5) - { - if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); - elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); + global $langs; + //$langs->load("mymodule"); + $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelstatusshort[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelstatusshort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); } + + $statusType = 'status5'; + if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + + return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 56b3a0c8cb3..afc85a9c213 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -46,6 +46,7 @@ if (! $user->rights->website->read) accessforbidden(); $conf->dol_hide_leftmenu = 1; // Force hide of left menu. $error=0; +$websiteid=GETPOST('websiteid', 'int'); $websitekey=GETPOST('website', 'alpha'); $page=GETPOST('page', 'alpha'); $pageid=GETPOST('pageid', 'int'); @@ -101,7 +102,7 @@ $objectpage=new WebsitePage($db); $object->fetchAll(); // Init $object->records with list of websites // If website not defined, we take first found -if (empty($websitekey)) +if (! ($websiteid > 0) && empty($websitekey)) { foreach($object->records as $key => $valwebsite) { @@ -109,10 +110,12 @@ if (empty($websitekey)) break; } } -if ($websitekey) +if ($websiteid > 0 || $websitekey) { - $res = $object->fetch(0, $websitekey); + $res = $object->fetch($websiteid, $websitekey); + $websitekey = $object->ref; } + $website = $object; // Check pageid received as aprameter @@ -418,7 +421,7 @@ if ($action == 'addcontainer') $db->begin(); $objectpage->fk_website = $object->id; - if (GETPOST('fetchexternalurl', 'alpha')) + if (GETPOSTISSET('fetchexternalurl')) { $urltograb=GETPOST('externalurl', 'alpha'); $grabimages=GETPOST('grabimages', 'alpha'); @@ -426,12 +429,18 @@ if ($action == 'addcontainer') //var_dump($grabimages);exit; } - if ($urltograb) + if (GETPOSTISSET('fetchexternalurl')) { include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - //if (! preg_match('/^http/', $urltograb) && ! preg_match('/^file/', $urltograb)) - if (! preg_match('/^http/', $urltograb)) + if (empty($urltograb)) + { + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("URL")), null, 'errors'); + $action = 'createcontainer'; + } + elseif (! preg_match('/^http/', $urltograb)) { $error++; $langs->load("errors"); @@ -1372,6 +1381,8 @@ if ($action == 'updatemeta') $objectpage->keywords = GETPOST('WEBSITE_KEYWORDS', 'alpha'); $objectpage->lang = GETPOST('WEBSITE_LANG', 'aZ09'); $objectpage->htmlheader = trim(GETPOST('htmlheader', 'none')); + $objectpage->fk_page = GETPOST('pageidfortranslation', 'int'); + $newdatecreation=dol_mktime(GETPOST('datecreationhour', 'int'), GETPOST('datecreationmin', 'int'), GETPOST('datecreationsec', 'int'), GETPOST('datecreationmonth', 'int'), GETPOST('datecreationday', 'int'), GETPOST('datecreationyear', 'int')); if ($newdatecreation) $objectpage->date_creation = $newdatecreation; @@ -2006,6 +2017,7 @@ if (! GETPOST('hide_websitemenu')) if ($object->id > 0) { $array=$objectpage->fetchAll($object->id, 'ASC,ASC', 'type_container,pageurl'); + $object->lines = $array; } if (! is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors); $atleastonepage=(is_array($array) && count($array) > 0); @@ -2019,13 +2031,13 @@ if (! GETPOST('hide_websitemenu')) print ''; - if (! $atleastonepage) + if ($atleastonepage) { - print ''; + print ''; } else { - print ''; + print ''; } //print ''; @@ -2137,55 +2149,11 @@ if (! GETPOST('hide_websitemenu')) print ''; print ''; - print ''; + //print ''; if ($action != 'addcontainer') { - $out=''; - if ($atleastonepage && $action != 'editsource') - { - $out.=''; - } - if ($atleastonepage) - { - if (empty($pageid) && $action != 'createcontainer') // Page id is not defined, we try to take one - { - $firstpageid=0;$homepageid=0; - foreach($array as $key => $valpage) - { - if (empty($firstpageid)) $firstpageid=$valpage->id; - if ($object->fk_default_home && $key == $object->fk_default_home) $homepageid=$valpage->id; - } - $pageid=$homepageid?$homepageid:$firstpageid; // We choose home page and if not defined yet, we take first page - } - - foreach($array as $key => $valpage) - { - $out.=''; - } - } - else $out.=''; - $out.=''; - if ($atleastonepage && $action != 'editsource') - { - $out.=ajax_combobox('pageid'); - } - else - { - $out.=''; - $out.=ajax_combobox('pageid'); - } - print $out; + print $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action); } else { @@ -2298,7 +2266,7 @@ if (! GETPOST('hide_websitemenu')) print ''."\n"; print '
'; - print '
'; + print ''; - print '
'; + print ''; @@ -2405,7 +2373,7 @@ if (! GETPOST('hide_websitemenu')) } } - print ''; // end website selection + //print ''; // end website selection print ''; @@ -2888,12 +2856,24 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''."\n"; //print '
'; + $hiddenfromfetchingafterload = ' hideobject'; + $hiddenmanuallyafterload = ' hideobject'; + if (GETPOST('radiocreatefrom') == 'checkboxcreatefromfetching') $hiddenfromfetchingafterload = ''; + if (GETPOST('radiocreatefrom') == 'checkboxcreatemanually') $hiddenmanuallyafterload = ''; + + if ($action == 'editmeta' || empty($conf->use_javascript_ajax)) { // No autohide/show in such case + $hiddenfromfetchingafterload=''; + $hiddenmanuallyafterload=''; + } + if ($action == 'createcontainer') { print '
'; - print ' * '.$langs->trans("CreateByFetchingExternalPage").'

'; - print ''; + if (! empty($conf->use_javascript_ajax)) print ' '; + print '
'; + print '
'; + print '
'; print ''; print ''; print ''; print ''; From c215d534fc7a64f25acb9a17b6ce45e3188a3f28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 21:16:41 +0100 Subject: [PATCH 10/38] Fix phpcs --- htdocs/comm/action/index.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php | 2 +- htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php | 2 +- htdocs/don/payment/payment.php | 2 +- htdocs/societe/canvas/company/tpl/card_edit.tpl.php | 1 - htdocs/societe/canvas/individual/tpl/card_edit.tpl.php | 4 ++-- htdocs/ticket/class/api_tickets.class.php | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9ad3ef80dde..569b57ca552 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1735,7 +1735,7 @@ function sort_events_by_date($a, $b) } // If both events have the same start time, longest first - + if(! is_numeric($b->datef)) { // when event B have no end timestamp, event B should sort be before event A (All day events on top) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 07d51105ca8..711e65edaaa 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1851,7 +1851,7 @@ function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '' if (! dol_is_file($fileoutput) || is_writeable($fileoutput)) { try { - $ret = $image->writeImages($fileoutput, true); + $ret = $image->writeImages($fileoutput, true); } catch(Exception $e) { diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 3c371c39491..acbb2ae0b36 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -479,7 +479,7 @@ class doc_generic_bom_odt extends ModelePDFBOMs } else { try { - $odfHandler->saveToDisk($file); + $odfHandler->saveToDisk($file); } catch (Exception $e) { $this->error=$e->getMessage(); dol_syslog($e->getMessage(), LOG_INFO); diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 6d85bfd3553..9beb300ebb0 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -486,7 +486,7 @@ class doc_generic_mo_odt extends ModelePDFMOs } else { try { - $odfHandler->saveToDisk($file); + $odfHandler->saveToDisk($file); } catch (Exception $e) { $this->error=$e->getMessage(); dol_syslog($e->getMessage(), LOG_INFO); diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 71895a7d2c3..612ea5a553b 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -240,7 +240,7 @@ if (GETPOST('action', 'aZ09') == 'create') /* * List of payments on donation */ - + $num = 1; $i = 0; diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 11100c79d75..b26f19204bb 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -23,7 +23,6 @@ if (empty($conf) || ! is_object($conf)) exit; } - $contact = $GLOBALS['objcanvas']->control->object; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 6f3628d93b7..b69e9e8370b 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -75,7 +75,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_customercode']) { ?> - control->tpl['customercode']; ?> + control->tpl['customercode']; ?> @@ -96,7 +96,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_suppliercode']) { ?> - control->tpl['suppliercode']; ?> + control->tpl['suppliercode']; ?> diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 4289fab99dc..c95b092cf2e 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -435,7 +435,7 @@ class Tickets extends DolibarrApi throw new RestException(500); } - return array( + return array( 'success' => array( 'code' => 200, 'message' => 'Ticket deleted' From a1700e71be3a1fc48a418926001003c438cd87bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 21:18:38 +0100 Subject: [PATCH 11/38] Fix phpcs --- htdocs/compta/facture/class/api_invoices.class.php | 2 +- htdocs/fourn/class/api_supplier_orders.class.php | 2 +- htdocs/modulebuilder/template/class/api_mymodule.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 25d92fad92a..da5ad40002b 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -565,7 +565,7 @@ class Invoices extends DolibarrApi throw new RestException(500); } - return array( + return array( 'success' => array( 'code' => 200, 'message' => 'Invoice deleted' diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index c09c62a4714..2ab90bcd73b 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -273,7 +273,7 @@ class SupplierOrders extends DolibarrApi throw new RestException(500); } - return array( + return array( 'success' => array( 'code' => 200, 'message' => 'Supplier order deleted' diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index bc3b6c4050c..2cfcd269b62 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -271,7 +271,7 @@ class MyModuleApi extends DolibarrApi throw new RestException(500, 'Error when deleting MyObject : '.$this->myobject->error); } - return array( + return array( 'success' => array( 'code' => 200, 'message' => 'MyObject deleted' From 0e7a8680870cb3d374bbbe3c794dcb4d3d793279 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 21:27:25 +0100 Subject: [PATCH 12/38] translation og pages --- htdocs/website/index.php | 53 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index afc85a9c213..e0e3378bf26 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3000,10 +3000,36 @@ if ($action == 'editmeta' || $action == 'createcontainer') // Translation of $translationof=0; + $translatedby=0; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; $i++; } diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 074216dee3e..0d054402b7a 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -132,8 +132,8 @@ class DolibarrApi unset($object->statuts_short); unset($object->statuts_logo); unset($object->statuts_long); - unset($object->labelstatut); - unset($object->labelstatut_short); + unset($object->labelStatus); + unset($object->labelStatusShort); unset($object->element); unset($object->fk_element); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 444caa2a4da..bd5eb4513d2 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -809,19 +809,19 @@ class BOM extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus)) + if (empty($this->labelStatus)) { global $langs; //$langs->load("mrp"); - $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); } $statusType = 'status'.$status; if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; - return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatus[$status], '', $statusType, $mode); } /** diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a2b89dedb11..8d84d1f4820 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -192,8 +192,8 @@ class Propal extends CommonObject public $lines = array(); public $line; - public $labelstatut=array(); - public $labelstatut_short=array(); + public $labelStatus=array(); + public $labelStatusShort=array(); public $specimen; @@ -3210,20 +3210,20 @@ class Propal extends CommonObject global $conf; // Init/load array of translation of status - if (empty($this->labelstatut) || empty($this->labelstatut_short)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; $langs->load("propal"); - $this->labelstatut[0]=$langs->trans("PropalStatusDraft"); - $this->labelstatut[1]=$langs->trans("PropalStatusValidated"); - $this->labelstatut[2]=$langs->trans("PropalStatusSigned"); - $this->labelstatut[3]=$langs->trans("PropalStatusNotSigned"); - $this->labelstatut[4]=$langs->trans("PropalStatusBilled"); - $this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort"); - $this->labelstatut_short[1]=$langs->trans("PropalStatusValidatedShort"); - $this->labelstatut_short[2]=$langs->trans("PropalStatusSignedShort"); - $this->labelstatut_short[3]=$langs->trans("PropalStatusNotSignedShort"); - $this->labelstatut_short[4]=$langs->trans("PropalStatusBilledShort"); + $this->labelStatus[0]=$langs->trans("PropalStatusDraft"); + $this->labelStatus[1]=$langs->trans("PropalStatusValidated"); + $this->labelStatus[2]=$langs->trans("PropalStatusSigned"); + $this->labelStatus[3]=$langs->trans("PropalStatusNotSigned"); + $this->labelStatus[4]=$langs->trans("PropalStatusBilled"); + $this->labelStatusShort[0]=$langs->trans("PropalStatusDraftShort"); + $this->labelStatusShort[1]=$langs->trans("PropalStatusValidatedShort"); + $this->labelStatusShort[2]=$langs->trans("PropalStatusSignedShort"); + $this->labelStatusShort[3]=$langs->trans("PropalStatusNotSignedShort"); + $this->labelStatusShort[4]=$langs->trans("PropalStatusBilledShort"); } $statusType=''; @@ -3233,7 +3233,7 @@ class Propal extends CommonObject elseif ($statut==self::STATUS_NOTSIGNED) $statusType='status5'; elseif ($statut==self::STATUS_BILLED) $statusType='status6'; - return dolGetStatus($this->labelstatut[$statut], $this->labelstatut_short[$statut], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$statut], $this->labelStatusShort[$statut], '', $statusType, $mode); } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4cc922a8cbf..261190a747e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3484,48 +3484,48 @@ class Commande extends CommonOrder if (empty($donotshowbilled)) $billedtext .= ($billed?' - '.$langs->trans("Billed"):''); if ($statut==self::STATUS_CANCELED){ - $labelstatut = $langs->trans('StatusOrderCanceled'); - $labelstatutShort = $langs->trans('StatusOrderCanceledShort'); + $labelStatus = $langs->trans('StatusOrderCanceled'); + $labelStatusShort = $langs->trans('StatusOrderCanceledShort'); $statusType='status5'; } elseif ($statut==self::STATUS_DRAFT){ - $labelstatut = $langs->trans('StatusOrderDraft'); - $labelstatutShort = $langs->trans('StatusOrderDraftShort'); + $labelStatus = $langs->trans('StatusOrderDraft'); + $labelStatusShort = $langs->trans('StatusOrderDraftShort'); $statusType='status0'; } elseif ($statut==self::STATUS_VALIDATED){ - $labelstatut = $langs->trans('StatusOrderValidated').$billedtext; - $labelstatutShort = $langs->trans('StatusOrderValidatedShort').$billedtext; + $labelStatus = $langs->trans('StatusOrderValidated').$billedtext; + $labelStatusShort = $langs->trans('StatusOrderValidatedShort').$billedtext; $statusType='status1'; } elseif ($statut==self::STATUS_SHIPMENTONPROCESS){ - $labelstatut = $langs->trans('StatusOrderSentShort').$billedtext; - $labelstatutShort = $langs->trans('StatusOrderSentShort').$billedtext; + $labelStatus = $langs->trans('StatusOrderSentShort').$billedtext; + $labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext; $statusType='status3'; } elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){ - $labelstatut = $langs->trans('StatusOrderToBill'); - $labelstatutShort = $langs->trans('StatusOrderToBillShort'); + $labelStatus = $langs->trans('StatusOrderToBill'); + $labelStatusShort = $langs->trans('StatusOrderToBillShort'); $statusType='status4'; } elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){ - $labelstatut = $langs->trans('StatusOrderProcessed').$billedtext; - $labelstatutShort = $langs->trans('StatusOrderProcessed').$billedtext; + $labelStatus = $langs->trans('StatusOrderProcessed').$billedtext; + $labelStatusShort = $langs->trans('StatusOrderProcessed').$billedtext; $statusType='status6'; } elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))){ - $labelstatut = $langs->trans('StatusOrderDelivered'); - $labelstatutShort = $langs->trans('StatusOrderDelivered'); + $labelStatus = $langs->trans('StatusOrderDelivered'); + $labelStatusShort = $langs->trans('StatusOrderDelivered'); $statusType='status6'; } else{ - $labelstatut = $langs->trans('Unknown'); - $labelstatutShort = ''; + $labelStatus = $langs->trans('Unknown'); + $labelStatusShort = ''; $statusType=''; $mode = 0; } - return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode); + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 354b50365ca..06331dc0f2b 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -311,20 +311,20 @@ class CashControl extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus) || empty($this->labelstatusshort)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelstatus[0] = $langs->trans('Draft'); - $this->labelstatus[1] = $langs->trans('Closed'); - $this->labelstatusshort[0] = $langs->trans('Draft'); - $this->labelstatusshort[1] = $langs->trans('Closed'); + $this->labelStatus[0] = $langs->trans('Draft'); + $this->labelStatus[1] = $langs->trans('Closed'); + $this->labelStatusShort[0] = $langs->trans('Draft'); + $this->labelStatusShort[1] = $langs->trans('Closed'); } $statusType = 'status0'; if ($status == self::STATUS_VALIDATED) $statusType = 'status6'; - return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } /** diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 4016ebdc813..3058d418237 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -69,7 +69,7 @@ class BonPrelevement extends CommonObject public $total; public $fetched; public $statut; // 0-Wait, 1-Trans, 2-Done - public $labelstatut=array(); + public $labelStatus=array(); public $invoice_in_error=array(); public $thirdparty_in_error=array(); @@ -2002,48 +2002,48 @@ class BonPrelevement extends CommonObject public function LibStatut($statut, $mode = 0) { // phpcs:enable - if (empty($this->labelstatut)) + if (empty($this->labelStatus)) { global $langs; $langs->load("withdrawals"); - $this->labelstatut[0]=$langs->trans("StatusWaiting"); - $this->labelstatut[1]=$langs->trans("StatusTrans"); - $this->labelstatut[2]=$langs->trans("StatusCredited"); + $this->labelStatus[0]=$langs->trans("StatusWaiting"); + $this->labelStatus[1]=$langs->trans("StatusTrans"); + $this->labelStatus[2]=$langs->trans("StatusCredited"); } if ($mode == 0 || $mode == 1) { - return $this->labelstatut[$statut]; + return $this->labelStatus[$statut]; } elseif ($mode == 2) { - if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatut[$statut]; - elseif ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3').' '.$this->labelstatut[$statut]; - elseif ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatut[$statut]; + if ($statut==0) return img_picto($this->labelStatus[$statut], 'statut1').' '.$this->labelStatus[$statut]; + elseif ($statut==1) return img_picto($this->labelStatus[$statut], 'statut3').' '.$this->labelStatus[$statut]; + elseif ($statut==2) return img_picto($this->labelStatus[$statut], 'statut6').' '.$this->labelStatus[$statut]; } elseif ($mode == 3) { - if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1'); - elseif ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3'); - elseif ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6'); + if ($statut==0) return img_picto($this->labelStatus[$statut], 'statut1'); + elseif ($statut==1) return img_picto($this->labelStatus[$statut], 'statut3'); + elseif ($statut==2) return img_picto($this->labelStatus[$statut], 'statut6'); } elseif ($mode == 4) { - if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatut[$statut]; - elseif ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3').' '.$this->labelstatut[$statut]; - elseif ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatut[$statut]; + if ($statut==0) return img_picto($this->labelStatus[$statut], 'statut1').' '.$this->labelStatus[$statut]; + elseif ($statut==1) return img_picto($this->labelStatus[$statut], 'statut3').' '.$this->labelStatus[$statut]; + elseif ($statut==2) return img_picto($this->labelStatus[$statut], 'statut6').' '.$this->labelStatus[$statut]; } elseif ($mode == 5) { - if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1'); - elseif ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut3'); - elseif ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6'); + if ($statut==0) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut1'); + elseif ($statut==1) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut3'); + elseif ($statut==2) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut6'); } elseif ($mode == 6) { - if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1'); - elseif ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut3'); - elseif ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6'); + if ($statut==0) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut1'); + elseif ($statut==1) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut3'); + elseif ($statut==2) return $this->labelStatus[$statut].' '.img_picto($this->labelStatus[$statut], 'statut6'); } } } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 895293efaf7..6b738719cf5 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1264,13 +1264,13 @@ class Contact extends CommonObject // phpcs:enable global $langs; - $labelstatus = array( + $labelStatus = array( 0 => 'ActivityCeased', 1 => 'InActivity', 4 => 'InActivity', 5 => 'ActivityCeased', ); - $labelstatusshort = array( + $labelStatusShort = array( 0 => 'ActivityCeased', 1 => 'InActivity', 4 => 'InActivity', @@ -1280,8 +1280,8 @@ class Contact extends CommonObject $statusType = 'status4'; if ($status==0 || $status==5) $statusType = 'status5'; - $label = $langs->trans($labelstatus[$status]); - $labelshort = $langs->trans($labelstatusshort[$status]); + $label = $langs->trans($labelStatus[$status]); + $labelshort = $langs->trans($labelStatusShort[$status]); return dolGetStatus($label, $labelshort, '', $statusType, $mode); } diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index ec27b83e0a0..b6381ccc7ca 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -496,27 +496,27 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye){ if ($status == 0) { - $labelstatut = $langs->trans('BillStatusDraft'); - $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusDraft'); + $labelStatus = $langs->trans('BillStatusDraft'); + $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusDraft'); } elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) { - $labelstatut = $langs->trans('BillStatusClosedUnpaid'); - $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusClosedUnpaid'); + $labelStatus = $langs->trans('BillStatusClosedUnpaid'); + $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusClosedUnpaid'); $statusType='status5'; } elseif (($status == 3 || $status == 2) && $alreadypaid > 0) { - $labelstatut = $langs->trans('BillStatusClosedPaidPartially'); - $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); + $labelStatus = $langs->trans('BillStatusClosedPaidPartially'); + $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); $statusType='status9'; } elseif ($alreadypaid <= 0) { - $labelstatut = $langs->trans('BillStatusNotPaid'); - $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusNotPaid'); + $labelStatus = $langs->trans('BillStatusNotPaid'); + $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusNotPaid'); $statusType='status1'; } else { - $labelstatut = $langs->trans('BillStatusStarted'); - $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusStarted'); + $labelStatus = $langs->trans('BillStatusStarted'); + $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusStarted'); $statusType='status3'; } } @@ -525,20 +525,20 @@ abstract class CommonInvoice extends CommonObject $statusType='status6'; if ($type == self::TYPE_CREDIT_NOTE){ - $labelstatut = $langs->trans('BillStatusPaidBackOrConverted'); // credit note - $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note + $labelStatus = $langs->trans('BillStatusPaidBackOrConverted'); // credit note + $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note } elseif ($type == self::TYPE_DEPOSIT){ - $labelstatut = $langs->trans('BillStatusConverted'); // deposit invoice - $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusConverted'); // deposit invoice + $labelStatus = $langs->trans('BillStatusConverted'); // deposit invoice + $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusConverted'); // deposit invoice } else{ - $labelstatut = $langs->trans('BillStatusPaid'); - $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusPaid'); + $labelStatus = $langs->trans('BillStatusPaid'); + $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusPaid'); } } - return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode); + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 943afe69a1a..56b0dc93c35 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8182,7 +8182,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st elseif ($displayMode == 6) $displayMode = 5; } - // image's filename are still in French, so we use this array to convert + // For backward compatibility. Image's filename are still in French, so we use this array to convert $statusImg=array( 'status0' => 'statut0' ,'status1' => 'statut1' @@ -8212,6 +8212,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st $return = $htmlImg .' '. $htmlLabel; } elseif ($displayMode === 5) { + // Add here a span class="hideonsmartphone ? $return = $htmlLabelShort .' '. $htmlImg; } else { // $displayMode >= 6 diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index b24213d5c70..4c8c5f73d9b 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -116,12 +116,12 @@ class Don extends CommonObject /** * @var array Array of status label */ - public $labelstatut; + public $labelStatus; /** * @var array Array of status label short */ - public $labelstatutshort; + public $labelStatusShort; const STATUS_DRAFT = 0; @@ -163,25 +163,25 @@ class Don extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatut) || empty($this->labelstatutshort)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; $langs->load("donations"); - $this->labelstatut[-1]=$langs->trans("Canceled"); - $this->labelstatut[0]=$langs->trans("DonationStatusPromiseNotValidated"); - $this->labelstatut[1]=$langs->trans("DonationStatusPromiseValidated"); - $this->labelstatut[2]=$langs->trans("DonationStatusPaid"); - $this->labelstatutshort[-1]=$langs->trans("Canceled"); - $this->labelstatutshort[0]=$langs->trans("DonationStatusPromiseNotValidatedShort"); - $this->labelstatutshort[1]=$langs->trans("DonationStatusPromiseValidatedShort"); - $this->labelstatutshort[2]=$langs->trans("DonationStatusPaidShort"); + $this->labelStatus[-1]=$langs->trans("Canceled"); + $this->labelStatus[0]=$langs->trans("DonationStatusPromiseNotValidated"); + $this->labelStatus[1]=$langs->trans("DonationStatusPromiseValidated"); + $this->labelStatus[2]=$langs->trans("DonationStatusPaid"); + $this->labelStatusShort[-1]=$langs->trans("Canceled"); + $this->labelStatusShort[0]=$langs->trans("DonationStatusPromiseNotValidatedShort"); + $this->labelStatusShort[1]=$langs->trans("DonationStatusPromiseValidatedShort"); + $this->labelStatusShort[2]=$langs->trans("DonationStatusPaidShort"); } $statusType = 'status'.$status; if ($status == self::STATUS_CANCELED) $statusType = 'status5'; if ($status == self::STATUS_PAID) $statusType = 'status6'; - return dolGetStatus($this->labelstatut[$status], $this->labelstatutshort[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 7469faaa356..6717b42609b 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -506,46 +506,46 @@ class EmailCollector extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus)) + if (empty($this->labelStatus)) { global $langs; //$langs->load("mymodule"); - $this->labelstatus[1] = $langs->trans('Enabled'); - $this->labelstatus[0] = $langs->trans('Disabled'); + $this->labelStatus[1] = $langs->trans('Enabled'); + $this->labelStatus[0] = $langs->trans('Disabled'); } if ($mode == 0) { - return $this->labelstatus[$status]; + return $this->labelStatus[$status]; } elseif ($mode == 1) { - return $this->labelstatus[$status]; + return $this->labelStatus[$status]; } elseif ($mode == 2) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } elseif ($mode == 5) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 6) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } } diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 0033b615f8a..7f7360b49f1 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -408,46 +408,46 @@ class EmailCollectorAction extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus)) + if (empty($this->labelStatus)) { global $langs; //$langs->load("emailcollector"); - $this->labelstatus[1] = $langs->trans('Enabled'); - $this->labelstatus[0] = $langs->trans('Disabled'); + $this->labelStatus[1] = $langs->trans('Enabled'); + $this->labelStatus[0] = $langs->trans('Disabled'); } if ($mode == 0) { - return $this->labelstatus[$status]; + return $this->labelStatus[$status]; } elseif ($mode == 1) { - return $this->labelstatus[$status]; + return $this->labelStatus[$status]; } elseif ($mode == 2) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } elseif ($mode == 5) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 6) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } } diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 5a8f3003c84..43eb9d1cb65 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -383,46 +383,46 @@ class EmailCollectorFilter extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus)) + if (empty($this->labelStatus)) { global $langs; //$langs->load("emailcollector"); - $this->labelstatus[1] = $langs->trans('Enabled'); - $this->labelstatus[0] = $langs->trans('Disabled'); + $this->labelStatus[1] = $langs->trans('Enabled'); + $this->labelStatus[0] = $langs->trans('Disabled'); } if ($mode == 0) { - return $this->labelstatus[$status]; + return $this->labelStatus[$status]; } elseif ($mode == 1) { - return $this->labelstatus[$status]; + return $this->labelStatus[$status]; } elseif ($mode == 2) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } elseif ($mode == 5) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 6) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 52072b63578..fffde04ac3d 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -683,12 +683,12 @@ class ExpenseReport extends CommonObject // phpcs:enable global $langs; - $labelstatus = $langs->trans($this->statuts[$status]); - $labelstatusshort = $langs->trans($this->statuts_short[$status]); + $labelStatus = $langs->trans($this->statuts[$status]); + $labelStatusShort = $langs->trans($this->statuts_short[$status]); $statusType = $this->statuts_logo[$status]; - return dolGetStatus($labelstatus, $labelstatusshort, '', $statusType, $mode); + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 8fe5f0570fe..b75eec43eac 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1227,20 +1227,20 @@ class Holiday extends CommonObject public function LibStatut($status, $mode = 0, $startdate = '') { // phpcs:enable - if (empty($this->labelstatus) || empty($this->labelstatusshort)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('DraftCP'); - $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('ToReviewCP'); - $this->labelstatus[self::STATUS_APPROVED] = $langs->trans('ApprovedCP'); - $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('CancelCP'); - $this->labelstatus[self::STATUS_REFUSED] = $langs->trans('RefuseCP'); - $this->labelstatusshort[self::STATUS_DRAFT] = $langs->trans('DraftCP'); - $this->labelstatusshort[self::STATUS_VALIDATED] = $langs->trans('ToReviewCP'); - $this->labelstatusshort[self::STATUS_APPROVED] = $langs->trans('ApprovedCP'); - $this->labelstatusshort[self::STATUS_CANCELED] = $langs->trans('CancelCP'); - $this->labelstatusshort[self::STATUS_REFUSED] = $langs->trans('RefuseCP'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('DraftCP'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('ToReviewCP'); + $this->labelStatus[self::STATUS_APPROVED] = $langs->trans('ApprovedCP'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('CancelCP'); + $this->labelStatus[self::STATUS_REFUSED] = $langs->trans('RefuseCP'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('DraftCP'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('ToReviewCP'); + $this->labelStatusShort[self::STATUS_APPROVED] = $langs->trans('ApprovedCP'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('CancelCP'); + $this->labelStatusShort[self::STATUS_REFUSED] = $langs->trans('RefuseCP'); } $statusType = 'status6'; @@ -1250,7 +1250,7 @@ class Holiday extends CommonObject if ($status == self::STATUS_CANCELED) $statusType = 'status5'; if ($status == self::STATUS_REFUSED) $statusType = 'status5'; - return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 41d0af33d46..43488429807 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -656,22 +656,22 @@ class MyObject extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus) || empty($this->labelstatusshort)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelstatusshort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelstatusshort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelstatusshort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); } $statusType = 'status'.$status; if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; - return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } /** diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 71a743eb071..49160092b63 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -546,21 +546,21 @@ class Mo extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus)) + if (empty($this->labelStatus)) { global $langs; //$langs->load("mrp"); - $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelstatus[self::STATUS_INPROGRESS] = $langs->trans('InProgress'); - $this->labelstatus[self::STATUS_PRODUCED] = $langs->trans('StatusMOProduced'); - $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); + $this->labelStatus[self::STATUS_INPROGRESS] = $langs->trans('InProgress'); + $this->labelStatus[self::STATUS_PRODUCED] = $langs->trans('StatusMOProduced'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); } $statusType = 'status'.$status; //if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; - return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatus[$status], '', $statusType, $mode); } /** diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bf2b3a0e410..5243e84e4de 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4390,7 +4390,7 @@ class Product extends CommonObject // phpcs:enable global $conf, $langs; - $labelstatut = $labelstatutShort = ''; + $labelStatus = $labelStatusShort = ''; $langs->load('products'); if (! empty($conf->productbatch->enabled)) { $langs->load("productbatch"); @@ -4423,31 +4423,31 @@ class Product extends CommonObject if ($status == 0) { // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" if($type==0) { - $labelstatut = $langs->trans('ProductStatusNotOnSellShort'); - $labelstatutShort = $langs->trans('ProductStatusNotOnSell'); + $labelStatus = $langs->trans('ProductStatusNotOnSellShort'); + $labelStatusShort = $langs->trans('ProductStatusNotOnSell'); } elseif($type == 1) { - $labelstatut = $langs->trans('ProductStatusNotOnBuyShort'); - $labelstatutShort = $langs->trans('ProductStatusNotOnBuy'); + $labelStatus = $langs->trans('ProductStatusNotOnBuyShort'); + $labelStatusShort = $langs->trans('ProductStatusNotOnBuy'); } elseif($type == 2) { - $labelstatut = $langs->trans('ProductStatusNotOnBatch'); - $labelstatutShort = $langs->trans('ProductStatusNotOnBatchShort'); + $labelStatus = $langs->trans('ProductStatusNotOnBatch'); + $labelStatusShort = $langs->trans('ProductStatusNotOnBatchShort'); } } elseif ($status == 1) { // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" if ($type==0) { - $labelstatut = $langs->trans('ProductStatusOnSellShort'); - $labelstatutShort = $langs->trans('ProductStatusOnSell'); + $labelStatus = $langs->trans('ProductStatusOnSellShort'); + $labelStatusShort = $langs->trans('ProductStatusOnSell'); } elseif ($type == 1) { - $labelstatut = $langs->trans('ProductStatusOnBuyShort'); - $labelstatutShort = $langs->trans('ProductStatusOnBuy'); + $labelStatus = $langs->trans('ProductStatusOnBuyShort'); + $labelStatusShort = $langs->trans('ProductStatusOnBuy'); } elseif ($type == 2) { - $labelstatut = $langs->trans('ProductStatusOnBatch'); - $labelstatutShort = $langs->trans('ProductStatusOnBatchShort'); + $labelStatus = $langs->trans('ProductStatusOnBatch'); + $labelStatusShort = $langs->trans('ProductStatusOnBatchShort'); } } @@ -4455,7 +4455,7 @@ class Product extends CommonObject if ($mode > 6) { return dolGetStatus($langs->trans('Unknown'), '', '', 'status0', 0); } else { - return dolGetStatus($labelstatut, $labelstatutShort, '', $statuttrans, $mode); + return dolGetStatus($labelStatus, $labelStatusShort, '', $statuttrans, $mode); } } diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 477dcc20b0c..ff5e83b9410 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -266,7 +266,7 @@ print '
'; /* - * Last modified products + * Latest modified products */ $max=15; $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,"; @@ -299,11 +299,11 @@ if ($result) print '
'; print '
'; print $langs->trans("URL"); print ''; @@ -2911,10 +2891,12 @@ if ($action == 'editmeta' || $action == 'createcontainer') print '
'; - print ' * '.$langs->trans("OrEnterPageInfoManually").'

'; + if (! empty($conf->use_javascript_ajax)) print ' '; + print '
'; + print '
'; } - print ''; + print '
'; if ($action != 'createcontainer') { @@ -2928,16 +2910,9 @@ if ($action == 'editmeta' || $action == 'createcontainer') print $langs->trans('InternalURLOfPage'); print ''; - /* - print ''; - */ - $type_container=$objectpage->type_container; $pageurl=$objectpage->pageurl; $pagealiasalt=$objectpage->aliasalt; @@ -2972,7 +2947,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; // Alias @@ -3023,26 +2998,28 @@ if ($action == 'editmeta' || $action == 'createcontainer') print $formadmin->select_language($pagelang?$pagelang:$langs->defaultlang, 'WEBSITE_LANG', 0, null, '1'); print ''; + // Translation of + $translationof=0; + print ''; - } - // Has translation pages $sql='SELECT rowid, lang from '.MAIN_DB_PREFIX.'website_page where fk_page = '.$objectpage->id; $resql = $db->query($sql); @@ -3051,9 +3028,8 @@ if ($action == 'editmeta' || $action == 'createcontainer') $num_rows = $db->num_rows($resql); if ($num_rows > 0) { - print ''; } } else dol_print_error($db); } + print ''; print '
'; print '/public/website/index.php?website='.urlencode($websitekey).'&pageid='.urlencode($pageid); + //if ($objectpage->grabbed_from) print ' - '.$langs->trans('InitiallyGrabbedFrom').' '.$objectpage->grabbed_from.''; print '
'; - print $langs->trans('InitiallyGrabbedFrom'); - print ''; - print $objectpage->grabbed_from; - print '
'; print $langs->trans('WEBSITE_TITLE'); print ''; - print ''; + print ''; print '
'; + print $langs->trans('TranslationLinks'); + print ''; + if ($action == 'editmeta' || $action == 'createcontainer' || $objectpage->fk_page > 0) + { + $sourcepage=new WebsitePage($db); + $result = $sourcepage->fetch($objectpage->fk_page); + if ($result == 0) + { + // not found, we can reset value to clean database + } + elseif ($result > 0) + { + $translationof = $sourcepage->id; + print ''.$langs->trans('ThisPageIsTranslationOf').' '; + print $formwebsite->selectContainer($website, 'pageidfortranslation', $sourcepage->id, 1, $action); + } + } if ($action != 'createcontainer') { - // Translation of - if ($objectpage->fk_page > 0) - { - print '
'; - print $langs->trans('ThisPageIsTranslationOf'); - print ''; - $sourcepage=new WebsitePage($db); - $result = $sourcepage->fetch($objectpage->fk_page); - if ($result == 0) // not found, we can reset value - { - } - elseif ($result > 0) - { - print $sourcepage->getNomUrl(1); - } - print '
'; - print $langs->trans('ThisPageHasTranslationPages'); - print ''; + if ($translationof) print '
'; + print ''.$langs->trans('ThisPageHasTranslationPages').':
'; $i=0; while ($obj = $db->fetch_object($resql)) { @@ -3063,11 +3039,11 @@ if ($action == 'editmeta' || $action == 'createcontainer') print $tmppage->getNomUrl(1).' ('.$tmppage->lang.')'; $i++; } - print '
'; $htmlhelp=$langs->trans("WEBSITE_ALIASALTDesc"); @@ -3127,7 +3103,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print '
'; if ($action == 'createcontainer') { - print '
'; + print '
'; print ''; print ''; @@ -3155,6 +3131,20 @@ if ($action == 'editmeta' || $action == 'createcontainer') jQuery("#WEBSITE_PAGENAME").keyup(function() { disableautofillofalias = 1; }); + + jQuery("#checkboxcreatefromfetching,#checkboxcreatemanually").change(function() { + console.log("we select a method to create a new container"+jQuery("#checkboxcreatefromfetching:checked").val()) + if (typeof(jQuery("#checkboxcreatefromfetching:checked").val()) != \'undefined\') + { + jQuery(".tablecheckboxcreatefromfetching").show(); + jQuery(".tablecheckboxcreatemanually").hide(); + } + if (typeof(jQuery("#checkboxcreatemanually:checked").val()) != \'undefined\') + { + jQuery(".tablecheckboxcreatefromfetching").hide(); + jQuery(".tablecheckboxcreatemanually").show(); + } + }); }); '; } @@ -3286,6 +3276,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') if ($listofpages['code'] == 'OK') { + print ''."\n"; print '
'; if ($action == 'replacesiteconfirm') @@ -3317,7 +3308,8 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print '
'.$langs->trans("Container").''; - print ''.($answerrecord->title ? $answerrecord->title : $langs->trans("NoTitle")).''; + print $answerrecord->getNomUrl(1); + print ' ('.($answerrecord->title ? $answerrecord->title : $langs->trans("NoTitle")).')'; print ''.$answerrecord->description; print '
'; print $langs->trans('TranslationLinks'); print ''; - if ($action == 'editmeta' || $action == 'createcontainer' || $objectpage->fk_page > 0) + if ($action != 'createcontainer') + { + // Has translation pages + $sql='SELECT rowid, lang from '.MAIN_DB_PREFIX.'website_page where fk_page = '.$objectpage->id; + $resql = $db->query($sql); + if ($resql) + { + $num_rows = $db->num_rows($resql); + if ($num_rows > 0) + { + print ''.$langs->trans('ThisPageHasTranslationPages').':
'; + $i=0; + while ($obj = $db->fetch_object($resql)) + { + $tmppage=new WebsitePage($db); + $tmppage->fetch($obj->rowid); + if ($i > 0) print ' - '; + print $tmppage->getNomUrl(1).' ('.$tmppage->lang.')
'; + $translatedby++; + $i++; + } + } + } + else dol_print_error($db); + } + if (empty($translatedby) && ($action == 'editmeta' || $action == 'createcontainer' || $objectpage->fk_page > 0)) { $sourcepage=new WebsitePage($db); $result = $sourcepage->fetch($objectpage->fk_page); @@ -3018,31 +3044,6 @@ if ($action == 'editmeta' || $action == 'createcontainer') print $formwebsite->selectContainer($website, 'pageidfortranslation', $sourcepage->id, 1, $action); } } - if ($action != 'createcontainer') - { - // Has translation pages - $sql='SELECT rowid, lang from '.MAIN_DB_PREFIX.'website_page where fk_page = '.$objectpage->id; - $resql = $db->query($sql); - if ($resql) - { - $num_rows = $db->num_rows($resql); - if ($num_rows > 0) - { - if ($translationof) print '
'; - print ''.$langs->trans('ThisPageHasTranslationPages').':
'; - $i=0; - while ($obj = $db->fetch_object($resql)) - { - $tmppage=new WebsitePage($db); - $tmppage->fetch($obj->rowid); - if ($i > 0) print ' - '; - print $tmppage->getNomUrl(1).' ('.$tmppage->lang.')'; - $i++; - } - } - } - else dol_print_error($db); - } print '
'; From a0e377feb3b7e978fce9bfc09bc32d35c6ed0599 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 22:11:26 +0100 Subject: [PATCH 13/38] Look and feel v11 --- .../compta/cashcontrol/cashcontrol_list.php | 72 +++++++++---------- .../cashcontrol/class/cashcontrol.class.php | 41 ++--------- 2 files changed, 42 insertions(+), 71 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 6b767bc3949..dce1c13bc40 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -322,7 +322,7 @@ $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); -if ($user->rights->monmodule->delete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); +//if ($user->rights->monmodule->delete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); @@ -336,13 +336,9 @@ print ''; print ''; print ''; -$newcardbutton=''; -//if ($user->rights->monmodule->creer) - //{ -$newcardbutton=''.$langs->trans('New').''; -$newcardbutton.= ''; -$newcardbutton.= ''; -//} +$permforcashfence = 1; + +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permforcashfence); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit); @@ -389,12 +385,18 @@ print ''; foreach($object->fields as $key => $val) { - $cssforfield=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right'; - if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print ''; + $cssforfield=(empty($val['css'])?'':$val['css']); + if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; + elseif (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; + elseif (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield.=($cssforfield?' ':'').'right'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print ''; + } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -416,15 +418,15 @@ print ''."\n"; print ''; foreach($object->fields as $key => $val) { - $cssforfield=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right'; - if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) - { - print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n"; - } + $cssforfield=(empty($val['css'])?'':$val['css']); + if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; + elseif (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; + elseif (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield.=($cssforfield?' ':'').'right'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n"; + } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -467,25 +469,21 @@ while ($i < min($num, $limit)) print ''; foreach($object->fields as $key => $val) { - $cssforfield=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; - elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; + $cssforfield=(empty($val['css'])?'':$val['css']); + if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; + elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; - elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield.=($cssforfield?' ':'').'right'; if (! empty($arrayfields['t.'.$key]['checked'])) { - print ''; - print $object->showOutputField($val, $key, $obj->$key, ''); + print ''; + if ($key == 'status') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); + else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++; if (! empty($val['isameasure'])) diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 87db81bf98d..354b50365ca 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -311,47 +311,20 @@ class CashControl extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus)) + if (empty($this->labelstatus) || empty($this->labelstatusshort)) { global $langs; //$langs->load("mymodule"); $this->labelstatus[0] = $langs->trans('Draft'); $this->labelstatus[1] = $langs->trans('Closed'); + $this->labelstatusshort[0] = $langs->trans('Draft'); + $this->labelstatusshort[1] = $langs->trans('Closed'); } - if ($mode == 0) - { - return $this->labelstatus[$status]; - } - elseif ($mode == 1) - { - return $this->labelstatus[$status]; - } - elseif ($mode == 2) - { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut6', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut0', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - } - elseif ($mode == 3) - { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut6', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut0', '', false, 0, 0, '', 'valignmiddle'); - } - elseif ($mode == 4) - { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut6', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut0', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - } - elseif ($mode == 5) - { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut6', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut0', '', false, 0, 0, '', 'valignmiddle'); - } - elseif ($mode == 6) - { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut6', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut0', '', false, 0, 0, '', 'valignmiddle'); - } + $statusType = 'status0'; + if ($status == self::STATUS_VALIDATED) $statusType = 'status6'; + + return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); } /** From af09c77a0c6ddc24f3acbe8ab1ae7ed69607ddbc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 22:15:18 +0100 Subject: [PATCH 14/38] Fix phpcs --- htdocs/bom/class/api_boms.class.php | 2 +- htdocs/core/modules/modStripe.class.php | 2 +- .../modules/myobject/doc/doc_generic_myobject_odt.modules.php | 2 +- htdocs/societe/canvas/company/tpl/card_edit.tpl.php | 4 ++-- htdocs/societe/canvas/individual/tpl/card_edit.tpl.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php index 471fb4f2cce..40d53bff787 100644 --- a/htdocs/bom/class/api_boms.class.php +++ b/htdocs/bom/class/api_boms.class.php @@ -260,7 +260,7 @@ class Boms extends DolibarrApi throw new RestException(500, 'Error when deleting BOM : '.$this->bom->error); } - return array( + return array( 'success' => array( 'code' => 200, 'message' => 'BOM deleted' diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 30d90b8a0c6..cfa45cb6a4b 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -150,7 +150,7 @@ class modStripe extends DolibarrModules 'target' => '', 'user' => 0 ); - $this->menu[$r] = array( + $this->menu[$r] = array( 'fk_menu' => 'fk_mainmenu=bank,fk_leftmenu=stripe', 'type' => 'left', 'titre' => 'StripePayoutList', diff --git a/htdocs/modulebuilder/template/core/modules/myobject/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/myobject/doc/doc_generic_myobject_odt.modules.php index bffc0d5c470..822d6110c4b 100644 --- a/htdocs/modulebuilder/template/core/modules/myobject/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/myobject/doc/doc_generic_myobject_odt.modules.php @@ -486,7 +486,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject } else { try { - $odfHandler->saveToDisk($file); + $odfHandler->saveToDisk($file); } catch (Exception $e) { $this->error=$e->getMessage(); dol_syslog($e->getMessage(), LOG_INFO); diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index b26f19204bb..5f513fa886a 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -77,7 +77,7 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['ismodifiable_customercode']) { ?> - control->tpl['customercode']; ?> + control->tpl['customercode']; ?> @@ -98,7 +98,7 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['ismodifiable_suppliercode']) { ?> - control->tpl['suppliercode']; ?> + control->tpl['suppliercode']; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index b69e9e8370b..d25a9f36121 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -75,7 +75,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_customercode']) { ?> - control->tpl['customercode']; ?> + control->tpl['customercode']; ?> @@ -96,7 +96,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_suppliercode']) { ?> - control->tpl['suppliercode']; ?> + control->tpl['suppliercode']; ?> From 716c2bb531b790afccec28da9365964224ad1af7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 22:46:34 +0100 Subject: [PATCH 15/38] Work on MO --- htdocs/admin/mrp.php | 522 ++++++++++++++++++ .../bom/doc/doc_generic_bom_odt.modules.php | 2 +- htdocs/core/modules/bom/modules_bom.php | 2 +- htdocs/core/modules/modBom.class.php | 15 +- htdocs/core/modules/modMrp.class.php | 37 +- .../mrp/doc/doc_generic_mo_odt.modules.php | 4 +- .../doctemplates/boms/template_bom.odt | Bin 17591 -> 18723 bytes .../install/doctemplates/mrps/template_mo.odt | Bin 0 -> 18089 bytes htdocs/langs/en_US/mrp.lang | 8 +- htdocs/mrp/admin/setup.php | 151 ----- 10 files changed, 573 insertions(+), 168 deletions(-) create mode 100644 htdocs/admin/mrp.php create mode 100644 htdocs/install/doctemplates/mrps/template_mo.odt delete mode 100644 htdocs/mrp/admin/setup.php diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php new file mode 100644 index 00000000000..f3121faa70d --- /dev/null +++ b/htdocs/admin/mrp.php @@ -0,0 +1,522 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/admin/mrp.php + * \ingroup mrp + * \brief Setup page of module MRP + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; +require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array('admin', 'errors', 'mrp', 'other')); + +if (! $user->admin) accessforbidden(); + +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); +$type = 'mrp'; + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + +if ($action == 'updateMask') +{ + $maskconstmrp=GETPOST('maskconstMo', 'alpha'); + $maskmrp=GETPOST('maskMo', 'alpha'); + + if ($maskconstmrp) $res = dolibarr_set_const($db, $maskconstmrp, $maskmrp, 'chaine', 0, '', $conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + +elseif ($action == 'specimen') +{ + $modele=GETPOST('module', 'alpha'); + + $mo = new MO($db); + $mrp->initAsSpecimen(); + + // Search template files + $file=''; $classname=''; $filefound=0; + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); + foreach($dirmodels as $reldir) + { + $file=dol_buildpath($reldir."core/modules/mrp/doc/pdf_".$modele.".modules.php", 0); + if (file_exists($file)) + { + $filefound=1; + $classname = "pdf_".$modele; + break; + } + } + + if ($filefound) + { + require_once $file; + + $module = new $classname($db); + + if ($module->write_file($mrp, $langs) > 0) + { + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mrp&file=SPECIMEN.pdf"); + return; + } + else + { + setEventMessages($module->error, null, 'errors'); + dol_syslog($module->error, LOG_ERR); + } + } + else + { + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); + dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); + } +} + +// Activate a model +elseif ($action == 'set') +{ + $ret = addDocumentModel($value, $type, $label, $scandir); +} + +elseif ($action == 'del') +{ + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + if ($conf->global->MRP_MO_ADDON_PDF == "$value") dolibarr_del_const($db, 'MRP_MO_ADDON_PDF', $conf->entity); + } +} + +// Set default model +elseif ($action == 'setdoc') +{ + if (dolibarr_set_const($db, "MRP_MO_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) + { + // The constant that was read before the new set + // We therefore requires a variable to have a coherent view + $conf->global->MRP_MO_ADDON_PDF = $value; + } + + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } +} + +elseif ($action == 'setmod') +{ + // TODO Check if numbering module chosen can be activated + // by calling method canBeActivated + + dolibarr_set_const($db, "MRP_MO_ADDON", $value, 'chaine', 0, '', $conf->entity); +} + +elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK') +{ + $draft = GETPOST("MRP_MO_DRAFT_WATERMARK"); + $res = dolibarr_set_const($db, "MRP_MO_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + +elseif ($action == 'set_MRP_MO_FREE_TEXT') +{ + $freetext = GETPOST("MRP_MO_FREE_TEXT", 'none'); // No alpha here, we want exact string + + $res = dolibarr_set_const($db, "MRP_MO_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + + +/* + * View + */ + +$form=new Form($db); + +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); + +llxHeader("", $langs->trans("MrpSetupPage")); + +$linkback=''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("MrpSetupPage"), $linkback, 'title_setup'); + +$head = mrpAdminPrepareHead(); + +dol_fiche_head($head, 'settings', $langs->trans("MOs"), -1, 'mrp'); + +/* + * MOs Numbering model + */ + +print load_fiche_titre($langs->trans("MOsNumberingModules"), '', ''); + +print '
'; + if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75'); + else print ''; + print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''."\n"; + +clearstatcache(); + +foreach ($dirmodels as $reldir) +{ + $dir = dol_buildpath($reldir."core/modules/mrp/"); + + if (is_dir($dir)) + { + $handle = opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (substr($file, 0, 8) == 'mod_mo_' && substr($file, dol_strlen($file)-3, 3) == 'php') + { + $file = substr($file, 0, dol_strlen($file)-4); + + require_once $dir.$file.'.php'; + + $module = new $file($db); + + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + + if ($module->isEnabled()) + { + print ''; + + // Show example of numbering model + print ''."\n"; + + print ''; + + $mrp=new MO($db); + $mrp->initAsSpecimen(); + + // Info + $htmltooltip=''; + $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; + $mrp->type=0; + $nextval=$module->getNextValue($mysoc, $mrp); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip.=''.$langs->trans("NextValue").': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') + $nextval = $langs->trans($nextval); + $htmltooltip.=$nextval.'
'; + } else { + $htmltooltip.=$langs->trans($module->error).'
'; + } + } + + print ''; + + print "\n"; + } + } + } + closedir($handle); + } + } +} +print "
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'.$module->name."\n"; + print $module->info(); + print ''; + $tmp=$module->getExample(); + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; + elseif ($tmp=='NotConfigured') print $langs->trans($tmp); + else print $tmp; + print '
'; + if ($conf->global->MRP_MO_ADDON == $file) + { + print img_picto($langs->trans("Activated"), 'switch_on'); + } + else + { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print '

\n"; + + +/* + * Document templates generators + */ + +print load_fiche_titre($langs->trans("MOsModelModule"), '', ''); + +// Load array def with activated templates +$def = array(); +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = '".$type."'"; +$sql.= " AND entity = ".$conf->entity; +$resql=$db->query($sql); +if ($resql) +{ + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } +} +else +{ + dol_print_error($db); +} + + +print "\n"; +print "\n"; +print ''; +print ''; +print '\n"; +print '\n"; +print ''; +print ''; +print "\n"; + +clearstatcache(); + +foreach ($dirmodels as $reldir) +{ + foreach (array('','/doc') as $valdir) + { + $dir = dol_buildpath($reldir."core/modules/mrp".$valdir); + + if (is_dir($dir)) + { + $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + $filelist[]=$file; + } + closedir($handle); + arsort($filelist); + + foreach($filelist as $file) + { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) + { + if (file_exists($dir.'/'.$file)) + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); + + require_once $dir.'/'.$file; + $module = new $classname($db); + + $modulequalified=1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; + + if ($modulequalified) + { + $var = !$var; + print ''; + + // Active + if (in_array($name, $def)) + { + print ''; + } + else + { + print '"; + } + + // Default + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + if ($module->type == 'pdf') + { + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + } + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftMOs").': '.yn($module->option_draft_watermark, 1, 1); + + + print ''; + + // Preview + print ''; + + print "\n"; + } + } + } + } + } + } + } +} + +print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
'; + print (empty($module->name)?$name:$module->name); + print "\n"; + if (method_exists($module, 'info')) print $module->info($langs); + else print $module->description; + print ''."\n"; + print ''; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + print ''."\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print "'; + if ($conf->global->MRP_MO_ADDON_PDF == $name) + { + print img_picto($langs->trans("Default"), 'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''; + if ($module->type == 'pdf') + { + print ''.img_object($langs->trans("Preview"), 'bill').''; + } + else + { + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); + } + print '
'; +print "
"; + +/* + * Other options + */ + +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); +print ''; +print ''; +print ''; +print ''; +print "\n"; +print "\n"; + +$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2); +$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); +$htmltext = ''.$langs->trans("AvailableVariables").':
'; +foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; +$htmltext.='
'; + +print ''; +print ''; +print ''; +print '\n"; +print ''; + +//Use draft Watermark + +print ""; +print ''; +print ""; +print '\n"; +print ''; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; +print $form->textwithpicto($langs->trans("FreeLegalTextOnMOs"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; +$variablename='MRP_MO_FREE_TEXT'; +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +{ + print ''; +} +else +{ + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); +} +print '
'; +print ''; +print "
'; +print $form->textwithpicto($langs->trans("WatermarkOnDraftMOs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; +print '
'; +print ''; +print ''; +print ''; +print "
'; +print '
'; + + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index acbb2ae0b36..38358222282 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php'; /** * Class to build documents using ODF templates generator */ -class doc_generic_bom_odt extends ModelePDFBOMs +class doc_generic_bom_odt extends ModelePDFBoms { /** * Issuer diff --git a/htdocs/core/modules/bom/modules_bom.php b/htdocs/core/modules/bom/modules_bom.php index 45bca8a38b3..f8f29fec2e6 100644 --- a/htdocs/core/modules/bom/modules_bom.php +++ b/htdocs/core/modules/bom/modules_bom.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir /** * Parent class for boms models */ -abstract class ModelePDFBom extends CommonDocGenerator +abstract class ModelePDFBoms extends CommonDocGenerator { // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index 1700f15afd7..47daf430873 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -189,7 +189,7 @@ class modBom extends DolibarrModules // Boxes/Widgets // Add here list of php file(s) stored in bom/core/boxes that contains class to show a widget. $this->boxes = array( - 0=>array('file'=>'box_boms.php','note'=>'','enabledbydefaulton'=>'Home') + 0=>array('file' => 'box_boms.php', 'note' => '', 'enabledbydefaulton' => 'Home') ); @@ -203,7 +203,7 @@ class modBom extends DolibarrModules // ); - // Permissions + // Permissions provided by this module $this->rights = array(); // Permission array used by this module $r=0; @@ -228,7 +228,7 @@ class modBom extends DolibarrModules $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->bom->level1->level2) - // Main menu entries + // Main menu entries to add $this->menu = array(); // List of menus to add $r=0; @@ -323,9 +323,8 @@ class modBom extends DolibarrModules if ($result < 0) return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default') // Create extrafields - include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields = new ExtraFields($this->db); - + //include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + //$extrafields = new ExtraFields($this->db); //$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'mrp', '$conf->bom->enabled'); //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'mrp', '$conf->bom->enabled'); //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'mrp', '$conf->bom->enabled'); @@ -357,8 +356,8 @@ class modBom extends DolibarrModules } $sql = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape('alpha')."' AND type = 'bom' AND entity = ".$conf->entity, - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape('alpha')."', 'bom', ".$conf->entity.")" + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape('standard')."' AND type = 'bom' AND entity = ".$conf->entity, + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape('standard')."', 'bom', ".$conf->entity.")" ); return $this->_init($sql, $options); diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 53f778d063f..248179b5447 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -58,7 +58,7 @@ class modMrp extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleMrpName' not found (Mrp is name of module). $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleMrpDesc' not found (Mrp is name of module). - $this->description = "MRPDescription"; + $this->description = "Module to Manage Manufacturing Orders (MO)"; // Used only if file README.md and README-LL.md not found. $this->descriptionlong = "Module to Manage Manufacturing Orders (MO)"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' @@ -113,7 +113,7 @@ class modMrp extends DolibarrModules // Example: this->dirs = array("/mrp/temp","/mrp/subdir"); $this->dirs = array("/mrp/temp"); // Config pages. Put here list of php page, stored into mrp/admin directory, to use to setup module. - $this->config_page_url = array("setup.php@mrp"); + $this->config_page_url = array("mrp.php"); // Dependencies // A condition to hide module $this->hidden = false; @@ -135,7 +135,9 @@ class modMrp extends DolibarrModules // 2 => array('MRP_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1) // ); $this->const = array( - // 1 => array('MRP_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) + 1=>array('MRP_MO_ADDON_PDF', 'chaine', 'alpha', 'Name of PDF model of BOM', 0), + 2=>array('MRP_MO_ADDON', 'chaine', 'mod_bom_standard', 'Name of numbering rules of BOM', 0), + 3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/boms', '', 0) ); // Some keys to add into the overwriting translation tables @@ -312,6 +314,8 @@ class modMrp extends DolibarrModules */ public function init($options = '') { + global $conf, $langs; + $result=$this->_load_tables('/mrp/sql/'); if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default') @@ -324,7 +328,34 @@ class modMrp extends DolibarrModules //$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'mrp', '$conf->mrp->enabled'); //$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'mrp', '$conf->mrp->enabled'); + // Permissions + $this->remove($options); + $sql = array(); + + // ODT template + $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/mrps/template_mo.odt'; + $dirodt=DOL_DATA_ROOT.'/doctemplates/mrps'; + $dest=$dirodt.'/template_mo.odt'; + + if (file_exists($src) && ! file_exists($dest)) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + dol_mkdir($dirodt); + $result=dol_copy($src, $dest, 0, 0); + if ($result < 0) + { + $langs->load("errors"); + $this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest); + return 0; + } + } + + $sql = array( + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape('standard')."' AND type = 'mo' AND entity = ".$conf->entity, + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape('standard')."', 'mo', ".$conf->entity.")" + ); + return $this->_init($sql, $options); } diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 9beb300ebb0..0447694465f 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -27,7 +27,7 @@ * \brief File of class to build ODT documents for MOs */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/bom/modules_bom.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/mrp/modules_mrp.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php'; /** * Class to build documents using ODF templates generator */ -class doc_generic_mo_odt extends ModelePDFMOs +class doc_generic_mo_odt extends ModelePDFMos { /** * Issuer diff --git a/htdocs/install/doctemplates/boms/template_bom.odt b/htdocs/install/doctemplates/boms/template_bom.odt index 344fcfa391aefbfef2b4ae85c5436e6c707adaa2..9eea32e4197b0c004fb2526d014698dec8ff194d 100644 GIT binary patch literal 18723 zcmb5V1C%Ar(kR-Po;Id6ZQHhOd)nr1+wN)G?rGb$ZQHiF?|kQf|Gn$}>%8;U%iK|w zt1=_9B39PUP%21+e?tWUfdT=UsL+$w9b$qb2LS>32mU?+v9Yi*adNjaF|f0@Kh z0WB?orcOW$2cWeZ(B2GaZv%9<0XjPZ?LC2B&Ok3Wphv)Ox1dDlK%i$3&@%!U=;a;k z6CC6P4EF;5_VVZLy`i_WZKShdw6lGtqr9)Hr>_FoTMz8( z0FE~UC)$DYUBIEfj>VCV{{H^H!O@|S!NJk-vBAEP;gN~af${P2-r<>n@wvXq)$z&M zshP>4ndO1mwaMA}@%i=Hp}yI%f!WEi^~wH?>CwO4%X1U+3k&m$tBWg(i>vFai}S0? ztLrO^YwPR1{lLLd;K%@QY#KPeaxlCI99sv@PXkwmf$QVIndRMu_5Jy+)3wdrmF<)H z1>nZt-zIQ*cVlYzW@Gnge(!GS@O}O0Ze<_1d3wKo{&BE0wzs~pySaA0HFvW$y0g8r zzYaXx0N!l__jfig_7*P=Hm*;$?oZapD2&%ZPU1s^lVjrd*J9@UK?E3^CwyYgGY#bVb z-H*?UC3jFH^V+f}&poUs&$Rn%OW+>VjoP>m!@!cXTZ4>$i~*v!C`pcR?!*O<8na^XzHo+@nA`{(&qvgrjQ99q4!*d=eHRoky? z>ZtB{kGFfi>HDvfm^f^xHQhzpZ?|CY@ckZkG>Y@VT5fiI=@2 zHtc}SU0%<>A$7ZUixGYIj&oiPh{?bDi4pal?{a*17dD@_fjL)XIUV-{yuhm0tm==w zu5Rok!SfesYsg2r@HRp7~#H zy!9-%?1990%yj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#e-&x1t#YJ|VppF>8-O8l$W zzmEp-my6V|;(r<&;@?sJ@&W<*tws3DHoyIEO~c;>9sgRJzx@7ZY>K}=qvQQ=oWBGf z{~6_9Ya{s&D1R4x{149G>B2u%8^0wVf0_S3;QR*x$bSpfZ^6f3w)PL8|0@6Z|9YBe z`2Ratf0u*&XPn=HkiSgoA8`JXhx})h-vW`p%@WGq|DgQY zet&@Xim)-wD`J0^N&o=tg@$UruAKIP&=Xpo*i**0LFJk`P>+ihtZ+7`FgQ5Oc zs{Y?S|IP>etEVWzrS}Rzq{+dERXj;bl$QOkiRGk S5Ri|*ChK4Q4*~!0PyYwa2 - * Copyright (C) 2019 Alicealalalamdskfldmjgdfgdfhfghgfh Adminson - * - * 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 mrp/admin/setup.php - * \ingroup mrp - * \brief Mrp setup page. - */ - -// Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; -if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; -if (! $res) die("Include of main fails"); - -global $langs, $user; - -// Libraries -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; -require_once '../lib/mrp.lib.php'; -//require_once "../class/myclass.class.php"; - -// Translations -$langs->loadLangs(array("admin", "mrp")); - -// Access control -if (! $user->admin) accessforbidden(); - -// Parameters -$action = GETPOST('action', 'alpha'); -$backtopage = GETPOST('backtopage', 'alpha'); - -$arrayofparameters=array( - 'MRP_MYPARAM1'=>array('css'=>'minwidth200','enabled'=>1), - 'MRP_MYPARAM2'=>array('css'=>'minwidth500','enabled'=>1) -); - - - -/* - * Actions - */ - -if ((float) DOL_VERSION >= 6) -{ - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} - - - -/* - * View - */ - -$page_name = "MrpSetup"; -llxHeader('', $langs->trans($page_name)); - -// Subheader -$linkback = ''.$langs->trans("BackToModuleList").''; - -print load_fiche_titre($langs->trans($page_name), $linkback, 'object_mrp'); - -// Configuration header -$head = mrpAdminPrepareHead(); -dol_fiche_head($head, 'settings', '', -1, "mrp"); - -// Setup page goes here -echo ''.$langs->trans("MrpSetupPage").'

'; - - -if ($action == 'edit') -{ - print '

'; - print ''; - print ''; - - print ''; - print ''; - - foreach($arrayofparameters as $key => $val) - { - print ''; - } - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); - print $form->textwithpicto($langs->trans($key), $tooltiphelp); - print '
'; - - print '
'; - print ''; - print '
'; - - print '
'; - print '
'; -} -else -{ - if (! empty($arrayofparameters)) - { - print ''; - print ''; - - foreach($arrayofparameters as $key => $val) - { - print ''; - } - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); - print $form->textwithpicto($langs->trans($key), $tooltiphelp); - print '' . $conf->global->$key . '
'; - - print '
'; - print ''.$langs->trans("Modify").''; - print '
'; - } - else - { - print '
'.$langs->trans("NothingToSetup"); - } -} - - -// Page end -dol_fiche_end(); - -llxFooter(); -$db->close(); From b8803fa8dfdc28e363769239bc28a4bc97ed2f9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 22:56:08 +0100 Subject: [PATCH 16/38] Work on MO --- htdocs/admin/mrp.php | 2 +- htdocs/core/modules/modMrp.class.php | 6 +++--- .../{mod_mrp_advanced.php => mod_mo_advanced.php} | 12 ++++++------ .../{mod_mrp_standard.php => mod_mo_standard.php} | 14 +++++++------- htdocs/mrp/class/mo.class.php | 6 +++--- htdocs/mrp/lib/mrp.lib.php | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) rename htdocs/core/modules/mrp/{mod_mrp_advanced.php => mod_mo_advanced.php} (93%) rename htdocs/core/modules/mrp/{mod_mrp_standard.php => mod_mo_standard.php} (90%) diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index f3121faa70d..06c59338e58 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -232,7 +232,7 @@ foreach ($dirmodels as $reldir) { while (($file = readdir($handle))!==false) { - if (substr($file, 0, 8) == 'mod_mo_' && substr($file, dol_strlen($file)-3, 3) == 'php') + if (substr($file, 0, 7) == 'mod_mo_' && substr($file, dol_strlen($file)-3, 3) == 'php') { $file = substr($file, 0, dol_strlen($file)-4); diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 248179b5447..bc85111ebd2 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -135,9 +135,9 @@ class modMrp extends DolibarrModules // 2 => array('MRP_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1) // ); $this->const = array( - 1=>array('MRP_MO_ADDON_PDF', 'chaine', 'alpha', 'Name of PDF model of BOM', 0), - 2=>array('MRP_MO_ADDON', 'chaine', 'mod_bom_standard', 'Name of numbering rules of BOM', 0), - 3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/boms', '', 0) + 1=>array('MRP_MO_ADDON_PDF', 'chaine', 'alpha', 'Name of PDF model of MO', 0), + 2=>array('MRP_MO_ADDON', 'chaine', 'mod_mo_standard', 'Name of numbering rules of MO', 0), + 3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/mrps', '', 0) ); // Some keys to add into the overwriting translation tables diff --git a/htdocs/core/modules/mrp/mod_mrp_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php similarity index 93% rename from htdocs/core/modules/mrp/mod_mrp_advanced.php rename to htdocs/core/modules/mrp/mod_mo_advanced.php index 1c24b4010ba..42c506194f3 100644 --- a/htdocs/core/modules/mrp/mod_mrp_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/core/modules/mrp/mod_mrp_advanced.php + * \file htdocs/core/modules/mrp/mod_mo_advanced.php * \ingroup mrp * \brief File containing class for numbering model of MOs advanced */ @@ -30,9 +30,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/mrp/modules_mrp.php'; /** - * Class to manage customer Bom numbering rules advanced + * Class to manage MO numbering rules advanced */ -class mod_mrp_advanced extends ModeleNumRefMos +class mod_mo_advanced extends ModeleNumRefMos { /** * Dolibarr version of the loaded document @@ -68,7 +68,7 @@ class mod_mrp_advanced extends ModeleNumRefMos $texte.= '
'; $texte.= ''; $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; $tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("Mo"), $langs->transnoentities("Mo")); @@ -79,7 +79,7 @@ class mod_mrp_advanced extends ModeleNumRefMos // Parametrage du prefix $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; @@ -129,7 +129,7 @@ class mod_mrp_advanced extends ModeleNumRefMos require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; // We get cursor rule - $mask=$conf->global->MRP_ADVANCED_MASK; + $mask=$conf->global->MRP_MO_ADVANCED_MASK; if (! $mask) { diff --git a/htdocs/core/modules/mrp/mod_mrp_standard.php b/htdocs/core/modules/mrp/mod_mo_standard.php similarity index 90% rename from htdocs/core/modules/mrp/mod_mrp_standard.php rename to htdocs/core/modules/mrp/mod_mo_standard.php index 24f1b0a1f69..6d392a6b74c 100644 --- a/htdocs/core/modules/mrp/mod_mrp_standard.php +++ b/htdocs/core/modules/mrp/mod_mo_standard.php @@ -18,16 +18,16 @@ */ /** - * \file htdocs/core/modules/mrp/mod_mrp_standard.php + * \file htdocs/core/modules/mrp/mod_mo_standard.php * \ingroup mrp * \brief File of class to manage MO numbering rules standard */ require_once DOL_DOCUMENT_ROOT .'/core/modules/mrp/modules_mrp.php'; /** - * Class to manage customer order numbering rules standard + * Class to manage MO numbering rules standard */ -class mod_mrp_standard extends ModeleNumRefMos +class mod_mo_standard extends ModeleNumRefMos { /** * Dolibarr version of the loaded document @@ -85,7 +85,7 @@ class mod_mrp_standard extends ModeleNumRefMos $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."bom"; + $sql.= " FROM ".MAIN_DB_PREFIX."mrp_mo"; $sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; @@ -119,7 +119,7 @@ class mod_mrp_standard extends ModeleNumRefMos // D'abord on recupere la valeur max $posindice=9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."bom_bom"; + $sql.= " FROM ".MAIN_DB_PREFIX."mrp_mo"; $sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; @@ -132,7 +132,7 @@ class mod_mrp_standard extends ModeleNumRefMos } else { - dol_syslog("mod_mrp_standard::getNextValue", LOG_DEBUG); + dol_syslog("mod_mo_standard::getNextValue", LOG_DEBUG); return -1; } @@ -143,7 +143,7 @@ class mod_mrp_standard extends ModeleNumRefMos if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is else $num = sprintf("%04s", $max+1); - dol_syslog("mod_mrp_standard::getNextValue return ".$this->prefix.$yymm."-".$num); + dol_syslog("mod_mo_standard::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } } diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 0525f71ab5f..d19807c03c6 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -94,8 +94,10 @@ class Mo extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>'1',), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>20, 'notnull'=>1, 'default'=>'1', 'index'=>1,), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',), + 'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM",), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce",), 'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce",), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'enabled'=>1, 'visible'=>-1, 'position'=>52), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,), @@ -105,10 +107,8 @@ class Mo extends CommonObject 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',), 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce",), 'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'), 'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,), - 'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM",), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1,), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>4, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '-1'=>'Canceled')), ); diff --git a/htdocs/mrp/lib/mrp.lib.php b/htdocs/mrp/lib/mrp.lib.php index 7ee1fcd04c7..4fdfa25342e 100644 --- a/htdocs/mrp/lib/mrp.lib.php +++ b/htdocs/mrp/lib/mrp.lib.php @@ -35,7 +35,7 @@ function mrpAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/mrp/admin/setup.php", 1); + $head[$h][0] = dol_buildpath("/admin/mrp.php", 1); $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; From fb95d14aebd07964351f4d1fdbe2e22e29945b36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 23:02:51 +0100 Subject: [PATCH 17/38] Work on MO --- htdocs/langs/en_US/mrp.lang | 5 ++++- htdocs/mrp/class/mo.class.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 4fc51f5a114..bc71a65f72a 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -21,11 +21,14 @@ FreeLegalTextOnBOMs=Free text on document of BOM WatermarkOnDraftBOMs=Watermark on draft BOM FreeLegalTextOnMOs=Free text on document of MO WatermarkOnDraftMOs=Watermark on draft MO -ConfirmCloneBillOfMaterials=Are you sure you want to clone this bill of material ? +ConfirmCloneBillOfMaterials=Are you sure you want to clone the bill of material %s ? +ConfirmCloneMo=Are you sure you want to clone the Manufacturing Order %s ? ManufacturingEfficiency=Manufacturing efficiency ValueOfMeansLoss=Value of 0.95 means an average of 5%% of loss during the production DeleteBillOfMaterials=Delete Bill Of Materials +DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Material? +ConfirmDeleteMo=Are you sure you want to delete this Bill Of Material? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index d19807c03c6..71a743eb071 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -110,7 +110,7 @@ class Mo extends CommonObject 'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'), 'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>4, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '-1'=>'Canceled')), + 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '-1'=>'Canceled')), ); public $rowid; public $ref; From c9fc17efaea936e2c0ef10140bccd5d44d12dc4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 23:06:34 +0100 Subject: [PATCH 18/38] Fix phpcs --- htdocs/societe/canvas/company/tpl/card_edit.tpl.php | 4 ++-- htdocs/societe/canvas/individual/tpl/card_edit.tpl.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 5f513fa886a..474d97d07c2 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -77,7 +77,7 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['ismodifiable_customercode']) { ?> - control->tpl['customercode']; ?> + control->tpl['customercode']; ?> @@ -98,7 +98,7 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['ismodifiable_suppliercode']) { ?> - control->tpl['suppliercode']; ?> + control->tpl['suppliercode']; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index d25a9f36121..98ef1dcea18 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -75,7 +75,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_customercode']) { ?> - control->tpl['customercode']; ?> + control->tpl['customercode']; ?> @@ -96,7 +96,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_suppliercode']) { ?> - control->tpl['suppliercode']; ?> + control->tpl['suppliercode']; ?> From 036c1410c79703ec25893ef4fb36bca8994c16aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 23:17:08 +0100 Subject: [PATCH 19/38] NEW Save user of last modification in donation record --- htdocs/don/card.php | 2 +- htdocs/don/class/don.class.php | 59 ++++--------------- .../install/mysql/migration/10.0.0-11.0.0.sql | 2 + htdocs/install/mysql/tables/llx_don.sql | 1 + 4 files changed, 15 insertions(+), 49 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 54d4e392f61..b804f3c7a46 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -741,7 +741,7 @@ if (! empty($id) && $action != 'edit') { $num = $db->num_rows($resql); $i = 0; $total = 0; - print '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 43bdcead36f..b24213d5c70 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -123,10 +123,11 @@ class Don extends CommonObject */ public $labelstatutshort; - /** - * Draft - */ + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_PAID = 2; + const STATUS_CANCELED = -1; /** @@ -155,11 +156,11 @@ class Don extends CommonObject /** * Return the label of a given status * - * @param int $statut Id statut + * @param int $status 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 * @return string Libelle du statut */ - public function LibStatut($statut, $mode = 0) + public function LibStatut($status, $mode = 0) { // phpcs:enable if (empty($this->labelstatut) || empty($this->labelstatutshort)) @@ -176,49 +177,11 @@ class Don extends CommonObject $this->labelstatutshort[2]=$langs->trans("DonationStatusPaidShort"); } - if ($mode == 0) - { - return $this->labelstatut[$statut]; - } - elseif ($mode == 1) - { - return $this->labelstatutshort[$statut]; - } - elseif ($mode == 2) - { - if ($statut == -1) return img_picto($this->labelstatut[$statut], 'statut5').' '.$this->labelstatutshort[$statut]; - elseif ($statut == 0) return img_picto($this->labelstatut[$statut], 'statut0').' '.$this->labelstatutshort[$statut]; - elseif ($statut == 1) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatutshort[$statut]; - elseif ($statut == 2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatutshort[$statut]; - } - elseif ($mode == 3) - { - if ($statut == -1) return img_picto($this->labelstatut[$statut], 'statut5'); - elseif ($statut == 0) return img_picto($this->labelstatut[$statut], 'statut0'); - elseif ($statut == 1) return img_picto($this->labelstatut[$statut], 'statut1'); - elseif ($statut == 2) return img_picto($this->labelstatut[$statut], 'statut6'); - } - elseif ($mode == 4) - { - if ($statut == -1) return img_picto($this->labelstatut[$statut], 'statut5').' '.$this->labelstatut[$statut]; - elseif ($statut == 0) return img_picto($this->labelstatut[$statut], 'statut0').' '.$this->labelstatut[$statut]; - elseif ($statut == 1) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatut[$statut]; - elseif ($statut == 2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatut[$statut]; - } - elseif ($mode == 5) - { - if ($statut == -1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut], 'statut5'); - elseif ($statut == 0) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut], 'statut0'); - elseif ($statut == 1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1'); - elseif ($statut == 2) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6'); - } - elseif ($mode == 6) - { - if ($statut == -1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut5'); - elseif ($statut == 0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut0'); - elseif ($statut == 1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1'); - elseif ($statut == 2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6'); - } + $statusType = 'status'.$status; + if ($status == self::STATUS_CANCELED) $statusType = 'status5'; + if ($status == self::STATUS_PAID) $statusType = 'status6'; + + return dolGetStatus($this->labelstatut[$status], $this->labelstatutshort[$status], '', $statusType, $mode); } diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 064db3be207..d599f1b40ed 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -49,6 +49,8 @@ UPDATE llx_c_units SET label = 'SurfaceUnitm2' WHERE code IN ('M2'); -- For v11 +ALTER TABLE llx_don ADD COLUMN fk_user_modif integer; + ALTER TABLE llx_expeditiondet ADD INDEX idx_expeditiondet_fk_origin_line (fk_origin_line); ALTER TABLE llx_rights_def ADD COLUMN module_position INTEGER NOT NULL DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_don.sql b/htdocs/install/mysql/tables/llx_don.sql index ee17fdd1e67..f03e82d6143 100644 --- a/htdocs/install/mysql/tables/llx_don.sql +++ b/htdocs/install/mysql/tables/llx_don.sql @@ -47,6 +47,7 @@ create table llx_don fk_projet integer NULL, -- Donation is given for a project ? datec datetime, -- Create date fk_user_author integer NOT NULL, + fk_user_modif integer, date_valid datetime, -- date de validation fk_user_valid integer NULL, note_private text, From 68a4ddceed20849a06a610cf6d4ca9c44af21bea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 23:29:17 +0100 Subject: [PATCH 20/38] Look and feel v11 --- htdocs/product/class/product.class.php | 29 +++++++------- htdocs/product/index.php | 4 +- htdocs/societe/class/societe.class.php | 4 +- htdocs/societe/index.php | 2 +- htdocs/user/class/user.class.php | 55 +++++++++++--------------- htdocs/user/list.php | 2 +- 6 files changed, 42 insertions(+), 54 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2ba78b32945..bf2b3a0e410 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4380,10 +4380,10 @@ class Product extends CommonObject /** * Return label of a given status * - * @param int $status Statut - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto - * @param int $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" - * @return string Label of status + * @param int $status Statut + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @param int $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" + * @return string Label of status */ public function LibStatut($status, $mode = 0, $type = 0) { @@ -4420,42 +4420,41 @@ class Product extends CommonObject $statuttrans=empty($status)?'status5':'status4'; - if($status == 0){ + if ($status == 0) { // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" - if($type==0){ + if($type==0) { $labelstatut = $langs->trans('ProductStatusNotOnSellShort'); $labelstatutShort = $langs->trans('ProductStatusNotOnSell'); } - elseif($type == 1){ + elseif($type == 1) { $labelstatut = $langs->trans('ProductStatusNotOnBuyShort'); $labelstatutShort = $langs->trans('ProductStatusNotOnBuy'); } - elseif($type == 2){ + elseif($type == 2) { $labelstatut = $langs->trans('ProductStatusNotOnBatch'); $labelstatutShort = $langs->trans('ProductStatusNotOnBatchShort'); } } - elseif($status == 1){ + elseif ($status == 1) { // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" - if($type==0){ + if ($type==0) { $labelstatut = $langs->trans('ProductStatusOnSellShort'); $labelstatutShort = $langs->trans('ProductStatusOnSell'); } - elseif($type == 1){ + elseif ($type == 1) { $labelstatut = $langs->trans('ProductStatusOnBuyShort'); $labelstatutShort = $langs->trans('ProductStatusOnBuy'); } - elseif($type == 2){ + elseif ($type == 2) { $labelstatut = $langs->trans('ProductStatusOnBatch'); $labelstatutShort = $langs->trans('ProductStatusOnBatchShort'); } } - if($mode>6){ + if ($mode > 6) { return dolGetStatus($langs->trans('Unknown'), '', '', 'status0', 0); - } - else{ + } else { return dolGetStatus($labelstatut, $labelstatutShort, '', $statuttrans, $mode); } } diff --git a/htdocs/product/index.php b/htdocs/product/index.php index a92d2cd071a..477dcc20b0c 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -360,10 +360,10 @@ if ($result) print ''; } print '"; print '"; print "\n"; $i++; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index b20f80f5439..fe8c78c7aa2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2258,8 +2258,8 @@ class Societe extends CommonObject /** * Return label of status (activity, closed) * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * @return string Libelle + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status */ public function getLibStatut($mode = 0) { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 5bd493fdeba..b2962478b17 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -316,7 +316,7 @@ if ($result) print dol_print_date($thirdparty_static->datem, 'day'); print ""; print '"; print "\n"; $i++; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index db919c9bf0a..6e7d2540d32 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -201,6 +201,12 @@ class User extends CommonObject 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name','enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), ); + + const STATUS_DISABLED = 0; + const STATUS_ENABLED = 1; + + + /** * Constructor of the class * @@ -2478,48 +2484,31 @@ class User extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Renvoi le libelle d'un statut donne + * Return label of a status of user (active, inactive) * - * @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 int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ - public function LibStatut($statut, $mode = 0) + public function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; - $langs->load('users'); - if ($mode == 0) + if (empty($this->labelstatus) || empty($this->labelstatusshort)) { - if ($statut == 1) return $langs->trans('Enabled'); - elseif ($statut == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 1) - { - if ($statut == 1) return $langs->trans('Enabled'); - elseif ($statut == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 2) - { - if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"').' '.$langs->trans('Enabled'); - elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"').' '.$langs->trans('Disabled'); - } - elseif ($mode == 3) - { - if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"'); - elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"'); - } - elseif ($mode == 4) - { - if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"').' '.$langs->trans('Enabled'); - elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"').' '.$langs->trans('Disabled'); - } - elseif ($mode == 5) - { - if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4', 'class="pictostatus"'); - elseif ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5', 'class="pictostatus"'); + global $langs; + //$langs->load("mymodule"); + $this->labelstatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelstatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); + $this->labelstatusshort[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelstatusshort[self::STATUS_DISABLED] = $langs->trans('Disabled'); } + + $statusType = 'status5'; + if ($status == self::STATUS_ENABLED) $statusType = 'status4'; + + return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); } diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 3b334871c06..668f05fa6c2 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -677,7 +677,7 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['u.statut']['checked'])) { $userstatic->statut=$obj->statut; - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Action column From 6a39ecc3c00a22c2411e2be0c5aa3afe63f3301d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 23:33:11 +0100 Subject: [PATCH 21/38] Fix phpcs --- htdocs/societe/canvas/individual/tpl/card_edit.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 98ef1dcea18..61fd7bdefdf 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -75,7 +75,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_customercode']) { ?> - control->tpl['customercode']; ?> + control->tpl['customercode']; ?> @@ -96,7 +96,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_suppliercode']) { ?> - control->tpl['suppliercode']; ?> + control->tpl['suppliercode']; ?> From aa306bf5d427f9d179fc28bbe817b6ce7027b9e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 23:50:36 +0100 Subject: [PATCH 22/38] Debug widgets --- htdocs/core/boxes/box_ficheinter.php | 2 +- htdocs/core/boxes/box_task.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index a646d6556ba..ed3569cc3e4 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -138,7 +138,7 @@ class box_ficheinter extends ModeleBoxes $this->info_box_contents[$i][] = array( 'td' => 'class="nowrap right"', - 'text' => $ficheinterstatic->getLibStatut(6), + 'text' => $ficheinterstatic->getLibStatut(3), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index e285cc34289..1039ea74385 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -119,25 +119,25 @@ class box_task extends ModeleBoxes // list the summary of the orders if ($user->rights->projet->lire) { $boxcontent.= '
'."\n"; - $boxcontent.= '
'."\n"; + $boxcontent.= '
'."\n"; $boxcontent.= 'boxcode.'">'."\n"; $boxcontent.= ''."\n"; $selectArray = array('all' => $langs->trans("NoFilter"), 'im_task_contact' => $langs->trans("WhichIamLinkedTo"), 'im_project_contact' => $langs->trans("WhichIamLinkedToProject")); $boxcontent.= $form->selectArray($cookie_name, $selectArray, $filterValue); - $boxcontent.= ''; + $boxcontent.= ''; $boxcontent.= ''."\n"; $boxcontent.= '
'."\n"; $boxcontent.= ''; // set cookie by js $boxcontent.=''; $this->info_box_contents[0][] = array( - 'tr'=>'class="nohover"', + 'tr'=>'class="nohover showiffilter'.$this->boxcode.' hideobject"', 'td' => 'class="nohover"', 'textnoformat' => $boxcontent, ); @@ -188,7 +188,7 @@ class box_task extends ModeleBoxes $label = $projectstatic->getNomUrl(1).' '.$taskstatic->getNomUrl(1).' '.dol_htmlentities($taskstatic->label); - $boxcontent = getTaskProgressView($taskstatic, $label, true, false, true); + $boxcontent = getTaskProgressView($taskstatic, $label, true, false, false); $this->info_box_contents[$i][] = array( 'td' => '', From 01ac313a8750201b85d285b81ea57a11cb49617a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Oct 2019 23:52:05 +0100 Subject: [PATCH 23/38] Fix phpcs --- htdocs/societe/canvas/company/tpl/card_edit.tpl.php | 4 ++-- htdocs/societe/canvas/individual/tpl/card_edit.tpl.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 474d97d07c2..3f1740d395c 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -77,7 +77,7 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['ismodifiable_customercode']) { ?> - control->tpl['customercode']; ?> + control->tpl['customercode']; ?> @@ -98,7 +98,7 @@ $contact = $GLOBALS['objcanvas']->control->object; control->tpl['ismodifiable_suppliercode']) { ?> - control->tpl['suppliercode']; ?> + control->tpl['suppliercode']; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 61fd7bdefdf..976b00962d8 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -75,7 +75,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_customercode']) { ?> - control->tpl['customercode']; ?> + control->tpl['customercode']; ?> @@ -96,7 +96,7 @@ if (empty($conf) || ! is_object($conf)) control->tpl['ismodifiable_suppliercode']) { ?> - control->tpl['suppliercode']; ?> + control->tpl['suppliercode']; ?> From 70530b558de3ee64b872ed0524e8b70c5e6b4422 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 03:10:48 +0100 Subject: [PATCH 24/38] Enable / Disable js css in modulebuilder --- htdocs/modulebuilder/index.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 0bb48af3b46..3c9b23c7638 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -480,10 +480,15 @@ if ($dirins && $action == 'initcss' && !empty($module)) 'Mon module'=>$modulename, 'mon module'=>$modulename, 'htdocs/modulebuilder/template'=>strtolower($modulename), - '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') + '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':''), ); dolReplaceInFile($destfile, $arrayreplacement); + + // Update descriptor file to uncomment file + $srcfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; + $arrayreplacement = array('/\/\/\s*\''.preg_quote('/'.strtolower($module).'/css/'.strtolower($module).'.css.php', '/').'\'/' => '\'/'.strtolower($module).'/css/'.strtolower($module).'.css.php\''); + dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1); } else { @@ -518,6 +523,11 @@ if ($dirins && $action == 'initjs' && !empty($module)) ); dolReplaceInFile($destfile, $arrayreplacement); + + // Update descriptor file to uncomment file + $srcfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; + $arrayreplacement = array('/\/\/\s*\''.preg_quote('/'.strtolower($module).'/js/'.strtolower($module).'.js.php', '/').'\'/' => '\'/'.strtolower($module).'/js/'.strtolower($module).'.js.php\''); + dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1); } else { @@ -635,6 +645,14 @@ if ($dirins && $action == 'confirm_removefile' && !empty($module)) $result = dol_delete_file($filetodelete); if (dol_is_dir_empty($dirtodelete)) dol_delete_dir($dirtodelete); + + // Update descriptor file to comment file + if (in_array($tab, array('css', 'js'))) + { + $srcfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; + $arrayreplacement = array('/^\s*\''.preg_quote('/'.$relativefilename, '/').'\',*/m'=>' // \'/'.$relativefilename.'\','); + dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1); + } } } @@ -1967,7 +1985,10 @@ elseif (! empty($module)) print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("LanguageFile").' : '.$dicts['langs'].'
'; + print ' '.$langs->trans("LanguageFile").' : '; + if (! is_array($dicts) || empty($dicts)) print ''.$langs->trans("NoDictionaries").''; + else print ''.$dicts['langs'].''; + print '
'; print load_fiche_titre($langs->trans("ListOfDictionariesEntries"), '', ''); From 5b5a2e98048892919937019660027488f0cac1c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 03:25:09 +0100 Subject: [PATCH 25/38] Clean code --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/modulebuilder/index.php | 8 ++++---- htdocs/theme/eldy/global.inc.php | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4d4a20f3a5c..943afe69a1a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2997,7 +2997,7 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @param string $alt Force alt for bind people * @param string $morecss Add more class css on img tag (For example 'myclascss'). Work only if $moreatt is empty. - * @param string $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left maring on picto, 0 = No margin left. Works for fontawesome picto only. + * @param string $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No margin left. Works for fontawesome picto only. * @return string Return img tag * @see img_object(), img_picto_common() */ diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 3c9b23c7638..234746a0d83 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1641,14 +1641,14 @@ elseif (! empty($module)) $linktoenabledisable=''; if (! empty($conf->global->$const_name)) // If module is already activated { - $linktoenabledisable.=''; - $linktoenabledisable.=img_picto($langs->trans("Activated"), 'switch_on'); + $linktoenabledisable.=''; + $linktoenabledisable.=img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', '', 1); $linktoenabledisable.=''; } else { - $linktoenabledisable.=''; - $linktoenabledisable.=img_picto($langs->trans("Disabled"), 'switch_off'); + $linktoenabledisable.=''; + $linktoenabledisable.=img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', 1); $linktoenabledisable.="\n"; } if (! empty($conf->$modulelowercase->enabled)) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c3bbc92af9c..cf5c4f9703a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -521,7 +521,8 @@ body[class*="colorblind-"] .text-success{ } .fa-toggle-on, .fa-toggle-off { font-size: 2em; } -.websiteselectionsection .fa-toggle-on, .websiteselectionsection .fa-toggle-off { font-size: 1.5em; vertical-align: text-bottom; } +.websiteselectionsection .fa-toggle-on, .websiteselectionsection .fa-toggle-off, +.asetresetmodule .fa-toggle-on, .asetresetmodule .fa-toggle-off { font-size: 1.5em; vertical-align: text-bottom; } /* Themes for badges */ From e684c1c4504d920b4db4f3b8c668bd2b102ff534 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 12:11:29 +0100 Subject: [PATCH 26/38] Look and feel v11 --- .../class/expensereport.class.php | 31 ++------ htdocs/holiday/class/holiday.class.php | 78 ++++++------------- htdocs/hrm/index.php | 76 +----------------- 3 files changed, 34 insertions(+), 151 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 485373c5840..52072b63578 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -101,9 +101,6 @@ class ExpenseReport extends CommonObject // Paiement public $user_paid_infos; - /* - END ACTIONS - */ /** * Draft status @@ -198,7 +195,7 @@ class ExpenseReport extends CommonObject // List of language codes for status $this->statuts_short = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); $this->statuts = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); - $this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut5'); + $this->statuts_logo = array(0 => 'status0', 2 => 'status1', 4 => 'status6', 5 => 'status4', 6 => 'status6', 99 => 'status5'); } /** @@ -683,29 +680,15 @@ class ExpenseReport extends CommonObject */ public function LibStatut($status, $mode = 0) { - // phpcs:enable - global $langs; + // phpcs:enable + global $langs; - if ($mode == 0) - return $langs->transnoentities($this->statuts[$status]); + $labelstatus = $langs->trans($this->statuts[$status]); + $labelstatusshort = $langs->trans($this->statuts_short[$status]); - elseif ($mode == 1) - return $langs->transnoentities($this->statuts_short[$status]); + $statusType = $this->statuts_logo[$status]; - elseif ($mode == 2) - return img_picto($langs->transnoentities($this->statuts_short[$status]), $this->statuts_logo[$status]).' '.$langs->transnoentities($this->statuts_short[$status]); - - elseif ($mode == 3) - return img_picto($langs->transnoentities($this->statuts_short[$status]), $this->statuts_logo[$status]); - - elseif ($mode == 4) - return img_picto($langs->transnoentities($this->statuts_short[$status]), $this->statuts_logo[$status]).' '.$langs->transnoentities($this->statuts[$status]); - - elseif ($mode == 5) - return ''.$langs->transnoentities($this->statuts_short[$status]).' '.img_picto($langs->transnoentities($this->statuts_short[$status]), $this->statuts_logo[$status]); - - elseif ($mode == 6) - return $langs->transnoentities($this->statuts[$status]).' '.img_picto($langs->transnoentities($this->statuts_short[$status]), $this->statuts_logo[$status]); + return dolGetStatus($labelstatus, $labelstatusshort, '', $statusType, $mode); } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 0eb02e006e5..8fe5f0570fe 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1217,68 +1217,40 @@ class Holiday extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Returns the label of a statut + * Returns the label of a status * - * @param int $statut id statut + * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param integer $startdate Date holiday should start * @return string Label */ - public function LibStatut($statut, $mode = 0, $startdate = '') + public function LibStatut($status, $mode = 0, $startdate = '') { - // phpcs:enable - global $langs; - - if ($mode == 0) + // phpcs:enable + if (empty($this->labelstatus) || empty($this->labelstatusshort)) { - if ($statut == 1) return $langs->trans('DraftCP'); - elseif ($statut == 2) return $langs->trans('ToReviewCP'); - elseif ($statut == 3) return $langs->trans('ApprovedCP'); - elseif ($statut == 4) return $langs->trans('CancelCP'); - elseif ($statut == 5) return $langs->trans('RefuseCP'); - } - elseif ($mode == 2) - { - $pictoapproved='statut6'; - if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; - if ($statut == 1) return img_picto($langs->trans('DraftCP'), 'statut0').' '.$langs->trans('DraftCP'); // Draft - elseif ($statut == 2) return img_picto($langs->trans('ToReviewCP'), 'statut1').' '.$langs->trans('ToReviewCP'); // Waiting approval - elseif ($statut == 3) return img_picto($langs->trans('ApprovedCP'), $pictoapproved).' '.$langs->trans('ApprovedCP'); - elseif ($statut == 4) return img_picto($langs->trans('CancelCP'), 'statut5').' '.$langs->trans('CancelCP'); - elseif ($statut == 5) return img_picto($langs->trans('RefuseCP'), 'statut5').' '.$langs->trans('RefuseCP'); - } - elseif ($mode == 3) - { - $pictoapproved='statut6'; - if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; - if ($statut == 1) return img_picto($langs->trans('DraftCP'), 'statut0'); - elseif ($statut == 2) return img_picto($langs->trans('ToReviewCP'), 'statut1'); - elseif ($statut == 3) return img_picto($langs->trans('ApprovedCP'), $pictoapproved); - elseif ($statut == 4) return img_picto($langs->trans('CancelCP'), 'statut5'); - elseif ($statut == 5) return img_picto($langs->trans('RefuseCP'), 'statut5'); - } - elseif ($mode == 5) - { - $pictoapproved='statut6'; - if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; - if ($statut == 1) return $langs->trans('DraftCP').' '.img_picto($langs->trans('DraftCP'), 'statut0'); // Draft - elseif ($statut == 2) return $langs->trans('ToReviewCP').' '.img_picto($langs->trans('ToReviewCP'), 'statut1'); // Waiting approval - elseif ($statut == 3) return $langs->trans('ApprovedCP').' '.img_picto($langs->trans('ApprovedCP'), $pictoapproved); - elseif ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'), 'statut5'); - elseif ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'), 'statut5'); - } - elseif ($mode == 6) - { - $pictoapproved='statut6'; - if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; - if ($statut == 1) return $langs->trans('DraftCP').' '.img_picto($langs->trans('DraftCP'), 'statut0'); // Draft - elseif ($statut == 2) return $langs->trans('ToReviewCP').' '.img_picto($langs->trans('ToReviewCP'), 'statut1'); // Waiting approval - elseif ($statut == 3) return $langs->trans('ApprovedCP').' '.img_picto($langs->trans('ApprovedCP'), $pictoapproved); - elseif ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'), 'statut5'); - elseif ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'), 'statut5'); + global $langs; + //$langs->load("mymodule"); + $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('DraftCP'); + $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('ToReviewCP'); + $this->labelstatus[self::STATUS_APPROVED] = $langs->trans('ApprovedCP'); + $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('CancelCP'); + $this->labelstatus[self::STATUS_REFUSED] = $langs->trans('RefuseCP'); + $this->labelstatusshort[self::STATUS_DRAFT] = $langs->trans('DraftCP'); + $this->labelstatusshort[self::STATUS_VALIDATED] = $langs->trans('ToReviewCP'); + $this->labelstatusshort[self::STATUS_APPROVED] = $langs->trans('ApprovedCP'); + $this->labelstatusshort[self::STATUS_CANCELED] = $langs->trans('CancelCP'); + $this->labelstatusshort[self::STATUS_REFUSED] = $langs->trans('RefuseCP'); } - else return $statut; + $statusType = 'status6'; + if (! empty($startdate) && $startdate > dol_now()) $statusType = 'status4'; + if ($status == self::STATUS_DRAFT) $statusType = 'status0'; + if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; + if ($status == self::STATUS_CANCELED) $statusType = 'status5'; + if ($status == self::STATUS_REFUSED) $statusType = 'status5'; + + return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); } diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 9d9d2fcd632..9fa758f8338 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -248,84 +248,13 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) } print '
'.$langs->trans("RefPayment").''.$langs->trans("Date").''; - print $product_static->LibStatut($objp->tosell, 3, 0); + print $product_static->LibStatut($objp->tosell, 5, 0); print "'; - print $product_static->LibStatut($objp->tobuy, 3, 1); + print $product_static->LibStatut($objp->tobuy, 5, 1); print "
'; - print $thirdparty_static->getLibStatut(3); + print $thirdparty_static->getLibStatut(5); print "
'.$userstatic->getLibStatut(3).''.$userstatic->getLibStatut(5).'
'; print ''; + print '
'; } else dol_print_error($db); } -// Last expense report (old module) -if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) -{ - $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut, u.photo, d.rowid, d.dated as date, d.tms as dm, d.km, d.fk_statut"; - $sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE u.rowid = d.fk_user"; - $sql.= " AND d.entity = ".$conf->entity; - if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',', $childids).')'; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND d.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if (!empty($socid)) $sql.= " AND d.fk_soc = ".$socid; - $sql.= $db->order("d.tms", "DESC"); - $sql.= $db->plimit($max, 0); - - $result = $db->query($sql); - if ($result) - { - $var=false; - $num = $db->num_rows($result); - - $i = 0; - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - if ($num) - { - $total_ttc = $totalam = $total = 0; - - $deplacementstatic=new Deplacement($db); - $userstatic=new User($db); - while ($i < $num && $i < $max) - { - $obj = $db->fetch_object($result); - - $deplacementstatic->ref=$obj->rowid; - $deplacementstatic->id=$obj->rowid; - - $userstatic->id=$obj->uid; - $userstatic->lastname=$obj->lastname; - $userstatic->firstname=$obj->firstname; - $userstatic->login=$obj->login; - $userstatic->email=$obj->email; - $userstatic->statut=$obj->statut; - $userstatic->photo=$obj->photo; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $i++; - } - } - else - { - print ''; - } - print '
'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).''.$langs->trans("FeesKilometersOrAmout").''.$langs->trans("DateModificationShort").' 
'.$deplacementstatic->getNomUrl(1).''.$userstatic->getNomUrl(-1).''.$obj->km.''.dol_print_date($db->jdate($obj->dm), 'day').''.$deplacementstatic->LibStatut($obj->fk_statut, 3).'
'.$langs->trans("None").'
'; - print '
'; - } - else dol_print_error($db); -} - -// Last expense report (new module) +// Latest expense report if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut, u.photo, x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status"; @@ -342,7 +271,6 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire $result = $db->query($sql); if ($result) { - $var=false; $num = $db->num_rows($result); $i = 0; From 1821fa6317c200dac86693ed23a18e62f90722ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 12:48:09 +0100 Subject: [PATCH 27/38] Fix translation of "Terminal" --- htdocs/takepos/takepos.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index dd65469ec05..001fd842165 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -562,23 +562,23 @@ function MoreActions(totalactions){ } } +// Popup to select the terminal to use function TerminalsDialog() { jQuery("#dialog-info").dialog({ resizable: false, - height:220, - width:400, + height: global->TAKEPOS_NUM_TERMINALS / 3 * 20); ?>, + width: dol_optimize_smallscreen ? 316 : 400); ?>, modal: true, buttons: { - Terminal1: function() { + 'trans("Terminal")) ?> 1': function() { location.href='takepos.php?setterminal=1'; } global->TAKEPOS_NUM_TERMINALS; $i++) { - print " - , - Terminal".$i.": function() { + print ", + '".dol_escape_js($langs->trans("Terminal"))." ".$i."': function() { location.href='takepos.php?setterminal=".$i."'; } "; From e3b5be7475467f680247859b93e834ba3398b280 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 12:52:03 +0100 Subject: [PATCH 28/38] All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'. All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. --- ChangeLog | 3 +- htdocs/adherents/class/adherent.class.php | 30 ++++++------- htdocs/adherents/index.php | 8 ++-- htdocs/api/class/api.class.php | 4 +- htdocs/bom/class/bom.class.php | 10 ++--- htdocs/comm/propal/class/propal.class.php | 28 ++++++------- htdocs/commande/class/commande.class.php | 34 +++++++-------- .../cashcontrol/class/cashcontrol.class.php | 12 +++--- .../class/bonprelevement.class.php | 42 +++++++++---------- htdocs/contact/class/contact.class.php | 8 ++-- htdocs/core/class/commoninvoice.class.php | 34 +++++++-------- htdocs/core/lib/functions.lib.php | 3 +- htdocs/don/class/don.class.php | 24 +++++------ .../class/emailcollector.class.php | 30 ++++++------- .../class/emailcollectoraction.class.php | 30 ++++++------- .../class/emailcollectorfilter.class.php | 30 ++++++------- .../class/expensereport.class.php | 6 +-- htdocs/holiday/class/holiday.class.php | 24 +++++------ .../template/class/myobject.class.php | 16 +++---- htdocs/mrp/class/mo.class.php | 14 +++---- htdocs/product/class/product.class.php | 28 ++++++------- htdocs/product/index.php | 14 +++---- .../inventory/class/inventory.class.php | 10 ++--- htdocs/projet/graph_opportunities.inc.php | 14 +++---- htdocs/societe/class/societe.class.php | 12 +++--- htdocs/societe/index.php | 4 +- .../class/supplier_proposal.class.php | 28 ++++++------- htdocs/user/class/user.class.php | 12 +++--- htdocs/website/class/website.class.php | 12 +++--- htdocs/website/class/websitepage.class.php | 12 +++--- htdocs/zapier/class/hook.class.php | 30 ++++++------- 31 files changed, 284 insertions(+), 282 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6a1c949bf5..ab23a79d299 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,7 +25,8 @@ Following changes may create regressions for some external modules, but were nec * The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE. * The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS. * If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu. - +* All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'. +* All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 8f546b3d3c2..9d0e0fa47dc 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2181,48 +2181,48 @@ class Adherent extends CommonObject $langs->load("members"); $statusType = ''; - $labelstatut = ''; - $labelstatutShort = ''; + $labelStatus = ''; + $labelStatusShort = ''; if ($statut == -1) { $statusType = 'status0'; - $labelstatut = $langs->trans("MemberStatusDraft"); - $labelstatutShort = $langs->trans("MemberStatusDraftShort"); + $labelStatus = $langs->trans("MemberStatusDraft"); + $labelStatusShort = $langs->trans("MemberStatusDraftShort"); } elseif ($statut >= 1) { if ($need_subscription == 0) { $statusType = 'status4'; - $labelstatut = $langs->trans("MemberStatusNoSubscription"); - $labelstatutShort = $langs->trans("MemberStatusNoSubscriptionShort"); + $labelStatus = $langs->trans("MemberStatusNoSubscription"); + $labelStatusShort = $langs->trans("MemberStatusNoSubscriptionShort"); } elseif (! $date_end_subscription) { $statusType = 'status1'; - $labelstatut = $langs->trans("MemberStatusActive"); - $labelstatutShort = $langs->trans("MemberStatusActiveShort"); + $labelStatus = $langs->trans("MemberStatusActive"); + $labelStatusShort = $langs->trans("MemberStatusActiveShort"); } elseif ($date_end_subscription < time()) { $statusType = 'status3'; - $labelstatut = $langs->trans("MemberStatusActiveLate"); - $labelstatutShort = $langs->trans("MemberStatusActiveLateShort"); + $labelStatus = $langs->trans("MemberStatusActiveLate"); + $labelStatusShort = $langs->trans("MemberStatusActiveLateShort"); } else { $statusType = 'status4'; - $labelstatut = $langs->trans("MemberStatusPaid"); - $labelstatutShort = $langs->trans("MemberStatusPaidShort"); + $labelStatus = $langs->trans("MemberStatusPaid"); + $labelStatusShort = $langs->trans("MemberStatusPaidShort"); } } elseif ($statut == 0) { $statusType = 'status6'; - $labelstatut = $langs->trans("MemberStatusResiliated"); - $labelstatutShort = $langs->trans("MemberStatusResiliatedShort"); + $labelStatus = $langs->trans("MemberStatusResiliated"); + $labelStatusShort = $langs->trans("MemberStatusResiliatedShort"); } - return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode); + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 3f3c77568c2..a0dc9b81a86 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -61,7 +61,7 @@ $AdherentsResilies=array(); $AdherentType=array(); -// Members list +// Type of membership $sql = "SELECT t.rowid, t.libelle as label, t.subscription,"; $sql.= " d.statut, count(d.rowid) as somme"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t"; @@ -71,7 +71,7 @@ $sql.= " AND d.entity IN (".getEntity('adherent').")"; $sql.= " WHERE t.entity IN (".getEntity('member_type').")"; $sql.= " GROUP BY t.rowid, t.libelle, t.subscription, d.statut"; -dol_syslog("index.php::select nb of members by type", LOG_DEBUG); +dol_syslog("index.php::select nb of members per type", LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -294,7 +294,7 @@ print "
\n"; print '
'; /* - * Last modified members + * Latest modified members */ $max=5; @@ -342,7 +342,7 @@ if ($resql) print '
'.$staticmember->getNomUrl(1, 32).''.$statictype->getNomUrl(1, 32).''.dol_print_date($db->jdate($obj->datem), 'dayhour').''.$staticmember->LibStatut($obj->statut, ($obj->subscription=='yes'?1:0), $db->jdate($obj->date_end_subscription), 5).''.$staticmember->LibStatut($obj->statut, ($obj->subscription=='yes'?1:0), $db->jdate($obj->date_end_subscription), 3).'
'; - $colnb=4; + $colnb=2; if (empty($conf->global->PRODUIT_MULTIPRICES)) $colnb++; print ''; - print ''; while ($i < $num) @@ -359,11 +359,11 @@ if ($result) else print price($objp->price).' '.$langs->trans("HT"); print ''; } - print '"; - print '"; print "\n"; $i++; diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 775ffcf3e5c..4434f82fbcf 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -396,16 +396,16 @@ class Inventory extends CommonObject // phpcs:enable global $langs; - if (empty($this->labelstatus)) + if (empty($this->labelStatus)) { global $langs; //$langs->load("mrp"); - $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); } - return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', 'status'.$status, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatus[$status], '', 'status'.$status, $mode); } /** diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 7d75544ef93..0987a47e507 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -55,20 +55,20 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) $listofstatus=array_keys($listofoppstatus); foreach ($listofstatus as $status) { - $labelstatus = ''; + $labelStatus = ''; $code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code'); - if ($code) $labelstatus = $langs->trans("OppStatus".$code); - if (empty($labelstatus)) $labelstatus=$listofopplabel[$status]; + if ($code) $labelStatus = $langs->trans("OppStatus".$code); + if (empty($labelStatus)) $labelStatus=$listofopplabel[$status]; - //$labelstatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')'; - //$labelstatus .= ' - '.price2num($listofoppstatus[$status]).'%'; + //$labelStatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')'; + //$labelStatus .= ' - '.price2num($listofoppstatus[$status]).'%'; - $dataseries[]=array($labelstatus, (isset($valsamount[$status])?(float) $valsamount[$status]:0)); + $dataseries[]=array($labelStatus, (isset($valsamount[$status])?(float) $valsamount[$status]:0)); if (! $conf->use_javascript_ajax) { print ''; - print ''; + print ''; print ''; print "\n"; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index fe8c78c7aa2..ca17077a47b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2283,15 +2283,15 @@ class Societe extends CommonObject $statusType = 'status4'; if ($status == 0) $statusType = 'status5'; - if (empty($this->labelstatus) || empty($this->labelstatusshort)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - $this->labelstatus[0] = $langs->trans("ActivityCeased"); - $this->labelstatus[1] = $langs->trans("InActivity"); - $this->labelstatusshort[0] = $langs->trans("ActivityCeased"); - $this->labelstatusshort[1] = $langs->trans("InActivity"); + $this->labelStatus[0] = $langs->trans("ActivityCeased"); + $this->labelStatus[1] = $langs->trans("InActivity"); + $this->labelStatusShort[0] = $langs->trans("ActivityCeased"); + $this->labelStatusShort[1] = $langs->trans("InActivity"); } - return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index b2962478b17..a422e199e55 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -232,7 +232,7 @@ print '
'; /* - * Last third parties modified + * Latest modified third parties */ $max=15; $sql = "SELECT s.rowid, s.nom as name, s.email, s.client, s.fournisseur"; @@ -316,7 +316,7 @@ if ($result) print dol_print_date($thirdparty_static->datem, 'day'); print ""; print '
"; print "\n"; $i++; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index be272ee2d36..aa78324ad37 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -158,8 +158,8 @@ class SupplierProposal extends CommonObject public $lines = array(); public $line; - public $labelstatut=array(); - public $labelstatut_short=array(); + public $labelStatus=array(); + public $labelStatusShort=array(); public $nbtodo; public $nbtodolate; @@ -2196,20 +2196,20 @@ class SupplierProposal extends CommonObject // phpcs:enable // Init/load array of translation of status - if (empty($this->labelstatut) || empty($this->labelstatut_short)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; $langs->load("supplier_proposal"); - $this->labelstatut[self::STATUS_DRAFT]=$langs->trans("SupplierProposalStatusDraft"); - $this->labelstatut[self::STATUS_VALIDATED]=$langs->trans("SupplierProposalStatusValidated"); - $this->labelstatut[self::STATUS_SIGNED]=$langs->trans("SupplierProposalStatusSigned"); - $this->labelstatut[self::STATUS_NOTSIGNED]=$langs->trans("SupplierProposalStatusNotSigned"); - $this->labelstatut[self::STATUS_CLOSE]=$langs->trans("SupplierProposalStatusClosed"); - $this->labelstatut_short[self::STATUS_DRAFT]=$langs->trans("SupplierProposalStatusDraftShort"); - $this->labelstatut_short[self::STATUS_VALIDATED]=$langs->trans("Opened"); - $this->labelstatut_short[self::STATUS_SIGNED]=$langs->trans("SupplierProposalStatusSignedShort"); - $this->labelstatut_short[self::STATUS_NOTSIGNED]=$langs->trans("SupplierProposalStatusNotSignedShort"); - $this->labelstatut_short[self::STATUS_CLOSE]=$langs->trans("SupplierProposalStatusClosedShort"); + $this->labelStatus[self::STATUS_DRAFT]=$langs->trans("SupplierProposalStatusDraft"); + $this->labelStatus[self::STATUS_VALIDATED]=$langs->trans("SupplierProposalStatusValidated"); + $this->labelStatus[self::STATUS_SIGNED]=$langs->trans("SupplierProposalStatusSigned"); + $this->labelStatus[self::STATUS_NOTSIGNED]=$langs->trans("SupplierProposalStatusNotSigned"); + $this->labelStatus[self::STATUS_CLOSE]=$langs->trans("SupplierProposalStatusClosed"); + $this->labelStatusShort[self::STATUS_DRAFT]=$langs->trans("SupplierProposalStatusDraftShort"); + $this->labelStatusShort[self::STATUS_VALIDATED]=$langs->trans("Opened"); + $this->labelStatusShort[self::STATUS_SIGNED]=$langs->trans("SupplierProposalStatusSignedShort"); + $this->labelStatusShort[self::STATUS_NOTSIGNED]=$langs->trans("SupplierProposalStatusNotSignedShort"); + $this->labelStatusShort[self::STATUS_CLOSE]=$langs->trans("SupplierProposalStatusClosedShort"); } $statusnew=''; @@ -2219,7 +2219,7 @@ class SupplierProposal extends CommonObject elseif ($status==self::STATUS_NOTSIGNED) $statusnew='status5'; elseif ($status==self::STATUS_CLOSE) $statusnew='status6'; - return dolGetStatus($this->labelstatut[$status], $this->labelstatut_short[$status], '', $statusnew, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusnew, $mode); } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 6e7d2540d32..6baffc74a73 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2495,20 +2495,20 @@ class User extends CommonObject // phpcs:enable global $langs; - if (empty($this->labelstatus) || empty($this->labelstatusshort)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelstatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelstatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); - $this->labelstatusshort[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelstatusshort[self::STATUS_DISABLED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); + $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled'); } $statusType = 'status5'; if ($status == self::STATUS_ENABLED) $statusType = 'status4'; - return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index ac99001bf4b..d84b5232773 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -745,20 +745,20 @@ class Website extends CommonObject // phpcs:enable global $langs; - if (empty($this->labelstatus) || empty($this->labelstatusshort)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelstatusshort[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelstatusshort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); } $statusType = 'status5'; if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; - return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index e85af6244e3..0258198ba10 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -545,20 +545,20 @@ class WebsitePage extends CommonObject // phpcs:enable global $langs; - if (empty($this->labelstatus) || empty($this->labelstatusshort)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelstatusshort[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelstatusshort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); } $statusType = 'status5'; if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; - return dolGetStatus($this->labelstatus[$status], $this->labelstatusshort[$status], '', $statusType, $mode); + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 81b76b1c81f..5c79d68aefe 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -633,37 +633,37 @@ class Hook extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelstatus)) { + if (empty($this->labelStatus)) { global $langs; //$langs->load("zapier@zapier"); - $this->labelstatus[1] = $langs->trans('Enabled'); - $this->labelstatus[0] = $langs->trans('Disabled'); + $this->labelStatus[1] = $langs->trans('Enabled'); + $this->labelStatus[0] = $langs->trans('Disabled'); } if ($mode == 0) { - return $this->labelstatus[$status]; + return $this->labelStatus[$status]; } elseif ($mode == 1) { - return $this->labelstatus[$status]; + return $this->labelStatus[$status]; } elseif ($mode == 2) { if ($status == 1) { - return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } elseif ($status == 0) { - return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; + elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; } elseif ($mode == 5) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 6) { if ($status == 1) { - return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); + return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); } elseif ($status == 0) { - return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); + return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); } } } From 135e65c4aaae3e75ba1de48e4c1549bfa59bbdca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 15:53:57 +0100 Subject: [PATCH 29/38] Look and feel v11 Enhance the progress bar of tasks --- htdocs/admin/emailcollector_card.php | 6 +- htdocs/contrat/class/contrat.class.php | 140 ++++++---------- htdocs/core/lib/functions.lib.php | 24 ++- htdocs/core/lib/project.lib.php | 39 +++-- .../class/emailcollector.class.php | 49 ++---- htdocs/langs/en_US/modulebuilder.lang | 12 +- htdocs/modulebuilder/index.php | 155 ++++++++++-------- htdocs/mrp/ChangeLog.md | 5 - htdocs/takepos/ChangeLog.md | 5 - htdocs/theme/eldy/badges.inc.php | 2 +- htdocs/theme/eldy/global.inc.php | 6 + htdocs/theme/eldy/progress.inc.php | 9 +- htdocs/theme/md/badges.inc.php | 4 +- htdocs/theme/md/style.css.php | 6 + 14 files changed, 223 insertions(+), 239 deletions(-) delete mode 100644 htdocs/mrp/ChangeLog.md delete mode 100644 htdocs/takepos/ChangeLog.md diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index daa0c896809..cb0288b44ba 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -260,7 +260,7 @@ if ($action == 'create') { dol_fiche_head(array(), ''); - print '
'.$transRecordedType.''.$langs->trans("FullList").''; + print ''.$langs->trans("FullList").''; print '
'; - print $product_static->LibStatut($objp->tosell, 5, 0); + print ''; + print $product_static->LibStatut($objp->tosell, 3, 0); print "'; - print $product_static->LibStatut($objp->tobuy, 5, 1); + print ''; + print $product_static->LibStatut($objp->tobuy, 3, 1); print "
'.$labelstatus.''.$labelStatus.''.price((isset($valsamount[$status])?(float) $valsamount[$status]:0), 0, '', 1, -1, -1, $conf->currency).'
'; - print $thirdparty_static->getLibStatut(5); + print $thirdparty_static->getLibStatut(3); print "
'."\n"; + print '
'."\n"; //unset($fields[]); @@ -296,7 +296,7 @@ if (($id || $ref) && $action == 'edit') dol_fiche_head(); - print '
' . "\n"; + print '
' . "\n"; // Common attributes include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; @@ -448,7 +448,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; print '
'; - print '
'."\n"; + print '
'."\n"; // Common attributes //$keyforbreak='fieldkeytoswithonsecondcolumn'; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index a6ccd9f7cf1..038de071863 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -189,6 +189,12 @@ class Contrat extends CommonObject protected $lines_id_index_mapper=array(); + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_CLOSED = 2; + + + /** * Constructor * @@ -1881,40 +1887,31 @@ class Contrat extends CommonObject /** * Renvoi label of a given contrat status * - * @param int $statut Status id + * @param int $status Id status * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length * @return string Label */ - public function LibStatut($statut, $mode) + public function LibStatut($status, $mode) { // phpcs:enable - global $langs; - $langs->load("contracts"); - if ($mode == 0) + + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - if ($statut == 0) { return $langs->trans("ContractStatusDraft"); } - elseif ($statut == 1) { return $langs->trans("ContractStatusValidated"); } - elseif ($statut == 2) { return $langs->trans("ContractStatusClosed"); } + global $langs; + $langs->load("contracts"); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('ContractStatusDraft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('ContractStatusValidated'); + $this->labelStatus[self::STATUS_CLOSED] = $langs->trans('ContractStatusClosed'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('ContractStatusDraft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('ContractStatusValidated'); + $this->labelStatusShort[self::STATUS_CLOSED] = $langs->trans('ContractStatusClosed'); } - elseif ($mode == 1) - { - if ($statut == 0) { return $langs->trans("ContractStatusDraft"); } - elseif ($statut == 1) { return $langs->trans("ContractStatusValidated"); } - elseif ($statut == 2) { return $langs->trans("ContractStatusClosed"); } - } - elseif ($mode == 2) - { - if ($statut == 0) { return img_picto($langs->trans('ContractStatusDraft'), 'statut0').' '.$langs->trans("ContractStatusDraft"); } - elseif ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'), 'statut4').' '.$langs->trans("ContractStatusValidated"); } - elseif ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'), 'statut6').' '.$langs->trans("ContractStatusClosed"); } - } - elseif ($mode == 3) - { - if ($statut == 0) { return img_picto($langs->trans('ContractStatusDraft'), 'statut0'); } - elseif ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'), 'statut4'); } - elseif ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'), 'statut6'); } - } - elseif ($mode == 4 || $mode == 6 || $mode == 7) + + $statusType = 'status'.$status; + if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + if ($status == self::STATUS_VALIDATED) $statusType = 'status6'; + + if ($mode == 4 || $mode == 6 || $mode == 7) { $text=''; if ($mode == 4) { @@ -1924,22 +1921,20 @@ class Contrat extends CommonObject $text.=':     '; $text.=''; } - $text.=($mode == 7?'
':''); - $text.=($mode != 7 || $this->nbofserviceswait > 0) ? ($this->nbofserviceswait.ContratLigne::LibStatut(0, 3, -1, 'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; - $text.=($mode == 7?'
':''); - $text.=($mode != 7 || $this->nbofservicesopened > 0) ? ($this->nbofservicesopened.ContratLigne::LibStatut(4, 3, 0, 'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; - $text.=($mode == 7?'
':''); - $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? ($this->nbofservicesexpired.ContratLigne::LibStatut(4, 3, 1, 'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesclosed)?'   ':'') : ''; - $text.=($mode == 7?'
':''); - $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? ($this->nbofservicesclosed.ContratLigne::LibStatut(5, 3, -1, 'class="paddingleft2 inline-block valigntextbottom"')) : ''; - $text.=($mode == 7?'
':''); + $text.=($mode == 7?'':''); + $text.=($mode != 7 || $this->nbofserviceswait > 0) ? ($this->nbofserviceswait.ContratLigne::LibStatut(0, 3, -1, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; + $text.=($mode == 7?'':''); + $text.=($mode != 7 || $this->nbofservicesopened > 0) ? ($this->nbofservicesopened.ContratLigne::LibStatut(4, 3, 0, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesexpired || $this->nbofservicesclosed)?'   ':'') : ''; + $text.=($mode == 7?'':''); + $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? ($this->nbofservicesexpired.ContratLigne::LibStatut(4, 3, 1, 'class="marginleft2"')).(($mode != 7 || $this->nbofservicesclosed)?'   ':'') : ''; + $text.=($mode == 7?'':''); + $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? ($this->nbofservicesclosed.ContratLigne::LibStatut(5, 3, -1, 'class="marginleft2"')) : ''; + $text.=($mode == 7?'':''); return $text; } - elseif ($mode == 5) + else { - if ($statut == 0) { return $langs->trans("ContractStatusDraft").' '.img_picto($langs->trans('ContractStatusDraft'), 'statut0'); } - elseif ($statut == 1) { return $langs->trans("ContractStatusValidated").' '.img_picto($langs->trans('ContractStatusValidated'), 'statut4'); } - elseif ($statut == 2) { return $langs->trans("ContractStatusClosed").' '.img_picto($langs->trans('ContractStatusClosed'), 'statut6'); } + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } } @@ -2728,65 +2723,34 @@ class ContratLigne extends CommonObjectLine /** * Return label of a contract line status * - * @param int $statut Id statut + * @param int $status Id status * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $expired 0=Not expired, 1=Expired, -1=Both or unknown * @param string $moreatt More attribute * @return string Libelle */ - public static function LibStatut($statut, $mode, $expired = -1, $moreatt = '') + public static function LibStatut($status, $mode, $expired = -1, $moreatt = '') { // phpcs:enable global $langs; $langs->load("contracts"); - if ($mode == 0) + + if ($status == self::STATUS_INITIAL) { $labelStatus = $langs->trans("ServiceStatusInitial"); $labelStatusShort = $langs->trans("ServiceStatusInitial"); } + elseif ($status == self::STATUS_OPEN && $expired == -1) { $labelStatus = $langs->trans("ServiceStatusRunning"); $labelStatusShort = $langs->trans("ServiceStatusRunning"); } + elseif ($status == self::STATUS_OPEN && $expired == 0) { $labelStatus = $langs->trans("ServiceStatusNotLate"); $labelStatusShort = $langs->trans("ServiceStatusNotLateShort"); } + elseif ($status == self::STATUS_OPEN && $expired == 1) { $labelStatus = $langs->trans("ServiceStatusLate"); $labelStatusShort = $langs->trans("ServiceStatusLateShort"); } + elseif ($status == self::STATUS_CLOSED) { $labelStatus = $langs->trans("ServiceStatusClosed"); $labelStatusShort = $langs->trans("ServiceStatusClosed"); } + + $statusType = 'status'.$status; + if ($status == self::STATUS_OPEN && $expired == 1) $statusType = 'status3'; + if ($status == self::STATUS_CLOSED) $statusType = 'status6'; + + $params = array(); $reg = array(); + if (preg_match('/class="(.*)"/', $moreatt, $reg)) { - if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial"); } - elseif ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning"); } - elseif ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLate"); } - elseif ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLate"); } - elseif ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed"); } - } - elseif ($mode == 1) - { - if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial"); } - elseif ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning"); } - elseif ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort"); } - elseif ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLateShort"); } - elseif ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed"); } - } - elseif ($mode == 2) - { - if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'), 'statut0').' '.$langs->trans("ServiceStatusInitial"); } - elseif ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'), 'statut4').' '.$langs->trans("ServiceStatusRunning"); } - elseif ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'), 'statut4').' '.$langs->trans("ServiceStatusNotLateShort"); } - elseif ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'), 'statut3').' '.$langs->trans("ServiceStatusLateShort"); } - elseif ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'), 'statut6') .' '.$langs->trans("ServiceStatusClosed"); } - } - elseif ($mode == 3) - { - if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'), 'statut0', $moreatt); } - elseif ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'), 'statut4', $moreatt); } - elseif ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'), 'statut4', $moreatt); } - elseif ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'), 'statut3', $moreatt); } - elseif ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'), 'statut6', $moreatt); } - } - elseif ($mode == 4) - { - if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'), 'statut0').' '.$langs->trans("ServiceStatusInitial"); } - elseif ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'), 'statut4').' '.$langs->trans("ServiceStatusRunning"); } - elseif ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'), 'statut4').' '.$langs->trans("ServiceStatusNotLate"); } - elseif ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'), 'statut3').' '.$langs->trans("ServiceStatusLate"); } - elseif ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'), 'statut6') .' '.$langs->trans("ServiceStatusClosed"); } - } - elseif ($mode == 5) - { - if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial").' '.img_picto($langs->trans('ServiceStatusInitial'), 'statut0'); } - elseif ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'), 'statut4'); } - elseif ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort").' '.img_picto($langs->trans('ServiceStatusNotLateShort'), 'statut4'); } - elseif ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLateShort").' '.img_picto($langs->trans('ServiceStatusLate'), 'statut3'); } - elseif ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'), 'statut6'); } + $params = array('badgeParams'=>array('css' => $reg[1])); } + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', $params); } /** diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 56b0dc93c35..7750e62c506 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8093,19 +8093,18 @@ function roundUpToNextMultiple($n, $x = 5) function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '', $params = array()) { $attr=array( - 'class'=>'badge badge-status'.(!empty($mode)?' badge-'.$mode:'').(!empty($type)?' badge-'.$type:'') + 'class'=>'badge badge-status'.(!empty($mode)?' badge-'.$mode:'').(!empty($type)?' badge-'.$type:'').(empty($params['css'])?'':' '.$params['css']) ); - if(empty($html)){ + if (empty($html)) { $html = $label; } - if(!empty($url)){ + if (!empty($url)) { $attr['href'] = $url; } - if($mode==='dot') - { + if ($mode==='dot') { $attr['class'].= ' classfortooltip'; $attr['title'] = $html; $attr['aria-label'] = $label; @@ -8113,8 +8112,8 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = ' } // Override attr - if(!empty($params['attr']) && is_array($params['attr'])){ - foreach($params['attr']as $key => $value){ + if (!empty($params['attr']) && is_array($params['attr'])) { + foreach($params['attr']as $key => $value) { $attr[$key] = $value; } } @@ -8125,7 +8124,7 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = ' $attr = array_map('dol_escape_htmltag', $attr); $TCompiledAttr = array(); - foreach($attr as $key => $value){ + foreach($attr as $key => $value) { $TCompiledAttr[] = $key.'="'.$value.'"'; } @@ -8168,13 +8167,13 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st elseif ($displayMode == 1) { $return = !empty($html)?$html:(!empty($statusLabelShort)?$statusLabelShort:$statusLabel); } - // use status with images - elseif (empty($conf->global->MAIN_STATUS_USES_CSS)) { + // Use status with images (for backward compatibility) + elseif (! empty($conf->global->MAIN_STATUS_USES_IMAGES)) { $return = ''; $htmlLabel = (in_array($displayMode, array(1,2,5))?'':'').(!empty($html)?$html:$statusLabel).(in_array($displayMode, array(1,2,5))?'':''); $htmlLabelShort = (in_array($displayMode, array(1,2,5))?'':'').(!empty($html)?$html:(!empty($statusLabelShort)?$statusLabelShort:$statusLabel)).(in_array($displayMode, array(1,2,5))?'':''); - // For small screen, we use the short label instead of long label. + // For small screen, we always use the short label instead of long label. if (! empty($conf->dol_optimize_smallscreen)) { if ($displayMode == 0) $displayMode = 1; @@ -8212,7 +8211,6 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st $return = $htmlImg .' '. $htmlLabel; } elseif ($displayMode === 5) { - // Add here a span class="hideonsmartphone ? $return = $htmlLabelShort .' '. $htmlImg; } else { // $displayMode >= 6 @@ -8220,7 +8218,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st } } // Use new badge - elseif (!empty($conf->global->MAIN_STATUS_USES_CSS) && !empty($displayMode)) { + elseif (empty($conf->global->MAIN_STATUS_USES_IMAGES) && !empty($displayMode)) { $statusLabelShort = !empty($statusLabelShort)?$statusLabelShort:$statusLabel; if ($displayMode == 3) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 0c80b05c9cd..ecadec1b5a8 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2023,23 +2023,23 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide // this conf is actually hidden, by default we use 1% for "be carefull or warning" $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01; - $diffTitle = '
'.$langs->trans('ProgressDeclared').' : '.$task->progress.'%'; - $diffTitle.= '
'.$langs->trans('ProgressCalculated').' : '.$progressCalculated.'%'; + $diffTitle = '
'.$langs->trans('ProgressDeclared').' : '.$task->progress.($task->progress ? '%' : ''); + $diffTitle.= '
'.$langs->trans('ProgressCalculated').' : '.$progressCalculated.($progressCalculated ? '%' : ''); - if($progressCalculated > doubleval($task->progress)){ + if($progressCalculated > doubleval($task->progress)) { $progressBarClass = 'progress-bar-danger'; - $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).'%'); - $diff = ' '.($task->progress-$progressCalculated).'%'; + $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).' '.$langs->trans("point")); + $diff = ' '.($task->progress-$progressCalculated).'%'; } - elseif($progressCalculated * $warningRatio >= doubleval($task->progress)){ // warning if close at 1% + elseif($progressCalculated * $warningRatio >= doubleval($task->progress)) { // warning if close at 1% $progressBarClass = 'progress-bar-warning'; - $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).'%'); - $diff = ' '.($task->progress-$progressCalculated).'%'; + $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).' '.$langs->trans("point")); + $diff = ' '.($task->progress-$progressCalculated).'%'; } else{ $progressBarClass = 'progress-bar-success'; - $title = $langs->trans('TheReportedProgressIsMoreThanTheCalculatedProgressionByX', ($task->progress-$progressCalculated).'%'); - $diff = ' '.($task->progress-$progressCalculated).'%'; + $title = $langs->trans('TheReportedProgressIsMoreThanTheCalculatedProgressionByX', ($task->progress-$progressCalculated).' '.$langs->trans("point")); + $diff = ' '.($task->progress-$progressCalculated).'%'; } } @@ -2062,7 +2062,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide if($progressNumber !== false) { $out.= ' '; - if($progressNumber!==true){ + if ($progressNumber!==true) { $out.= $progressNumber; // replace label by param } else{ @@ -2087,8 +2087,21 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide $out.= ''; - $out.= '
'; - $out.= '
'; + $out.= '
'; + $diffval = doubleval($task->progress) - doubleval($progressCalculated); + if ($diffval >= 0) { + // good + $out.= '
'; + $out.= '
'; + $out.= '
'; + } + else + { + // bad + $out.= '
'; + $out.= '
'; + $out.= '
'; + } $out.= '
'; $out.= '
'; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 6717b42609b..0b67fcb621f 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -183,6 +183,10 @@ class EmailCollector extends CommonObject public $debuginfo; + const STATUS_DISABLED = 0; + const STATUS_ENABLED = 1; + + /** * Constructor * @@ -506,47 +510,20 @@ class EmailCollector extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelStatus)) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[1] = $langs->trans('Enabled'); - $this->labelStatus[0] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); + $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled'); } - if ($mode == 0) - { - return $this->labelStatus[$status]; - } - elseif ($mode == 1) - { - return $this->labelStatus[$status]; - } - elseif ($mode == 2) - { - if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; - elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; - } - elseif ($mode == 3) - { - if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); - } - elseif ($mode == 4) - { - if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; - elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; - } - elseif ($mode == 5) - { - if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); - } - elseif ($mode == 6) - { - if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); - } + $statusType = 'status5'; + if ($status == self::STATUS_ENABLED) $statusType = 'status4'; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } /** diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 1f8399d939a..59d16eba2fc 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -6,7 +6,7 @@ ModuleBuilderDesc2=Path where modules are generated/edited (first directory for ModuleBuilderDesc3=Generated/editable modules found: %s ModuleBuilderDesc4=A module is detected as 'editable' when the file %s exists in root of module directory NewModule=New module -NewObject=New object +NewObjectInModulebuilder=New object ModuleKey=Module key ObjectKey=Object key ModuleInitialized=Module initialized @@ -66,8 +66,8 @@ ReadmeFile=Readme file ChangeLog=ChangeLog file TestClassFile=File for PHP Unit Test class SqlFile=Sql file -PageForLib=File for PHP library -PageForObjLib=File for PHP library dedicated to object +PageForLib=File for the common PHP library +PageForObjLib=File for the PHP library dedicated to object SqlFileExtraFields=Sql file for complementary attributes SqlFileKey=Sql file for keys SqlFileKeyExtraFields=Sql file for keys of complementary attributes @@ -124,4 +124,8 @@ UseSpecificEditorURL = Use a specific editor URL UseSpecificFamily = Use a specific family UseSpecificAuthor = Use a specific author UseSpecificVersion = Use a specific initial version -ModuleMustBeEnabled=The module/application must be enabled first \ No newline at end of file +ModuleMustBeEnabled=The module/application must be enabled first +IncludeRefGeneration=The reference of object must be generated automatically +IncludeRefGenerationHelp=Check this if you want to include code to manage the generation automatically of the reference +IncludeDocGeneration=I want to generate some documents from the object +IncludeDocGenerationHelp=If you check this, some code will be generated to add a "Generate document" box on the record. diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 234746a0d83..a6df5f9db43 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2018-2019 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify @@ -810,6 +810,21 @@ if ($dirins && $action == 'initobject' && $module && $objectname) //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php', ); + if (GETPOST('includerefgeneration', 'int')) + { + $filetogenerate += array( + 'core/modules/myobject/mod_myobject_advanced.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_advanced.php', + 'core/modules/myobject/mod_myobject_standard.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_standard.php', + 'core/modules/myobject/modules_myobject.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_advanced.php', + ); + } + if (GETPOST('includedocgeneration', 'int')) + { + $filetogenerate += array( + 'core/modules/myobject/doc/doc_generic_myobject_odt.modules.php'=>'core/modules/'.strtolower($objectname).'/doc/doc_generic_'.strtolower($objectname).'_odt.modules.php' + ); + } + foreach($filetogenerate as $srcfile => $destfile) { $result = dol_copy($srcdir.'/'.$srcfile, $destdir.'/'.$destfile, $newmask, 0); @@ -1123,7 +1138,7 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey) } } -if ($dirins && $action == 'confirm_delete') +if ($dirins && $action == 'confirm_deletemodule') { if (preg_match('/[^a-z0-9_]/i', $module)) { @@ -1150,8 +1165,6 @@ if ($dirins && $action == 'confirm_delete') } } - //header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?module=initmodule'); - //exit; $action = ''; $module = 'deletemodule'; } @@ -1173,26 +1186,30 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) $dir = $dirins.'/'.$modulelowercase; // Delete some files - $filetogenerate = array( - 'myobject_card.php'=>strtolower($objectname).'_card.php', - 'myobject_note.php'=>strtolower($objectname).'_note.php', - 'myobject_document.php'=>strtolower($objectname).'_document.php', - 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', - 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'lib/mymodule.lib.php'=>'lib/'.strtolower($module).'.lib.php', - 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', - 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php', - 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', - 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', - 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql', - 'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php', - 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', - 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', - 'class/api_myobject.class.php'=>'class/api_'.strtolower($module).'.class.php' + $filetodelete = array( + 'myobject_card.php'=>strtolower($objectname).'_card.php', + 'myobject_note.php'=>strtolower($objectname).'_note.php', + 'myobject_document.php'=>strtolower($objectname).'_document.php', + 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', + 'myobject_list.php'=>strtolower($objectname).'_list.php', + 'lib/mymodule.lib.php'=>'lib/'.strtolower($module).'.lib.php', + 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', + 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php', + 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', + 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', + 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql', + 'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php', + 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', + 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', + 'class/api_myobject.class.php'=>'class/api_'.strtolower($module).'.class.php', + 'core/modules/myobject/mod_myobject_advanced.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_advanced.php', + 'core/modules/myobject/mod_myobject_standard.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_standard.php', + 'core/modules/myobject/modules_myobject.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_advanced.php', + 'core/modules/myobject/doc/doc_generic_myobject_odt.modules.php'=>'core/modules/'.strtolower($objectname).'/doc/doc_generic_'.strtolower($objectname).'_odt.modules.php' ); $resultko = 0; - foreach($filetogenerate as $filetodelete) + foreach($filetodelete as $filetodelete) { $resulttmp = dol_delete_file($dir.'/'.$filetodelete, 0, 0, 1); if (! $resulttmp) $resultko++; @@ -1208,8 +1225,6 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) } } - //header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?module=initmodule'); - //exit; $action = ''; $tabobj = 'deleteobject'; } @@ -1436,6 +1451,7 @@ if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >=2 || // Search modules to edit print ''."\n"; $listofmodules=array(); +$i=0; foreach($dirsrootforscan as $dirread) { $dirsincustom=dol_dir_list($dirread, 'directories'); @@ -1493,8 +1509,12 @@ foreach($dirsrootforscan as $dirread) if (empty($newdircustom)) $newdircustom=img_warning(); // If dirread was forced to somewhere else, by using URL // htdocs/modulebuilder/index.php?module=Inventory@/home/ldestailleur/git/dolibarr/htdocs/product - print $langs->trans("DirScanned").' : '.$dirread.'
'; + if (empty($i)) print $langs->trans("DirScanned").' : '; + else print ', '; + print ''.$dirread.''; + $i++; } +print '
'; //var_dump($listofmodules); $message=''; @@ -1526,7 +1546,7 @@ if ($message) } //print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).'
'; -$infomodulesfound = '
'.$form->textwithpicto($langs->trans("ModuleBuilderDesc3", count($listofmodules)), $langs->trans("ModuleBuilderDesc4", $FILEFLAG)).'
'; +$infomodulesfound = '
'.$form->textwithpicto(''.$langs->trans("ModuleBuilderDesc3", count($listofmodules)).'', $langs->trans("ModuleBuilderDesc4", $FILEFLAG)).'
'; // Load module descriptor @@ -1601,16 +1621,17 @@ if ($module == 'initmodule') print $langs->trans("EnterNameOfModuleDesc").'
'; print '
'; - print ''; + print '
'; - print ''; + print '
'; print ''; } elseif ($module == 'deletemodule') { + print ''."\n"; print '
'; print ''; - print ''; + print ''; print ''; print $langs->trans("EnterNameOfModuleToDeleteDesc").'

'; @@ -1651,13 +1672,13 @@ elseif (! empty($module)) $linktoenabledisable.=img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', 1); $linktoenabledisable.="\n"; } - if (! empty($conf->$modulelowercase->enabled)) + if (empty($conf->$modulelowercase->enabled)) { - $modulestatusinfo=img_warning().' '.$langs->trans("ModuleIsLive"); + $modulestatusinfo=$form->textwithpicto($langs->trans("ModuleIsNotActive", $urltomodulesetup), '', -1, 'help'); } else { - $modulestatusinfo=img_info('').' '.$langs->trans("ModuleIsNotActive", $urltomodulesetup); + $modulestatusinfo=$form->textwithpicto($langs->trans("ModuleIsLive"), $langs->trans("Warning"), -1, 'warning'); } $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=description&module='.$module.($forceddirread?'@'.$dirread:''); @@ -1737,13 +1758,8 @@ elseif (! empty($module)) // Link to enable / disable print $modulestatusinfo; - print ' '.$linktoenabledisable; - print '
'; + print ' '.$linktoenabledisable.'
'; - if (realpath($dirread.'/'.$modulelowercase) != $dirread.'/'.$modulelowercase) - { - print ''.$langs->trans("RealPathOfModule").' : '.realpath($dirread.'/'.$modulelowercase).'
'; - } print '
'; if ($tab == 'description') @@ -1756,21 +1772,28 @@ elseif (! empty($module)) { dol_fiche_head($head2, $tab, '', -1, ''); // Description - level 2 - print ''.$langs->trans("ModuleBuilderDesc".$tab).'

'; + print ''.$langs->trans("ModuleBuilderDesc".$tab).''; + $infoonmodulepath = ''; + if (realpath($dirread.'/'.$modulelowercase) != $dirread.'/'.$modulelowercase) + { + $infoonmodulepath = ''.$langs->trans("RealPathOfModule").' : '.realpath($dirread.'/'.$modulelowercase).'
'; + print ' '.$infoonmodulepath; + } + print '
'; print '
'; print ''; print ''; print ''; print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print '
'.$langs->trans("ReadmeFile").' : '.$pathtofilereadme.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print '
'.$langs->trans("ChangeLog").' : '.$pathtochangelog.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print '
'; @@ -1931,8 +1954,8 @@ elseif (! empty($module)) { $pathtofile = $modulelowercase.'/langs/'.$langfile['relativename']; print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } print ''; @@ -1983,7 +2006,7 @@ elseif (! empty($module)) print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print ' '.$langs->trans("LanguageFile").' : '; if (! is_array($dicts) || empty($dicts)) print ''.$langs->trans("NoDictionaries").''; @@ -2113,7 +2136,7 @@ elseif (! empty($module)) $dir = $dirread.'/'.$modulelowercase.'/class'; $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj=newobject'; - $head3[$h][1] = $langs->trans("NewObject"); + $head3[$h][1] = ''.$langs->trans("NewObjectInModulebuilder").''; $head3[$h][2] = 'newobject'; $h++; @@ -2165,7 +2188,9 @@ elseif (! empty($module)) print ''.$langs->trans("EnterNameOfObjectDesc").'

'; - print ''; + print '
'; + print ' '.$form->textwithpicto($langs->trans("IncludeRefGeneration"), $langs->trans("IncludeRefGenerationHelp")).'
'; + print ' '.$form->textwithpicto($langs->trans("IncludeDocGeneration"), $langs->trans("IncludeDocGenerationHelp")).'
'; print ''; print '
'; print '
'; @@ -2173,7 +2198,6 @@ elseif (! empty($module)) print $langs->trans("or"); print '
'; print '
'; - print '
'; //print ' '; print $langs->trans("InitStructureFromExistingTable"); print ''; @@ -2687,7 +2711,7 @@ elseif (! empty($module)) print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; @@ -2827,7 +2851,7 @@ elseif (! empty($module)) print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; @@ -2924,7 +2948,7 @@ elseif (! empty($module)) $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ''; @@ -2933,8 +2957,8 @@ elseif (! empty($module)) if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { @@ -2991,8 +3015,8 @@ elseif (! empty($module)) print ''; print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } @@ -3047,8 +3071,8 @@ elseif (! empty($module)) if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { @@ -3099,8 +3123,8 @@ elseif (! empty($module)) if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { @@ -3155,9 +3179,8 @@ elseif (! empty($module)) $pathtofile = $widget['relpath']; print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print ''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } @@ -3242,8 +3265,8 @@ elseif (! empty($module)) $pathtofile = $clifile['relpath']; print ' '.$langs->trans("CLIFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } @@ -3294,7 +3317,7 @@ elseif (! empty($module)) print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; @@ -3423,8 +3446,8 @@ elseif (! empty($module)) if (preg_match('/\.md$/i', $spec['name'])) $format='markdown'; print ''; print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } diff --git a/htdocs/mrp/ChangeLog.md b/htdocs/mrp/ChangeLog.md deleted file mode 100644 index 416bad1d559..00000000000 --- a/htdocs/mrp/ChangeLog.md +++ /dev/null @@ -1,5 +0,0 @@ -# CHANGELOG MRP FOR DOLIBARR ERP CRM - -## 1.0 -Initial version - diff --git a/htdocs/takepos/ChangeLog.md b/htdocs/takepos/ChangeLog.md deleted file mode 100644 index 7b623eaa252..00000000000 --- a/htdocs/takepos/ChangeLog.md +++ /dev/null @@ -1,5 +0,0 @@ -# CHANGELOG TAKEPOS FOR DOLIBARR ERP CRM - -## 1.0 -Initial version - diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 975f2eb311f..27fc142d991 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -37,7 +37,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> padding: 0; border-radius: 50%; padding: 0.45em; - vertical-align: middle; + vertical-align: text-top; } a.badge:focus, a.badge:hover { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index cf5c4f9703a..4a3b73b1d20 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -473,6 +473,12 @@ textarea.centpercent { .paddingright2 { padding-: 2px; } +.marginleft2 { + margin-: 2px; +} +.marginright2 { + margin-: 2px; +} .cursordefault { cursor: default; } diff --git a/htdocs/theme/eldy/progress.inc.php b/htdocs/theme/eldy/progress.inc.php index 3e330745440..c6b48205360 100644 --- a/htdocs/theme/eldy/progress.inc.php +++ b/htdocs/theme/eldy/progress.inc.php @@ -21,10 +21,10 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> height: 20px; overflow: hidden; background-color: #f5f5f5; - background-color: rgba(0,0,0,0.1); + background-color: rgba(128, 128, 128, 0.1); border-radius: 4px; - -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1); - box-shadow: inset 0 1px 2px rgba(0,0,0,.1); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress.spaced{ @@ -184,4 +184,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-consumed { + background-color: rgb(0, 0, 0, 0.15); } \ No newline at end of file diff --git a/htdocs/theme/md/badges.inc.php b/htdocs/theme/md/badges.inc.php index 2a1b9ffd24b..11536240ee0 100644 --- a/htdocs/theme/md/badges.inc.php +++ b/htdocs/theme/md/badges.inc.php @@ -36,8 +36,8 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .badge-dot { padding: 0; border-radius: 50%; - padding: 0.25rem; - vertical-align: middle; + padding: 0.35em; + vertical-align: unset; } a.badge:focus, a.badge:hover { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 320a03c2775..04fe7e85d77 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -676,6 +676,12 @@ textarea.centpercent { .paddingright2 { padding-: 2px; } +.marginleft2 { + margin-: 2px; +} +.marginright2 { + margin-: 2px; +} .cursordefault { cursor: default; } From a1b2130247cef3920d3195235c6fb9ee950eb5a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 16:09:31 +0100 Subject: [PATCH 30/38] Enhance the progress bar of tasks --- htdocs/core/lib/project.lib.php | 18 ++++++++++-------- htdocs/theme/eldy/progress.inc.php | 2 +- htdocs/theme/eldy/theme_vars.inc.php | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ecadec1b5a8..06cd96ab995 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -670,8 +670,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($total_projectlinesa_planned) { $totalAverageDeclaredProgress = round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2); $totalCalculatedProgress = round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2); - // this conf is actually hidden, by default we use 1% for "be carefull or warning" - $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01; + + // this conf is actually hidden, by default we use 10% for "be carefull or warning" + $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; // define progress color according to time spend vs workload $progressBarClass = 'progress-bar-info'; @@ -2020,18 +2021,19 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide if ($task->planned_workload){ $progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2); - // this conf is actually hidden, by default we use 1% for "be carefull or warning" - $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01; + // this conf is actually hidden, by default we use 10% for "be carefull or warning" + $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; $diffTitle = '
'.$langs->trans('ProgressDeclared').' : '.$task->progress.($task->progress ? '%' : ''); $diffTitle.= '
'.$langs->trans('ProgressCalculated').' : '.$progressCalculated.($progressCalculated ? '%' : ''); - if($progressCalculated > doubleval($task->progress)) { + //var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.doubleval($task->progress * $warningRatio)); + if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) { $progressBarClass = 'progress-bar-danger'; $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).' '.$langs->trans("point")); $diff = ' '.($task->progress-$progressCalculated).'%'; } - elseif($progressCalculated * $warningRatio >= doubleval($task->progress)) { // warning if close at 1% + elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 1% $progressBarClass = 'progress-bar-warning'; $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress-$progressCalculated).' '.$langs->trans("point")); $diff = ' '.($task->progress-$progressCalculated).'%'; @@ -2130,8 +2132,8 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '') if ($task->planned_workload){ $progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2); - // this conf is actually hidden, by default we use 1% for "be carefull or warning" - $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01; + // this conf is actually hidden, by default we use 10% for "be carefull or warning" + $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; if($progressCalculated > doubleval($task->progress)){ $badgeClass.= 'badge-danger'; diff --git a/htdocs/theme/eldy/progress.inc.php b/htdocs/theme/eldy/progress.inc.php index c6b48205360..a211c40efb4 100644 --- a/htdocs/theme/eldy/progress.inc.php +++ b/htdocs/theme/eldy/progress.inc.php @@ -167,7 +167,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> } .progress-bar-yellow, .progress-bar-warning { - background-color: #f39c12; + background-color: #bc9526; } .progress-striped .progress-bar-yellow, .progress-striped .progress-bar-warning { diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 386a81f0afd..24e7e6f7d41 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -81,7 +81,7 @@ $toolTipFontColor='#333'; $textSuccess ='#28a745'; $colorblind_deuteranopes_textSuccess ='#37de5d'; $textDanger ='#dc3545'; -$textWarning ='#f39c12'; +$textWarning ='#bc9526'; $colorblind_deuteranopes_textWarning = $textWarning; // currently not tested with a color blind people so use default color From 2af23aa65828617af5c60e3fdb0df17d557846c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 17:54:17 +0100 Subject: [PATCH 31/38] Enhance modulebuilder --- htdocs/core/lib/modulebuilder.lib.php | 14 ++- htdocs/langs/en_US/modulebuilder.lang | 6 + htdocs/modulebuilder/index.php | 104 ++++++++++++++---- .../template/class/myobject.class.php | 12 +- .../doc/doc_generic_myobject_odt.modules.php | 0 .../mod_myobject_advanced.php | 0 .../mod_myobject_standard.php | 0 .../modules_myobject.php | 0 .../tpl/linkedobjectblock_myobject.tpl.php | 58 ++++++++++ .../template/core/tpl/mytemplate.tpl.php | 35 ------ 10 files changed, 159 insertions(+), 70 deletions(-) rename htdocs/modulebuilder/template/core/modules/{myobject => mymodule}/doc/doc_generic_myobject_odt.modules.php (100%) rename htdocs/modulebuilder/template/core/modules/{myobject => mymodule}/mod_myobject_advanced.php (100%) rename htdocs/modulebuilder/template/core/modules/{myobject => mymodule}/mod_myobject_standard.php (100%) rename htdocs/modulebuilder/template/core/modules/{myobject => mymodule}/modules_myobject.php (100%) create mode 100644 htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php delete mode 100644 htdocs/modulebuilder/template/core/tpl/mytemplate.tpl.php diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index e6f36b25d47..4e5cbb92c02 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -128,17 +128,19 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = $i++; $texttoinsert.= "\t\t'".$key."' => array('type'=>'".$val['type']."', 'label'=>'".$val['label']."',"; $texttoinsert.= " 'enabled'=>".($val['enabled']!=''?$val['enabled']:1).","; - $texttoinsert.= " 'visible'=>".($val['visible']!=''?$val['visible']:-1).","; $texttoinsert.= " 'position'=>".($val['position']!=''?$val['position']:50).","; - $texttoinsert.= " 'notnull'=>".($val['notnull']!=''?$val['notnull']:-1).","; + $texttoinsert.= " 'notnull'=>".(empty($val['notnull'])?0:$val['notnull']).","; + $texttoinsert.= " 'visible'=>".($val['visible']!=''?$val['visible']:-1).","; + if ($val['noteditable']) $texttoinsert.= " 'noteditable'=>'".$val['noteditable']."',"; if ($val['default']) $texttoinsert.= " 'default'=>'".$val['default']."',"; if ($val['index']) $texttoinsert.= " 'index'=>".$val['index'].","; + if ($val['foreignkey']) $texttoinsert.= " 'foreignkey'=>'".$val['foreignkey']."',"; if ($val['searchall']) $texttoinsert.= " 'searchall'=>".$val['searchall'].","; if ($val['isameasure']) $texttoinsert.= " 'isameasure'=>'".$val['isameasure']."',"; - if ($val['foreignkey']) $texttoinsert.= " 'foreignkey'=>'".$val['foreignkey']."',"; + if ($val['css']) $texttoinsert.= " 'css'=>'".$val['css']."',"; if ($val['help']) $texttoinsert.= " 'help'=>\"".preg_replace('/"/', '', $val['help'])."\","; - if ($val['comment']) $texttoinsert.= " 'comment'=>\"".preg_replace('/"/', '', $val['comment'])."\","; if ($val['showoncombobox']) $texttoinsert.= " 'showoncombobox'=>'".$val['showoncombobox']."',"; + if ($val['disabled']) $texttoinsert.= " 'disabled'=>'".$val['disabled']."',"; if ($val['arrayofkeyval']) { $texttoinsert.= " 'arrayofkeyval'=>array("; @@ -149,8 +151,10 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = $texttoinsert.="'".$key2."'=>'".$val2."'"; $i++; } - $texttoinsert.= ")"; + $texttoinsert.= "),"; } + if ($val['comment']) $texttoinsert.= " 'comment'=>\"".preg_replace('/"/', '', $val['comment'])."\""; + $texttoinsert.= "),\n"; } } diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 59d16eba2fc..4a0e0daf5c1 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -129,3 +129,9 @@ IncludeRefGeneration=The reference of object must be generated automatically IncludeRefGenerationHelp=Check this if you want to include code to manage the generation automatically of the reference IncludeDocGeneration=I want to generate some documents from the object IncludeDocGenerationHelp=If you check this, some code will be generated to add a "Generate document" box on the record. +ShowOnCombobox=Show value into combobox +KeyForTooltip=Key for tooltip +CSSClass=CSS Class +NotEditable=Not editable +ForeignKey=Foreign key +TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php:1 (1 means we add a + button after the combo to create the record) \ No newline at end of file diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index a6df5f9db43..7fffdfcd50d 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -810,18 +810,23 @@ if ($dirins && $action == 'initobject' && $module && $objectname) //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php', ); - if (GETPOST('includerefgeneration', 'int')) + if (GETPOST('includerefgeneration', 'aZ09')) { + dol_mkdir($destdir.'/core/modules/'.strtolower($module)); + $filetogenerate += array( - 'core/modules/myobject/mod_myobject_advanced.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_advanced.php', - 'core/modules/myobject/mod_myobject_standard.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_standard.php', - 'core/modules/myobject/modules_myobject.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_advanced.php', + 'core/modules/mymodule/mod_myobject_advanced.php'=>'core/modules/'.strtolower($module).'/mod_'.strtolower($objectname).'_advanced.php', + 'core/modules/mymodule/mod_myobject_standard.php'=>'core/modules/'.strtolower($module).'/mod_'.strtolower($objectname).'_standard.php', + 'core/modules/mymodule/modules_myobject.php'=>'core/modules/'.strtolower($module).'/modules_'.strtolower($objectname).'.php', ); } - if (GETPOST('includedocgeneration', 'int')) + if (GETPOST('includedocgeneration', 'aZ09')) { + dol_mkdir($destdir.'/core/modules/'.strtolower($module)); + dol_mkdir($destdir.'/core/modules/'.strtolower($module).'/doc'); + $filetogenerate += array( - 'core/modules/myobject/doc/doc_generic_myobject_odt.modules.php'=>'core/modules/'.strtolower($objectname).'/doc/doc_generic_'.strtolower($objectname).'_odt.modules.php' + 'core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php'=>'core/modules/'.strtolower($module).'/doc/doc_generic_'.strtolower($objectname).'_odt.modules.php' ); } @@ -843,8 +848,21 @@ if ($dirins && $action == 'initobject' && $module && $objectname) } } - //if (! $error) // If there is error copying 1 file, we still have to make the replacement - //{ + // Edit the class 'class/'.strtolower($objectname).'.class.php' + if (GETPOST('includerefgeneration', 'aZ09')) { + // Replace 'visible'=>1, 'noteditable'=>0, 'default'=>'' + $arrayreplacement = array('/\'visible\'=>1,\s*\'noteditable\'=>0,\s*\'default\'=>\'\'/' => "'visible'=>4, 'noteditable'=>1, 'default'=>'(PROV)'"); + //var_dump($arrayreplacement);exit; + //var_dump($destdir.'/class/'.strtolower($objectname).'.class.php');exit; + dolReplaceInFile($destdir.'/class/'.strtolower($objectname).'.class.php', $arrayreplacement, '', 0, 0, 1); + } + + // Edit the setup file and the card page + if (GETPOST('includedocgeneration', 'aZ09')) { + // TODO + // dolReplaceInFile(); + } + // Scan for object class files $listofobject = dol_dir_list($destdir.'/class', 'files', 0, '\.class\.php$'); @@ -917,15 +935,12 @@ if ($dirins && $action == 'initobject' && $module && $objectname) // Add module descriptor to list of files to replace "MyObject' string with real name of object. $filetogenerate[]='core/modules/mod'.$module.'.class.php'; - - // TODO } - //} } if (! $error) { - // Edit PHP files + // Edit PHP files to make replacement foreach($filetogenerate as $destfile) { $phpfileval['fullname'] = $destdir.'/'.$destfile; @@ -970,6 +985,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) if (! $error) { setEventMessages($langs->trans('FilesForObjectInitialized', $objectname), null); + $tabobj = $objectname; } } @@ -1198,14 +1214,15 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql', + 'sql/llx_mymodule_myobject_extrafields.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.key.sql', 'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php', 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', 'class/api_myobject.class.php'=>'class/api_'.strtolower($module).'.class.php', - 'core/modules/myobject/mod_myobject_advanced.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_advanced.php', - 'core/modules/myobject/mod_myobject_standard.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_standard.php', - 'core/modules/myobject/modules_myobject.php'=>'core/modules/'.strtolower($objectname).'/mod_'.strtolower($objectname).'_advanced.php', - 'core/modules/myobject/doc/doc_generic_myobject_odt.modules.php'=>'core/modules/'.strtolower($objectname).'/doc/doc_generic_'.strtolower($objectname).'_odt.modules.php' + 'core/modules/mymodule/mod_myobject_advanced.php'=>'core/modules/'.strtolower($module).'/mod_'.strtolower($objectname).'_advanced.php', + 'core/modules/mymodule/mod_myobject_standard.php'=>'core/modules/'.strtolower($module).'/mod_'.strtolower($objectname).'_standard.php', + 'core/modules/mymodule/modules_myobject.php'=>'core/modules/'.strtolower($module).'/modules_'.strtolower($objectname).'.php', + 'core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php'=>'core/modules/'.strtolower($module).'/doc/doc_generic_'.strtolower($objectname).'_odt.modules.php' ); $resultko = 0; @@ -2460,7 +2477,7 @@ elseif (! empty($module)) print load_fiche_titre($langs->trans("ObjectProperties"), '', ''); - + print ''."\n"; print '
'; print ''; print ''; @@ -2470,16 +2487,22 @@ elseif (! empty($module)) print ''; - print ''; print ''; print ''; print ''; print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; print ''; print ''; print ''; @@ -2500,11 +2523,17 @@ elseif (! empty($module)) print ''; print ''; print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; print ''; print ''; @@ -2548,7 +2583,7 @@ elseif (! empty($module)) print ''; - print ''; print ''; + print ''; print ''; @@ -2575,16 +2613,34 @@ elseif (! empty($module)) print $propvisible?$propvisible:''; print ''; print ''; print ''; + print ''; + print ''; + print ''; + print ''; + /*print '';*/ print ''; print ''; print ''; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 43488429807..7d3de98e4df 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -68,21 +68,21 @@ class MyObject extends CommonObject * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'noteditable' says if field is not editable (1 or 0) - * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). - * 'position' is the sort order of field. * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). * 'css' is the CSS style to use on field. For example: 'maxwidth200' * 'help' is a string visible as a tooltip on field - * 'comment' is not used. You can store here any text of your choice. It is not used by application. * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record - * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. */ // BEGIN MODULEBUILDER PROPERTIES @@ -91,13 +91,13 @@ class MyObject extends CommonObject */ public $fields=array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'notnull'=> 1, 'default'=>'(PROV)', 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20), 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'showoncombobox'=>1), 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'), 'qty' =>array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp'), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), - 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1,), + 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62), diff --git a/htdocs/modulebuilder/template/core/modules/myobject/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php similarity index 100% rename from htdocs/modulebuilder/template/core/modules/myobject/doc/doc_generic_myobject_odt.modules.php rename to htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php diff --git a/htdocs/modulebuilder/template/core/modules/myobject/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php similarity index 100% rename from htdocs/modulebuilder/template/core/modules/myobject/mod_myobject_advanced.php rename to htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php diff --git a/htdocs/modulebuilder/template/core/modules/myobject/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php similarity index 100% rename from htdocs/modulebuilder/template/core/modules/myobject/mod_myobject_standard.php rename to htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php diff --git a/htdocs/modulebuilder/template/core/modules/myobject/modules_myobject.php b/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php similarity index 100% rename from htdocs/modulebuilder/template/core/modules/myobject/modules_myobject.php rename to htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php diff --git a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php new file mode 100644 index 00000000000..c0b2e073ad0 --- /dev/null +++ b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php @@ -0,0 +1,58 @@ + + * + * 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 . + */ + +// Protection to avoid direct call of template +if (empty($conf) || ! is_object($conf)) +{ + print "Error, template page can't be called as URL"; + exit; +} + + +print "\n"; + + +global $user; +global $noMoreLinkedObjectBlockAfter; + +$langs = $GLOBALS['langs']; +$linkedObjectBlock = $GLOBALS['linkedObjectBlock']; + +// Load translation files required by the page +$langs->load("mymodule"); + +$total=0; $ilink=0; +foreach($linkedObjectBlock as $key => $objectlink) +{ + $ilink++; + + $trclass='oddeven'; + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; + ?> + + + + + + + + + + \n"; diff --git a/htdocs/modulebuilder/template/core/tpl/mytemplate.tpl.php b/htdocs/modulebuilder/template/core/tpl/mytemplate.tpl.php deleted file mode 100644 index 8e871e7f416..00000000000 --- a/htdocs/modulebuilder/template/core/tpl/mytemplate.tpl.php +++ /dev/null @@ -1,35 +0,0 @@ -. - */ - -/** - * \file core/tpl/mytemplate.tpl.php - * \ingroup mymodule - * \brief Example template. - * - * Put detailed description here. - */ - -// Protection to avoid direct call of template -if (empty($conf) || ! is_object($conf)) -{ - print "Error, template page can't be called as URL"; - exit; -} - - -/** Your code here. */ -echo "Hello world!"; From 012c5ef0c4c47b24e7a0107c086449a9f6005d9e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 18:35:48 +0100 Subject: [PATCH 32/38] Can use substitution variables into filter of fields link --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/class/html.form.class.php | 6 +++++- htdocs/langs/en_US/modulebuilder.lang | 2 +- htdocs/modulebuilder/template/myobject_list.php | 13 +++++++------ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7707be211f3..deb27817be9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5624,7 +5624,7 @@ abstract class CommonObject { $morecss = 'minwidth100imp'; } - elseif ($type == 'datetime') + elseif ($type == 'datetime' || $type == 'link') { $morecss = 'minwidth200imp'; } @@ -6093,7 +6093,7 @@ abstract class CommonObject $param_list_array = explode(':', $param_list[0]); $showempty=(($required && $default != '')?0:1); - $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', '', '', 0, empty($val['disabled'])?0:1); + $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, empty($val['disabled'])?0:1); if (! empty($param_list_array[2])) // If we set to add a create button { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 72c1e589233..4be775ea038 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5865,7 +5865,11 @@ class Form if ($classname && class_exists($classname)) { $objecttmp = new $classname($this->db); - $objecttmp->filter = $filter; + // Make some replacement + $objecttmp->filter = str_replace( + array('__ENTITY__', '__USER_ID__'), + array($conf->entity, $user->id), + $filter); } } if (! is_object($objecttmp)) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 4a0e0daf5c1..d26f58fd00e 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -134,4 +134,4 @@ KeyForTooltip=Key for tooltip CSSClass=CSS Class NotEditable=Not editable ForeignKey=Foreign key -TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php:1 (1 means we add a + button after the combo to create the record) \ No newline at end of file +TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1;entity=$conf->entity' for example) \ No newline at end of file diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 525fa879562..bf9b73e0f53 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -153,6 +153,9 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$permtoread = $user->rights->mymodule->myobject->read; +$permtowrite = $user->rights->mymodule->myobject->write; +$permtodelete = $user->rights->mymodule->myobject->delete; /* @@ -190,8 +193,6 @@ if (empty($reshook)) // Mass actions $objectclass='MyObject'; $objectlabel='MyObject'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -346,7 +347,7 @@ $arrayofmassactions = array( //'builddoc'=>$langs->trans("PDFMerge"), //'presend'=>$langs->trans("SendByMail"), ); -if ($user->rights->mymodule->delete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); +if ($permtodelete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); @@ -360,7 +361,7 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->mymodule->write); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permtowrite); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit); @@ -593,8 +594,8 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n $urlsource.=str_replace('&', '&', $param); $filedir=$diroutputmassaction; - $genallowed=$user->rights->mymodule->read; - $delallowed=$user->rights->mymodule->write; + $genallowed=$permtoread; + $delallowed=$permtowrite; print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } From f74833cfe11d916bfe162359e27d416d533144cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 18:44:32 +0100 Subject: [PATCH 33/38] Make modulebuilder more compatible with multicompany --- htdocs/core/class/html.form.class.php | 6 ++++-- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4be775ea038..6790ec43cae 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5866,9 +5866,10 @@ class Form { $objecttmp = new $classname($this->db); // Make some replacement + $sharedentities = getEntity(strtolower($classname)); $objecttmp->filter = str_replace( - array('__ENTITY__', '__USER_ID__'), - array($conf->entity, $user->id), + array('__ENTITY__', '__SHARED_ENTITIES__', '__USER_ID__'), + array($conf->entity, $sharedentities, $user->id), $filter); } } @@ -5878,6 +5879,7 @@ class Form return 'Error bad setup of type for field '.join(',', $InfoFieldList); } + //var_dump($objecttmp->filter); $prefixforautocompletemode=$objecttmp->element; if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode='company'; $confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 7d3de98e4df..4cefbc159a0 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -96,7 +96,7 @@ class MyObject extends CommonObject 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'showoncombobox'=>1), 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'), 'qty' =>array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp'), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), From a95a10b8f03c6dd9e724c42091537353f0197f8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 18:45:44 +0100 Subject: [PATCH 34/38] Update doc --- htdocs/langs/en_US/modulebuilder.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index d26f58fd00e..d14aa8a3c71 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -134,4 +134,4 @@ KeyForTooltip=Key for tooltip CSSClass=CSS Class NotEditable=Not editable ForeignKey=Foreign key -TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1;entity=$conf->entity' for example) \ No newline at end of file +TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example) \ No newline at end of file From 83cc9ea643783e27ba863d673fb4f699eb68ff0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 20:48:46 +0100 Subject: [PATCH 35/38] FIX Search on leave request ref --- htdocs/holiday/list.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 1c03e3801b6..4256ecd13f9 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -197,10 +197,7 @@ llxHeader('', $langs->trans('CPTitreMenu')); $order = $db->order($sortfield, $sortorder).$db->plimit($limit + 1, $offset); // Ref -if(!empty($search_ref)) -{ - $filter.= " AND cp.rowid = ".(int) $db->escape($search_ref); -} +if (!empty($search_ref)) $filter.= natural_search("cp.ref", $search_ref); // Start date $filter.= dolSqlDateFilter("cp.date_debut", $search_day_start, $search_month_start, $search_year_start); // End date @@ -231,7 +228,6 @@ if (!empty($sall)) if (empty($user->rights->holiday->read_all)) $filter.=' AND cp.fk_user IN ('.join(',', $childids).')'; - // Récupération de l'ID de l'utilisateur $user_id = $user->id; From a3a326b25ef076a3619655e0938cfad200ffcbbf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 20:52:11 +0100 Subject: [PATCH 36/38] FIX Search on leave request ref --- htdocs/holiday/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 4256ecd13f9..1ead5872f78 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -116,6 +116,7 @@ $search_type = GETPOST('search_type', 'int'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( + 'cp.ref'=>'Ref', 'cp.description'=>'Description', 'uu.lastname'=>'EmployeeLastname', 'uu.firstname'=>'EmployeeFirstname' From 4616519dcfeee162a9710478fd8612a0af4d677e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 20:52:30 +0100 Subject: [PATCH 37/38] FIX Search on leave request ref --- htdocs/holiday/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index b86dd2864b5..e4137199060 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -121,6 +121,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($object->table_element, // List of fields to search into when doing a "search in all" $fieldstosearchall = array( + 'cp.ref'=>'Ref', 'cp.description'=>'Description', 'uu.lastname'=>'EmployeeLastname', 'uu.firstname'=>'EmployeeFirstname', @@ -287,7 +288,7 @@ $sql.= ", ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua"; $sql.= " WHERE cp.entity IN (".getEntity('holiday').")"; $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau // Search all -if (!empty($sall)) $sql.= natural_search(array_keys($fieldstosearchall), $sall); +//if (!empty($sall)) $sql.= natural_search(array_keys($fieldstosearchall), $sall); // Ref if(!empty($search_ref)) { From cf2ee892ee1842065dfe1b02a3d54b5526fa261e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Nov 2019 21:27:19 +0100 Subject: [PATCH 38/38] FIX security check. A user can see holiday with link without permissions --- htdocs/holiday/card.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 1f597f2ddc2..6518258b508 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -44,10 +44,6 @@ $id=GETPOST('id', 'int'); $ref=GETPOST('ref', 'alpha'); $fuserid = (GETPOST('fuserid', 'int')?GETPOST('fuserid', 'int'):$user->id); -// Protection if external user -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'holiday', $id, 'holiday'); - $now=dol_now(); // Load translation files required by the page @@ -61,9 +57,9 @@ if (! empty($conf->global->HOLIDAY_FOR_NON_SALARIES_TOO)) $morefilter = ''; $error = 0; $object = new Holiday($db); -if ($id > 0) +if (($id > 0) || $ref) { - $object->fetch($id); + $object->fetch($id, $ref); // Check current user can read this leave request $canread = 0; @@ -83,6 +79,12 @@ $candelete = 0; if (! empty($user->rights->holiday->delete)) $candelete=1; if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write && in_array($object->fk_user, $childids)) $candelete=1; +// Protection if external user +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'holiday', $object->id, 'holiday'); + + + /* * Actions */
'; print $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")); print ''.$langs->trans("Type").''; + print ''.$form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelp")).''.$form->textwithpicto($langs->trans("ArrayOfKeyValues"), $langs->trans("ArrayOfKeyValuesDesc")).''.$form->textwithpicto($langs->trans("NotNull"), $langs->trans("NotNullDesc")).''.$langs->trans("DefaultValue").''.$langs->trans("DatabaseIndex").''.$langs->trans("ForeignKey").''.$langs->trans("Position").''.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).''.$langs->trans("NotEditable").''.$form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")).''.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).''.$langs->trans("CSSClass").''.$langs->trans("KeyForTooltip").''.$langs->trans("ShowOnCombobox").''.$langs->trans("Disabled").''.$langs->trans("Comment").'
'; print ''; @@ -2531,13 +2560,19 @@ elseif (! empty($module)) $proptype=$propval['type']; $proparrayofkeyval=$propval['arrayofkeyval']; $propnotnull=$propval['notnull']; - $propsearchall=$propval['searchall']; $propdefault=$propval['default']; $propindex=$propval['index']; + $propforeignkey=$propval['foreignkey']; $propposition=$propval['position']; $propenabled=$propval['enabled']; $propvisible=$propval['visible']; + $propnoteditable=$propval['noteditable']; + $propsearchall=$propval['searchall']; $propisameasure=$propval['isameasure']; + $propcss=$propval['css']; + $prophelp=$propval['help']; + $propshowoncombobox=$propval['showoncombobox']; + //$propdisabled=$propval['disabled']; $propcomment=$propval['comment']; print '
'; print $proplabel; print ''; + print ''; print $proptype; print ''; @@ -2565,6 +2600,9 @@ elseif (! empty($module)) print ''; print $propindex?'1':''; print ''; + print $propforeignkey?$propforeignkey:''; + print ''; print $propposition; print ''; - print $propisameasure?$propisameasure:''; + print $propnoteditable?$propnoteditable:''; print ''; print $propsearchall?'1':''; print ''; + print $propisameasure?$propisameasure:''; + print ''; + print $propcss?$propcss:''; + print ''; + print $prophelp?$prophelp:''; + print ''; + print $propshowoncombobox?$propshowoncombobox:''; + print ''; + print $propdisabled?$propdisabled:''; + print ''; print $propcomment; print ''; - print ''.img_delete().''; + if ($propname != 'rowid') + { + print ''.img_delete().''; + } print '
trans("MyObject"); ?>getNomUrl(1); ?>date, 'day'); ?>getLibStatut(7); ?>'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>