diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 90b34e604be..6be452c86de 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -250,12 +250,12 @@ class AdherentType extends CommonObject } /** - * Delete a language for this member type - * - * @param string $langtodelete Language code to delete - * @param User $user Object user making delete - * @return int <0 if KO, >0 if OK - */ + * Delete a language for this member type + * + * @param string $langtodelete Language code to delete + * @param User $user Object user making delete + * @return int <0 if KO, >0 if OK + */ public function delMultiLangs($langtodelete, $user) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang"; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 0dca0d86193..5967d670856 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -59,7 +59,7 @@ $permissiontoedit = $user->rights->adherent->cotisation->creer; // Used by the i $hookmanager->initHooks(array('subscriptioncard', 'globalcard')); // Security check -$result = restrictedArea($user, 'subscription', 0); // TODO Check on object id +$result = restrictedArea($user, 'subscription', 0); // TODO Check on object id /* diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 8060398574c..1cce5388f90 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -83,26 +83,26 @@ if ($action == 'set') { dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); $defaultValues = new DefaultValues($db); - $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); - if (!is_array($result) && $result<0) { + $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); + if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); - } elseif (count($result)>0) { + } elseif (count($result) > 0) { foreach ($result as $defval) { - $defaultValues->id=$defval->id; + $defaultValues->id = $defval->id; $resultDel = $defaultValues->delete($user); - if ($resultDel<0) { + if ($resultDel < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); } } } - $defaultValues->type='createform'; - $defaultValues->entity=$conf->entity; - $defaultValues->user_id=0; - $defaultValues->page='comm/action/card.php'; - $defaultValues->param='complete'; - $defaultValues->value=GETPOST('AGENDA_EVENT_DEFAULT_STATUS'); - $resultCreat=$defaultValues->create($user); - if ($resultCreat<0) { + $defaultValues->type = 'createform'; + $defaultValues->entity = $conf->entity; + $defaultValues->user_id = 0; + $defaultValues->page = 'comm/action/card.php'; + $defaultValues->param = 'complete'; + $defaultValues->value = GETPOST('AGENDA_EVENT_DEFAULT_STATUS'); + $resultCreat = $defaultValues->create($user); + if ($resultCreat < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); } } elseif ($action == 'specimen') { // For orders @@ -355,13 +355,13 @@ print ''."\n"; print ''.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").''."\n"; print ' '."\n"; print ''."\n"; -$defval='na'; +$defval = 'na'; $defaultValues = new DefaultValues($db); -$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); -if (!is_array($result) && $result<0) { +$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); +if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); -} elseif (count($result)>0) { - $defval=reset($result)->value; +} elseif (count($result) > 0) { + $defval = reset($result)->value; } $formactions->form_select_status_action('agenda', $defval, 1, "AGENDA_EVENT_DEFAULT_STATUS", 0, 1, 'maxwidth200'); print ''."\n"; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 5e7a229fee3..25446dbed4d 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -307,7 +307,7 @@ class Dolistore } } else { //need update - $version = ''.$langs->trans( + $version = ''.$langs->trans( 'CompatibleAfterUpdate', DOL_VERSION, $product->dolibarr_min, diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index e09dd13b045..207642fe8e3 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -102,11 +102,11 @@ if ($action == "set") { } $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); - if (! ($res > 0)) { + if (!($res > 0)) { $error++; } - if (! $error) { + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 613c8853297..646f4a7be74 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -270,7 +270,7 @@ print ''; echo '
'; echo ''; echo ''; -echo ''; +echo ''; echo ''; echo ''; diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 4dd2fbad58e..c8a2a02498c 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -90,7 +90,7 @@ $_SESSION["commandbackuptorun"] = ''; $_SESSION["commandbackupresult"] = ''; // Increase limit of time. Works only if we are not in safe mode -$ExecTimeLimit = 600; // Set it to 0 to not use a forced time limit +$ExecTimeLimit = 600; // Set it to 0 to not use a forced time limit if (!empty($ExecTimeLimit)) { $err = error_reporting(); error_reporting(0); // Disable all errors diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index 83241f2a9e2..e89cbb2fd41 100755 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -26,8 +26,8 @@ require "../main.inc.php"; // Libraries -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; -require_once DOL_DOCUMENT_ROOT . '/workstation/lib/workstation.lib.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT.'/workstation/lib/workstation.lib.php'; //require_once "../class/myclass.class.php"; // Translations diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index f10c7b10b48..3cd8d3e0774 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -497,11 +497,11 @@ class Documents extends DolibarrApi throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.'); } else { if (($object->id) > 0 && !empty($modulepart)) { - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; + require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; $ecmfile = new EcmFiles($this->db); $result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id)); if ($result < 0) { - throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror()); + throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror()); } elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) { $filearray['ecmfiles_infos'] = $ecmfile->lines; } diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 524b92a080e..35c0ffcff88 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -316,8 +316,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->contrat->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = $user->rights->asset->read; // If you can read, you can build the PDF to read content - $delallowed = $user->rights->asset->write; // If you can create/edit, you can remove a file on card + $genallowed = $user->rights->asset->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->asset->write; // If you can create/edit, you can remove a file on card print $formfile->showdocuments('asset', $filename, $filedir, $urlsource, 0, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 2cb4d972493..6bfd655b62d 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -25,7 +25,7 @@ if (!empty($_POST['mode']) && $_POST['mode'] === 'label') { // Page is called to build a PDF and output, we must ne renew the token. if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) + define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) } } @@ -277,10 +277,10 @@ dol_htmloutput_errors($mesg); //print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").'
'; //print '
'; -print ''; // The target is for brothers that open the file instead of downloading it +print ''; // The target is for brothers that open the file instead of downloading it print ''; print ''; -print ''; // The page will not renew the token but force download of a file, so we must use here currentToken +print ''; // The page will not renew the token but force download of a file, so we must use here currentToken print '
'; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 4f8c6b28d41..e6a94b21701 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -244,7 +244,6 @@ class Categorie extends CommonObject * @see Categorie::TYPE_ACTIONCOMM * @see Categorie::TYPE_WEBSITE_PAGE * @see Categorie::TYPE_TICKET - */ public $type; @@ -385,8 +384,8 @@ class Categorie extends CommonObject } } else { dol_print_error($this->db); - $this->error=$this->db->lasterror; - $this->errors[]=$this->db->lasterror; + $this->error = $this->db->lasterror; + $this->errors[] = $this->db->lasterror; return -1; } } diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 55540b3006f..7cdb056c595 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -965,8 +965,8 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { $annee = dol_print_date($daykey, '%Y'); - $mois = dol_print_date($daykey, '%m'); - $jour = dol_print_date($daykey, '%d'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) { // Is it the day we are looking for when calling function ? // Scan all event for this date diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index fddf7a2879f..8abbdaa0dd3 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -578,7 +578,7 @@ print '
'; foreach ($listofchoices as $choice => $val) { if (empty($val['enabled'])) { - continue; // list not qualified + continue; // list not qualified } $disabled = ''; if (empty($val['perms'])) { diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 3b078698728..d4245594447 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -540,7 +540,7 @@ if ($id) { array('type' => 'date', 'name' => 'clone_date_value', 'label' => $langs->trans("DateValue"), 'value' => -1), array('type' => 'other', 'tdclass'=>'fieldrequired', 'name' => 'clone_accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($object->fk_account, "accountid", 0, '', 1, '', 0, 'minwidth200', 1)), array('type' => 'text', 'name' => 'clone_amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount)), - array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens") . ' ' . $set_value_help, 'values' => $sensarray, 'default' => $object->sens), + array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens").' '.$set_value_help, 'values' => $sensarray, 'default' => $object->sens), ); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index b589607ac37..100334e046a 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -126,8 +126,8 @@ class FactureRec extends CommonInvoice public $suspended; // status - public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice - public $generate_pdf; // 1 to generate PDF on invoice generation (default) + public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice + public $generate_pdf; // 1 to generate PDF on invoice generation (default) /** * @var int 1 if status is draft @@ -712,12 +712,12 @@ class FactureRec extends CommonInvoice //$line->code_ventilation = $objp->fk_code_ventilation; $line->fk_product_fournisseur_price = $objp->fk_product_fournisseur_price; - $line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility + $line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $objp->fk_product_fournisseur_price, $objp->pa_ht); $line->buyprice = $marginInfos[0]; - $line->pa_ht = $marginInfos[0]; // For backward compatibility + $line->pa_ht = $marginInfos[0]; // For backward compatibility $line->marge_tx = $marginInfos[1]; $line->marque_tx = $marginInfos[2]; $line->rang = $objp->rang; @@ -1930,14 +1930,14 @@ class FactureLigneRec extends CommonInvoiceLine public $fk_product_fournisseur_price; - public $fk_fournprice; // For backward compatibility + public $fk_fournprice; // For backward compatibility public $rang; public $desc; public $description; - public $fk_product_type; // Use instead product_type + public $fk_product_type; // Use instead product_type public $fk_contract_line; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 90641062b40..04c1383c4a5 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1560,8 +1560,11 @@ class Facture extends CommonInvoice $hookmanager->initHooks(array('invoicedao')); $parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if ($reshook > 0) $result = $hookmanager->resPrint; - else $result .= $hookmanager->resPrint; + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 03dfd0288bd..42bf73eaae6 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -90,10 +90,10 @@ if (empty($reshook)) { } } if ($action == 'create') { - $default_account=($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT'); + $default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT'); if ($id_bankaccount != $conf->global->{$default_account}) { - $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default + $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default } require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index fa95b08faca..9a4b50e3474 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -600,7 +600,7 @@ class PaymentSocialContribution extends CommonObject $result = $acc->add_url_line( $bank_line_id, $socialcontrib->fk_user, - DOL_URL_ROOT . '/user/card.php?id=', + DOL_URL_ROOT.'/user/card.php?id=', $fuser->getFullName($langs), 'user' ); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index f30ff3ead4c..b7648da956d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -505,8 +505,8 @@ if (empty($reshook)) { $desc = $prod->description; //If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time - if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { - $product_desc=''; + if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { + $product_desc = ''; } if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) { diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index f46c1051c53..63b4b3f7fc6 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -218,8 +218,8 @@ if ($type == 'directory') { $parameters = array('modulepart'=>$module); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); - if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { - $automodules[]=$hookmanager->resArray['module']; + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { + $automodules[] = $hookmanager->resArray['module']; } // TODO change for multicompany sharing diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 4077b04c6d9..22fafb4633c 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -35,7 +35,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes public $boxcode = "customersoutstandingbillreached"; public $boximg = "object_company"; public $boxlabel = "BoxCustomersOutstandingBillReached"; - public $depends = array("facture","societe"); + public $depends = array("facture", "societe"); /** * @var DoliDB Database handler. diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php index 28c3b22788d..fd89e732937 100644 --- a/htdocs/core/boxes/box_funnel_of_prospection.php +++ b/htdocs/core/boxes/box_funnel_of_prospection.php @@ -24,7 +24,7 @@ * \ingroup projet * \brief Module to show the funnel of prospection */ -include_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php"; +include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** * Class to manage the box to show last projet @@ -91,8 +91,8 @@ class box_funnel_of_prospection extends ModeleBoxes $badgeStatus7 = '#baa32b'; $badgeStatus8 = '#993013'; $badgeStatus9 = '#e7f0f0'; - if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) { - include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; + if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) { + include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; } $listofoppstatus = array(); $listofopplabel = array(); @@ -100,7 +100,7 @@ class box_funnel_of_prospection extends ModeleBoxes $colorseriesstat = array(); $bordercolorseries = array(); $sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label"; - $sql .= " FROM " . MAIN_DB_PREFIX . "c_lead_status as cls"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls"; $sql .= " WHERE active=1"; $sql .= " AND cls.code <> 'LOST'"; $sql .= $this->db->order('cls.rowid', 'ASC'); @@ -148,14 +148,14 @@ class box_funnel_of_prospection extends ModeleBoxes $this->max = $max; $this->info_box_head = array( - 'text' => $langs->trans("Statistics") . ' - ' . $langs->trans("BoxTitleFunnelOfProspection"), + 'text' => $langs->trans("Statistics").' - '.$langs->trans("BoxTitleFunnelOfProspection"), 'graph' => '1' ); if ($user->rights->projet->lire || !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount"; - $sql .= " FROM " . MAIN_DB_PREFIX . "projet as p, " . MAIN_DB_PREFIX . "c_lead_status as cls"; - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p, ".MAIN_DB_PREFIX."c_lead_status as cls"; + $sql .= " WHERE p.entity IN (".getEntity('project').")"; $sql .= " AND p.fk_opp_status = cls.rowid"; $sql .= " AND p.fk_statut = 1"; // Opend projects only $sql .= " AND cls.code NOT IN ('LOST')"; @@ -200,14 +200,14 @@ class box_funnel_of_prospection extends ModeleBoxes $liststatus = array(); $data = array(''); $customlabels = array(); - $total=0; + $total = 0; foreach ($listofstatus as $status) { $customlabel = ''; $labelStatus = ''; if ($status != 7) { $code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code'); if ($code) { - $labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code); + $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code); } if (empty($labelStatus)) { $labelStatus = $listofopplabel[$status]; @@ -218,16 +218,16 @@ class box_funnel_of_prospection extends ModeleBoxes $liststatus[] = $labelStatus; if (!$conf->use_javascript_ajax) { $stringtoprint .= '
'; - $stringtoprint .= ''; - $stringtoprint .= ''; + $stringtoprint .= ''; + $stringtoprint .= ''; $stringtoprint .= "\n"; } } - $customlabels[]=$customlabel; + $customlabels[] = $customlabel; } $dataseries[] = $data; if ($conf->use_javascript_ajax) { - include_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetMinValue(0); $dolgraph->SetData($dataseries); @@ -273,7 +273,7 @@ class box_funnel_of_prospection extends ModeleBoxes 'tr' => 'class="oddeven"', 'td' => 'class="left "', 'maxlength' => 500, - 'text' => $langs->trans("OpportunityTotalAmount") . ' (' . $langs->trans("WonLostExcluded") . ')' + 'text' => $langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')' ); $this->info_box_contents[$line][] = array( 'tr' => 'class="oddeven"', @@ -286,7 +286,7 @@ class box_funnel_of_prospection extends ModeleBoxes 'tr' => 'class="oddeven"', 'td' => 'class="left "', 'maxlength' => 500, - 'text' => $form->textwithpicto($langs->trans("OpportunityPonderatedAmount") . ' (' . $langs->trans("WonLostExcluded") . ')', $langs->trans("OpportunityPonderatedAmountDesc"), 1) + 'text' => $form->textwithpicto($langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')', $langs->trans("OpportunityPonderatedAmountDesc"), 1) ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 83acae25b45..1c0e7a6e3ff 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -80,8 +80,8 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $badgeStatus7 = '#baa32b'; $badgeStatus8 = '#993013'; $badgeStatus9 = '#e7f0f0'; - if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) { - include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; + if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) { + include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; } $this->max = $max; @@ -97,22 +97,22 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $days = 7; } require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; - $text = $langs->trans("BoxTicketLastXDays", $days).' ' . img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"'); + $text = $langs->trans("BoxTicketLastXDays", $days).' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"'); $this->info_box_head = array( 'text' => $text, 'limit' => dol_strlen($text) ); $today = date_time_set(date_create(), 0, 0); $todayformat = date('Y-m-d', date_timestamp_get($today)); - $intervaltosub = new DateInterval('P' . dol_escape_htmltag($days - 1) . 'D'); + $intervaltosub = new DateInterval('P'.dol_escape_htmltag($days - 1).'D'); $intervaltoadd = new DateInterval('P1D'); $minimumdatec = date_sub($today, $intervaltosub); $minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec)); if ($user->rights->ticket->read) { $sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb"; - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; - $sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL " . $days . " DAY)"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; + $sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL ".$days." DAY)"; $sql .= " GROUP BY CAST(t.datec AS DATE)"; $resql = $this->db->query($sql); if ($resql) { @@ -148,12 +148,12 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; - $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; - $stringtoshow .= ' ' . $langs->trans("Days"); - $stringtoshow .= ''; + $stringtoshow .= ' '.$langs->trans("Days"); + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= '
'; @@ -181,21 +181,21 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $px1->mode = 'depth'; $px1->draw('idgraphticketlastxdays'); - $graphtoshow= $px1->show($totalnb ? 0 : 1); + $graphtoshow = $px1->show($totalnb ? 0 : 1); } if ($totalnb) { $stringtoshow .= $graphtoshow; } $stringtoshow .= ''; if ($totalnb) { - $this->info_box_contents[][]=array( + $this->info_box_contents[][] = array( 'td' => 'center', 'text' => $stringtoshow ); } else { $this->info_box_contents[0][0] = array( 'td' => 'class="center opacitymedium"', - 'text' => $stringtoshow . $langs->trans("BoxNoTicketLastXDays", $days) + 'text' => $stringtoshow.$langs->trans("BoxNoTicketLastXDays", $days) ); } } else { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 3b98d3f3356..c7a5beae245 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -970,8 +970,8 @@ abstract class CommonInvoiceLine extends CommonObjectLine public $date_end_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_end at creation public $buy_price_ht; - public $buyprice; // For backward compatibility - public $pa_ht; // For backward compatibility + public $buyprice; // For backward compatibility + public $pa_ht; // For backward compatibility public $marge_tx; public $marque_tx; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index ad69982357c..f6edb58207c 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -88,7 +88,7 @@ class DefaultValues extends CommonObject /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ - public $fields=array( + public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), 'type' =>array('type'=>'varchar(10)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>20), @@ -145,8 +145,12 @@ class DefaultValues extends CommonObject $this->db = $db; - if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { + $this->fields['rowid']['visible'] = 0; + } + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + $this->fields['entity']['enabled'] = 0; + } // Unset fields that are disabled foreach ($this->fields as $key => $val) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d313d91f505..ffa441c0527 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -500,7 +500,7 @@ class FormFile $modellist = array(); if ($modulepart == 'company') { - $showempty = 1; // can have no template active + $showempty = 1; // can have no template active if (is_array($genallowed)) { $modellist = $genallowed; } else { @@ -564,7 +564,7 @@ class FormFile $modellist = ModelePDFFactures::liste_modeles($this->db); } } elseif ($modulepart == 'contract') { - $showempty = 1; // can have no template active + $showempty = 1; // can have no template active if (is_array($genallowed)) { $modellist = $genallowed; } else { @@ -628,7 +628,7 @@ class FormFile $modellist = ModelePDFSuppliersOrders::liste_modeles($this->db); } } elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') { - $showempty = 1; // can have no template active + $showempty = 1; // can have no template active if (is_array($genallowed)) { $modellist = $genallowed; } else { @@ -1708,7 +1708,7 @@ class FormFile } else { $parameters = array('modulepart'=>$modulepart); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); - if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { if (array_key_exists('classpath', $hookmanager->resArray) && !empty($hookmanager->resArray['classpath'])) { dol_include_once($hookmanager->resArray['classpath']); if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) { @@ -1789,9 +1789,9 @@ class FormFile preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : ''); } else { - $parameters = array('modulepart'=>$modulepart,'fileinfo'=>$file); + $parameters = array('modulepart'=>$modulepart, 'fileinfo'=>$file); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); - if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { if (array_key_exists('ref', $hookmanager->resArray) && !empty($hookmanager->resArray['ref'])) { $ref = $hookmanager->resArray['ref']; } diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 07962e6e98d..adde51c4974 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -151,7 +151,7 @@ class InfoBox $box->rowid = (empty($obj->rowid) ? '' : $obj->rowid); $box->id = (empty($obj->box_id) ? '' : $obj->box_id); $box->position = ((isset($obj->position) && $obj->position == '') ? '' : (isset($obj->position) ? $obj->position : '')); // '0' must stay '0' - $box->box_order = (empty($obj->box_order) ? '' : $obj->box_order); + $box->box_order = (empty($obj->box_order) ? '' : $obj->box_order); $box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user); $box->sourcefile = $relsourcefile; $box->class = $boxname; diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 4743d4559b6..c287aae1c2f 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1422,7 +1422,7 @@ class SMTPs $this->_msgContent[$strType]['dataText'] = $strContentAltText; if ($this->getMD5flag()) { - $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); + $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); } //} } @@ -1622,7 +1622,7 @@ class SMTPs $this->_msgContent['image'][$strImageName]['data'] = $strContent; if ($this->getMD5flag()) { - $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, 3); + $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, 3); } } } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index e7ab98ca3b6..d4028e2196b 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -681,7 +681,7 @@ function dol_get_first_day_week($day, $month, $year, $gm = false) function getGMTEasterDatetime($year) { $base = new DateTime("$year-03-21", new DateTimeZone("UTC")); - $days = easter_days($year); // Return number of days between 21 march and easter day. + $days = easter_days($year); // Return number of days between 21 march and easter day. $tmp = $base->add(new DateInterval("P{$days}D")); return $tmp->getTimestamp(); } diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php index 54e6d232871..96ad79f03e6 100644 --- a/htdocs/core/lib/import.lib.php +++ b/htdocs/core/lib/import.lib.php @@ -48,7 +48,7 @@ function import_prepare_head($param, $maxstep = 0) if ($i < 6) { $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param; } else { - $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=5'.$param; // For step6, link is to step 5 + $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=5'.$param; // For step6, link is to step 5 } $head[$h][1] = $langs->trans("Step")." ".$i; $head[$h][2] = 'step'.$i; diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index 1300c1b771f..557bbe6dcf5 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -76,7 +76,7 @@ function dol_setcache($memoryid, $data, $expire = 0) } } - if (!empty($conf->memcached->enabled) && class_exists('Memcached')) { + if (!empty($conf->memcached->enabled) && class_exists('Memcached')) { // Using a memcached server global $dolmemcache; if (empty($dolmemcache) || !is_object($dolmemcache)) { @@ -88,7 +88,7 @@ function dol_setcache($memoryid, $data, $expire = 0) } } - $memoryid = session_name() . '_' . $memoryid; + $memoryid = session_name().'_'.$memoryid; //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); $dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists $rescode = $dolmemcache->getResultCode(); @@ -109,7 +109,7 @@ function dol_setcache($memoryid, $data, $expire = 0) } } - $memoryid = session_name() . '_' . $memoryid; + $memoryid = session_name().'_'.$memoryid; //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); $result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists if ($result) { @@ -154,7 +154,7 @@ function dol_getcache($memoryid) } } - $memoryid = session_name() . '_' . $memoryid; + $memoryid = session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); //print "Get memoryid=".$memoryid; $data = $m->get($memoryid); @@ -179,7 +179,7 @@ function dol_getcache($memoryid) } } - $memoryid = session_name() . '_' . $memoryid; + $memoryid = session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); $data = $m->get($memoryid); //print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n
"; @@ -187,7 +187,7 @@ function dol_getcache($memoryid) if ($data) { return $data; } else { - return null; // There is no way to make a difference between NOTFOUND and error when using Memcache. So do not use it, use Memcached instead. + return null; // There is no way to make a difference between NOTFOUND and error when using Memcache. So do not use it, use Memcached instead. } } elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) { // This is a really not reliable cache ! Use Memcached instead. // Using shmop @@ -252,7 +252,7 @@ function dol_setshmop($memoryid, $data, $expire) } $shmkey = dol_getshmopaddress($memoryid); if (empty($shmkey)) { - return 0; // No key reserved for this memoryid, we can't cache this memoryid + return 0; // No key reserved for this memoryid, we can't cache this memoryid } $newdata = serialize($data); @@ -268,7 +268,7 @@ function dol_setshmop($memoryid, $data, $expire) shmop_close($handle); return ($shm_bytes_written1 + $shm_bytes_written2); } else { - print 'Error in shmop_open for memoryid=' . $memoryid . ' shmkey=' . $shmkey . ' 6+size=6+' . $size; + print 'Error in shmop_open for memoryid='.$memoryid.' shmkey='.$shmkey.' 6+size=6+'.$size; return -1; } } @@ -290,7 +290,7 @@ function dol_getshmop($memoryid) } $shmkey = dol_getshmopaddress($memoryid); if (empty($shmkey)) { - return null; // No key reserved for this memoryid, we can't cache this memoryid + return null; // No key reserved for this memoryid, we can't cache this memoryid } //print 'dol_getshmop memoryid='.$memoryid." shmkey=".$shmkey."
\n"; @@ -304,7 +304,7 @@ function dol_getshmop($memoryid) } shmop_close($handle); } else { - return null; // Can't open existing block, so we suppose it was not created, so nothing were cached yet for the memoryid + return null; // Can't open existing block, so we suppose it was not created, so nothing were cached yet for the memoryid } return $data; } diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 9be293a81ab..28723ab87db 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -157,8 +157,8 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt if ($resql) { $obj = $db->fetch_object($resql); if ($obj) { - $localtax1_rate = (float) $obj->localtax1; // Use float to force to get first numeric value when value is x:y:z - $localtax2_rate = (float) $obj->localtax2; // Use float to force to get first numeric value when value is -19:-15:-9 + $localtax1_rate = (float) $obj->localtax1; // Use float to force to get first numeric value when value is x:y:z + $localtax2_rate = (float) $obj->localtax2; // Use float to force to get first numeric value when value is -19:-15:-9 $localtax1_type = $obj->localtax1_type; $localtax2_type = $obj->localtax2_type; //var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type); @@ -443,7 +443,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // initialize result array //for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i]; - dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT)?'':$conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]); + dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? '' : $conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]); return $result; } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 6cc4650bea4..89fd9fe590b 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -618,7 +618,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta $checksoc = array('societe'); // Test for societe object $checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object - $checktask = array('projet_task'); // Test for task object + $checktask = array('projet_task'); // Test for task object $nocheck = array('barcode', 'stock'); // No test //$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...). diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index e015313ad15..ab47bc02899 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -234,7 +234,7 @@ if (!function_exists('dol_loginfunction')) { if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 128; } elseif (!empty($mysoc->logo_squarred_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index d83bf427ead..913438b4600 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1256,7 +1256,9 @@ class pdf_einstein extends ModelePDFCommandes global $conf, $langs, $hookmanager; $ltrdirection = 'L'; - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; + if ($outputlangs->trans("DIRECTION") == 'rtl') { + $ltrdirection = 'R'; + } // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies")); diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 776c5c76681..c3b7f256b4b 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -164,8 +164,8 @@ class modCategorie extends DolibarrModules $typeexample .= ($typeexample ? " / " : "")."11=Website page"; } - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel" ); - $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'pcat.label'=>'Text' ); + $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel"); + $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'pcat.label'=>'Text'); $this->export_entities_array[$r] = array(); // We define here only fields that use another picto $this->export_help_array[$r] = array('cat.type'=>$typeexample); @@ -460,7 +460,7 @@ class modCategorie extends DolibarrModules ); $this->import_examplevalues_array[$r] = array( - 'ca.label'=>"My Category Label", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description", // $typeexample built above in exports + 'ca.label'=>"My Category Label", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description", // $typeexample built above in exports 'ca.fk_parent' => 'rowid or label' ); $this->import_updatekeys_array[$r] = array('ca.label'=>'Label'); @@ -538,7 +538,7 @@ class modCategorie extends DolibarrModules $this->import_convertvalue_array[$r] = array( 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_member'=>array('rule'=>'fetchidfromref','classfile'=>'/adherents/class/adherent.class.php','class'=>'Adherent','method'=>'fetch','element'=>'Member') + 'cs.fk_member'=>array('rule'=>'fetchidfromref', 'classfile'=>'/adherents/class/adherent.class.php', 'class'=>'Adherent', 'method'=>'fetch', 'element'=>'Member') ); $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_member'=>"rowid or ref"); } @@ -579,7 +579,7 @@ class modCategorie extends DolibarrModules $this->import_convertvalue_array[$r] = array( 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_project'=>array('rule'=>'fetchidfromref','classfile'=>'/projet/class/project.class.php','class'=>'Project','method'=>'fetch','element'=>'Project') + 'cs.fk_project'=>array('rule'=>'fetchidfromref', 'classfile'=>'/projet/class/project.class.php', 'class'=>'Project', 'method'=>'fetch', 'element'=>'Project') ); $this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_project'=>"rowid or ref"); } @@ -597,7 +597,7 @@ class modCategorie extends DolibarrModules $this->import_convertvalue_array[$r] = array( 'cu.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cu.fk_user'=>array('rule'=>'fetchidfromref','classfile'=>'/user/class/user.class.php','class'=>'User','method'=>'fetch','element'=>'User') + 'cu.fk_user'=>array('rule'=>'fetchidfromref', 'classfile'=>'/user/class/user.class.php', 'class'=>'User', 'method'=>'fetch', 'element'=>'User') ); $this->import_examplevalues_array[$r] = array('cu.fk_categorie'=>"rowid or label", 'cu.fk_user'=>"rowid or login"); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 9dcccb92fdc..d0e51fb8bc7 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1739,7 +1739,7 @@ class pdf_cyan extends ModelePDFPropales $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $mode = 'target'; + $mode = 'target'; $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); // Show recipient diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index c4fb2ef7b50..08ccf213b18 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -133,7 +133,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->db = $db; $this->name = "canelle"; $this->description = $langs->trans('SuppliersInvoiceModel'); - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page dimensions $this->type = 'pdf'; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 8c706f59db3..76d264f2444 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -135,7 +135,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->db = $db; $this->name = "muscadet"; $this->description = $langs->trans('SuppliersCommandModelMuscadet'); - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; @@ -1127,7 +1127,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders global $langs, $conf, $mysoc; $ltrdirection = 'L'; - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; + if ($outputlangs->trans("DIRECTION") == 'rtl') { + $ltrdirection = 'R'; + } // Load translation files required by the page $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 0a4cd815d45..5b9ffa062a3 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -132,7 +132,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->db = $db; $this->name = "standard"; $this->description = $langs->trans('DocumentModelStandardPDF'); - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 1bf47275599..c2ab5c99ea6 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -132,7 +132,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->db = $db; $this->name = "aurore"; $this->description = $langs->trans('DocModelAuroreDescription'); - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index 2f1a8ae9d71..6611f8d926e 100755 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -27,7 +27,7 @@ * \brief File containing class for advanced numbering model of Workstation */ -require_once DOL_DOCUMENT_ROOT . '/core/modules/workstation/modules_workstation.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/workstation/modules_workstation.php'; /** diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 654435dad89..7b2feef5c72 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -475,7 +475,7 @@ if ($action == 'confirm_crop') { * View */ -$title= $langs->trans("ImageEditor"); +$title = $langs->trans("ImageEditor"); $morejs = array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js'); $morecss = array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css'); diff --git a/htdocs/core/tpl/extrafields_list_search_param.tpl.php b/htdocs/core/tpl/extrafields_list_search_param.tpl.php index 56652b87dd3..7e58e106882 100644 --- a/htdocs/core/tpl/extrafields_list_search_param.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_param.tpl.php @@ -18,17 +18,17 @@ if (!empty($search_array_options) && is_array($search_array_options)) { // $extr if (is_array($val) && array_key_exists('start', $val) && array_key_exists('end', $val)) { // date range from list filters is stored as array('start' => , 'end' => ) // start date - $param .= '&' . $search_options_pattern.$tmpkey.'_startyear=' . dol_print_date($val['start'], '%Y'); - $param .= '&' . $search_options_pattern.$tmpkey.'_startmonth=' . dol_print_date($val['start'], '%m'); - $param .= '&' . $search_options_pattern.$tmpkey.'_startday=' . dol_print_date($val['start'], '%d'); - $param .= '&' . $search_options_pattern.$tmpkey.'_starthour=' . dol_print_date($val['start'], '%H'); - $param .= '&' . $search_options_pattern.$tmpkey.'_startmin=' . dol_print_date($val['start'], '%M'); + $param .= '&'.$search_options_pattern.$tmpkey.'_startyear='.dol_print_date($val['start'], '%Y'); + $param .= '&'.$search_options_pattern.$tmpkey.'_startmonth='.dol_print_date($val['start'], '%m'); + $param .= '&'.$search_options_pattern.$tmpkey.'_startday='.dol_print_date($val['start'], '%d'); + $param .= '&'.$search_options_pattern.$tmpkey.'_starthour='.dol_print_date($val['start'], '%H'); + $param .= '&'.$search_options_pattern.$tmpkey.'_startmin='.dol_print_date($val['start'], '%M'); // end date - $param .= '&' . $search_options_pattern.$tmpkey.'_endyear=' . dol_print_date($val['end'], '%Y'); - $param .= '&' . $search_options_pattern.$tmpkey.'_endmonth=' . dol_print_date($val['end'], '%m'); - $param .= '&' . $search_options_pattern.$tmpkey.'_endday=' . dol_print_date($val['end'], '%d'); - $param .= '&' . $search_options_pattern.$tmpkey.'_endhour=' . dol_print_date($val['end'], '%H'); - $param .= '&' . $search_options_pattern.$tmpkey.'_endmin=' . dol_print_date($val['end'], '%M'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endyear='.dol_print_date($val['end'], '%Y'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endmonth='.dol_print_date($val['end'], '%m'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endday='.dol_print_date($val['end'], '%d'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endhour='.dol_print_date($val['end'], '%H'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M'); $val = ''; } if ($val != '') { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index cd58ae554f2..199d9011cf6 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -125,7 +125,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l $lastseparatorkeyfound = $tmpkeyextra; } else { - print 'id) ? '_'.$object->id : ''); /*if ($extrafields_collapse_num && $extrafields_collapse_num_old && $extrafields_collapse_num != $extrafields_collapse_num_old) { print ' trextrafields_collapse_new'; }*/ diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 75daecbf38e..4f92f5d9af0 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -38,17 +38,17 @@ if ($massaction == 'predelete') { if ($massaction == 'preaffecttag') { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categ = new Categorie($db); - $categ_types=array(); - $categ_type_array=$categ->getMapList(); + $categ_types = array(); + $categ_type_array = $categ->getMapList(); foreach ($categ_type_array as $categdef) { - if (isset($object) && $categdef['obj_table']==$object->table_element) { + if (isset($object) && $categdef['obj_table'] == $object->table_element) { if (!array_key_exists($categdef['code'], $categ_types)) { - $categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class'])); + $categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class'])); } } - if (isset($objecttmp) && $categdef['obj_table']==$objecttmp->table_element) { + if (isset($objecttmp) && $categdef['obj_table'] == $objecttmp->table_element) { if (!array_key_exists($categdef['code'], $categ_types)) { - $categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class'])); + $categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class'])); } } } @@ -57,12 +57,12 @@ if ($massaction == 'preaffecttag') { if (!empty($categ_types)) { foreach ($categ_types as $categ_type) { $cate_arbo = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 1); - $formquestion[]=array('type' => 'other', + $formquestion[] = array('type' => 'other', 'name' => 'affecttag_'.$categ_type['code'], 'label' => $langs->trans("Tag").' '.$categ_type['label'], 'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $cate_arbo, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, null, null, '60%')); } - $formquestion[]=array('type' => 'other', + $formquestion[] = array('type' => 'other', 'name' => 'affecttag_type', 'label' => '', 'value' => ''); diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index dd779803026..c45ce9d2406 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -173,11 +173,11 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } - if (! empty($conf->expedition->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) { + if (!empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) { /** @var Facture $object */ $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); - if (! empty($object->linkedObjects)) { + if (!empty($object->linkedObjects)) { /** @var Expedition $shipment */ $shipment = array_shift($object->linkedObjects['shipping']); diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 1310936ca83..7f098951fe7 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -366,8 +366,8 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $parameters = array(); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); - if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { - $sectionauto[]=$hookmanager->resArray; + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { + $sectionauto[] = $hookmanager->resArray; $rowspan += count($hookmanager->resArray); } } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 1a33cf1a4b6..ac9e465b43b 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -24,7 +24,7 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** @@ -102,7 +102,7 @@ class ConferenceOrBooth extends ActionComm /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ - public $fields=array( + public $fields = array( 'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), @@ -195,11 +195,11 @@ class ConferenceOrBooth extends ActionComm */ protected function setPercentageFromStatus() { - if ($this->status==self::STATUS_DONE) { - $this->percentage=100; + if ($this->status == self::STATUS_DONE) { + $this->percentage = 100; } - if ($this->status==self::STATUS_DRAFT) { - $this->percentage=0; + if ($this->status == self::STATUS_DRAFT) { + $this->percentage = 0; } } @@ -211,12 +211,12 @@ class ConferenceOrBooth extends ActionComm */ protected function setActionCommFields(User $user) { - $this->userownerid=$user->id; - $this->type_id=$this->fk_action; - $this->socid=$this->fk_soc; - $this->datef=$this->datep2; - $this->note_private=$this->note; - $this->fk_user_author=$this->fk_user_author; + $this->userownerid = $user->id; + $this->type_id = $this->fk_action; + $this->socid = $this->fk_soc; + $this->datef = $this->datep2; + $this->note_private = $this->note; + $this->fk_user_author = $this->fk_user_author; } /** @@ -226,9 +226,9 @@ class ConferenceOrBooth extends ActionComm */ protected function getActionCommFields() { - $this->fk_action=$this->type_id; - $this->fk_soc=$this->socid; - $this->datep2=$this->datef; + $this->fk_action = $this->type_id; + $this->fk_soc = $this->socid; + $this->datep2 = $this->datef; } /** @@ -408,7 +408,9 @@ class ConferenceOrBooth extends ActionComm if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CONFERENCEORBOOTH_VALIDATE', $user); - if ($result < 0) $error++; + if ($result < 0) { + $error++; + } // End call triggers } @@ -540,7 +542,7 @@ class ConferenceOrBooth extends ActionComm if ($add_save_lastsearch_values) { $url .= '&save_lastsearch_values=1'; } - if ($option=='withproject') { + if ($option == 'withproject') { $url .= '&withproject=1'; } } diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index e0067709e85..c87f03f3110 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -178,7 +178,7 @@ class Export // Code du dataset export $this->array_export_code[$i] = $module->export_code[$r]; // Define a key for sort - $this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r]; // Add a key into the module + $this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r]; // Add a key into the module // Libelle du dataset export $this->array_export_label[$i] = $module->getExportDatasetLabel($r); // Tableau des champ a exporter (cle=champ, valeur=libelle) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index a29473eefd2..71a15023343 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -682,10 +682,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'"); } print ''; - print ''; // class is requied to be used by javascript callForResult(); + print ''; // class is requied to be used by javascript callForResult(); } else { print ''; - print ''; // class is requied to be used by javascript callForResult(); + print ''; // class is requied to be used by javascript callForResult(); } print ""; diff --git a/htdocs/index.php b/htdocs/index.php index 8c1433c79cb..1884d9a823a 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -26,7 +26,7 @@ */ -define('CSRFCHECK_WITH_TOKEN', 1); // We force need to use a token to login when making a POST +define('CSRFCHECK_WITH_TOKEN', 1); // We force need to use a token to login when making a POST require 'main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 960b5b88c74..efe20aff6b1 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4360,7 +4360,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod = new $classname($db); //$mod->remove('noboxes'); - $mod->delete_menus(); // We must delete to be sure it is inserted with new values + $mod->delete_menus(); // We must delete to be sure it is inserted with new values $mod->init($reloadmode); } else { dolibarr_install_syslog('Failed to include '.DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php'); diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 12b9ade3f2a..6fb173c4295 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -60,7 +60,7 @@ if ($id > 0 || !empty($ref)) { $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'rowid', $isdraft); -$permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index dee6476f773..16e728512f6 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -282,7 +282,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $_SESSION["FinalPaymentAmt"] = $paymentAmount; $_SESSION["currencyCodeType"] = $currencyCodeType; $_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole' - $_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip + $_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip //'--------------------------------------------------------------------------------------------------------------- //' Make the API call to PayPal diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index d3c23b17c4a..407eac7c30a 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -739,7 +739,7 @@ class Productcustomerprice extends CommonObject $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").","; $sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").","; - $sql .= " ref_customer=".(isset($this->ref_customer) ? "'" . $this->db->escape($this->ref_customer) . "'" : "null").","; + $sql .= " ref_customer=".(isset($this->ref_customer) ? "'".$this->db->escape($this->ref_customer)."'" : "null").","; $sql .= " price=".(isset($this->price) ? $this->price : "null").","; $sql .= " price_ttc=".(isset($this->price_ttc) ? $this->price_ttc : "null").","; $sql .= " price_min=".(isset($this->price_min) ? $this->price_min : "null").","; diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index c6e72c6f0da..4f695f990e4 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -113,7 +113,9 @@ if ($user->socid > 0) { // Protection if external user accessforbidden(); } //$result = restrictedArea($user, 'productbatch'); -if (!$permissiontoread) accessforbidden(); +if (!$permissiontoread) { + accessforbidden(); +} /* diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 3fc409f58be..d5de51c7311 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -607,7 +607,7 @@ $parameters = array('sql'=>$sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -if (empty($date) || ! $dateIsValid) { +if (empty($date) || !$dateIsValid) { $colspan = 8; if ($mode == 'future') { $colspan++; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 66288159f39..feee30f3527 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -880,7 +880,7 @@ foreach ($listofreferent as $key => $value) { } // Add total if we have to - if ($qualifiedfortotal) { + if ($qualifiedfortotal) { $total_ht = $total_ht + $total_ht_by_line; $total_ttc = $total_ttc + $total_ttc_by_line; } diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 56649af9a45..ae0542d8b4b 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -19,7 +19,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON p.fk_opp_status = cls.rowid"; // If lead status has been removed, we must show it in stats as unknown + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON p.fk_opp_status = cls.rowid"; // If lead status has been removed, we must show it in stats as unknown $sql .= " WHERE p.entity IN (".getEntity('project').")"; $sql .= " AND p.fk_statut = 1"; // Opend projects only if ($mine || empty($user->rights->projet->all->lire)) { @@ -91,7 +91,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $labelStatus = $listofopplabel[$status]; } if (empty($labelStatus)) { - $labelStatus = $langs->transnoentitiesnoconv('OldValue', $status); // When id is id of an entry no more in dictionary for example. + $labelStatus = $langs->transnoentitiesnoconv('OldValue', $status); // When id is id of an entry no more in dictionary for example. } //$labelStatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')'; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 753ccc9b419..0b26161c28c 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -59,9 +59,9 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); // Add new contact if ($action == 'addcontact' && $user->rights->projet->creer) { - $source = 'internal'; + $source = 'internal'; if (GETPOST("addsourceexternal")) { - $source ='external'; + $source = 'external'; } $result = $object->fetch($id, $ref); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 416c16e46a3..5c7eac48240 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -853,7 +853,7 @@ class Societe extends CommonObject $this->accountancy_code_customer = trim($this->code_compta); $this->accountancy_code_supplier = trim($this->code_compta_fournisseur); $this->accountancy_code_buy = trim($this->accountancy_code_buy); - $this->accountancy_code_sell= trim($this->accountancy_code_sell); + $this->accountancy_code_sell = trim($this->accountancy_code_sell); if (!empty($this->multicurrency_code)) { $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); @@ -917,8 +917,8 @@ class Societe extends CommonObject $sql .= ", ".(int) $this->fk_multicurrency; $sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; } $sql .= ")"; @@ -931,9 +931,9 @@ class Societe extends CommonObject // update accountancy for this entity if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $this->db->query("DELETE FROM " . MAIN_DB_PREFIX . "societe_perentity WHERE fk_soc = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); + $this->db->query("DELETE FROM ".MAIN_DB_PREFIX."societe_perentity WHERE fk_soc = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity ("; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perentity ("; $sql .= " fk_soc"; $sql .= ", entity"; $sql .= ", accountancy_code_customer"; @@ -942,11 +942,11 @@ class Societe extends CommonObject $sql .= ", accountancy_code_sell"; $sql .= ") VALUES ("; $sql .= $this->id; - $sql .= ", " . $conf->entity; - $sql .= ", '" . $this->db->escape($this->accountancy_code_customer) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_supplier) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; + $sql .= ", ".$conf->entity; + $sql .= ", '".$this->db->escape($this->accountancy_code_customer)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_supplier)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; $sql .= ")"; $result = $this->db->query($sql); if (!$result) { @@ -1053,7 +1053,7 @@ class Societe extends CommonObject $error++; $this->error = $contact->error; $this->errors = array_merge($this->errors, $contact->errors); - dol_syslog(get_class($this) . "::create_individual Affect Tag ERROR:" . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::create_individual Affect Tag ERROR:".$this->error, LOG_ERR); $contactId = $result; } } @@ -1063,7 +1063,7 @@ class Societe extends CommonObject if ($result < 0) { $this->error = $contact->error; $this->errors = array_merge($this->errors, $contact->errors); - dol_syslog(get_class($this) . "::create_individual set mailing status ERROR:" . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::create_individual set mailing status ERROR:".$this->error, LOG_ERR); $contactId = $result; } } @@ -1299,7 +1299,7 @@ class Societe extends CommonObject } $this->code_compta_client = trim(empty($this->code_compta) ? $this->code_compta_client : $this->code_compta); - $this->code_compta = $this->code_compta_client; // for backward compatibility + $this->code_compta = $this->code_compta_client; // for backward compatibility $this->code_compta_fournisseur = trim($this->code_compta_fournisseur); // Check parameters. More tests are done later in the ->verify() @@ -1340,7 +1340,7 @@ class Societe extends CommonObject $this->webservices_key = trim($this->webservices_key); $this->accountancy_code_buy = trim($this->accountancy_code_buy); - $this->accountancy_code_sell= trim($this->accountancy_code_sell); + $this->accountancy_code_sell = trim($this->accountancy_code_sell); //Incoterms $this->fk_incoterms = (int) $this->fk_incoterms; @@ -1467,8 +1467,8 @@ class Societe extends CommonObject $sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null'); $sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'"; if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; if ($customer) { $sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null"); @@ -1559,9 +1559,9 @@ class Societe extends CommonObject // update accountancy for this entity if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $this->db->query("DELETE FROM " . MAIN_DB_PREFIX . "societe_perentity WHERE fk_soc = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); + $this->db->query("DELETE FROM ".MAIN_DB_PREFIX."societe_perentity WHERE fk_soc = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity ("; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perentity ("; $sql .= " fk_soc"; $sql .= ", entity"; $sql .= ", accountancy_code_customer"; @@ -1570,11 +1570,11 @@ class Societe extends CommonObject $sql .= ", accountancy_code_sell"; $sql .= ") VALUES ("; $sql .= $this->id; - $sql .= ", " . $conf->entity; - $sql .= ", '" . $this->db->escape($this->code_compta_client)."'"; - $sql .= ", '" . $this->db->escape($this->code_compta_fournisseur)."'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; + $sql .= ", ".$conf->entity; + $sql .= ", '".$this->db->escape($this->code_compta_client)."'"; + $sql .= ", '".$this->db->escape($this->code_compta_fournisseur)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; $sql .= ")"; $result = $this->db->query($sql); if (!$result) { @@ -1702,7 +1702,7 @@ class Societe extends CommonObject } $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); } $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; @@ -1792,7 +1792,7 @@ class Societe extends CommonObject $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; $this->region_id = $obj->region_id; - $this->region_code = $obj->region_code; + $this->region_code = $obj->region_code; $this->state = ($obj->state != '-' ? $obj->state : ''); $transcode = $langs->trans('StatusProspect'.$obj->fk_stcomm); @@ -2630,7 +2630,7 @@ class Societe extends CommonObject $label .= '
'.implode(' ', $phonelist); } if (!empty($this->address)) { - $label .= '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country + $label .= '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country } elseif (!empty($this->country_code)) { $label .= '
'.$langs->trans('Country').': '.$this->country_code; } @@ -3350,7 +3350,7 @@ class Societe extends CommonObject if ($type == 'customer') { $this->code_compta_client = $mod->code; - $this->code_compta = $this->code_compta_client; // For backward compatibility + $this->code_compta = $this->code_compta_client; // For backward compatibility } elseif ($type == 'supplier') { $this->code_compta_fournisseur = $mod->code; } @@ -3385,7 +3385,7 @@ class Societe extends CommonObject if ($this->id) { // Check if the id we want to add as parent has not already one parent that is the current id we try to update if ($id > 0) { - $sameparent = $this->validateFamilyTree($id, $this->id, 0); + $sameparent = $this->validateFamilyTree($id, $this->id, 0); if ($sameparent < 0) { return -1; } @@ -3397,7 +3397,7 @@ class Societe extends CommonObject $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id); - $resql = $this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { $this->parent = $id; return 1; @@ -3426,16 +3426,16 @@ class Societe extends CommonObject $sql = 'SELECT s.parent'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= ' WHERE rowid = '.((int) $idparent); - $resql = $this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); - if ($obj->parent == '') { + if ($obj->parent == '') { return 0; - } elseif ($obj->parent == $idchild) { + } elseif ($obj->parent == $idchild) { return 1; } else { - $sameparent = $this->validateFamilyTree($obj->parent, $idchild, ($counter + 1)); + $sameparent = $this->validateFamilyTree($obj->parent, $idchild, ($counter + 1)); } return $sameparent; } else { @@ -3936,7 +3936,7 @@ class Societe extends CommonObject */ public function create_from_member(Adherent $member, $socname = '', $socalias = '', $customercode = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); @@ -4819,19 +4819,19 @@ class Societe extends CommonObject } $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET "; - $sql.= $field." = '".$this->db->escape($value)."'"; - $sql.= " WHERE rowid = ".((int) $this->id); + $sql .= $field." = '".$this->db->escape($value)."'"; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('COMPANY_MODIFY', $this, $user, $langs, $conf); + include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; + $interface = new Interfaces($this->db); + $result = $interface->run_triggers('COMPANY_MODIFY', $this, $user, $langs, $conf); if ($result < 0) { - $this->errors=$interface->errors; + $this->errors = $interface->errors; $this->db->rollback(); return -1; } @@ -4842,7 +4842,7 @@ class Societe extends CommonObject $this->db->commit(); return 1; } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index a24b6a4776c..72246fdf9cb 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -374,7 +374,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Ref. Customer print ''; - print ''; + print ''; // VAT print '
' . $langs->trans('Parameter') . '' . $langs->trans('Value') . '
'.$langs->trans('Parameter').''.$langs->trans('Value').'
' . $labelStatus . '' . price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency) . ''.$labelStatus.''.price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency).'
'.$langs->trans('RefCustomer').'
'.$langs->trans("VATRate").''; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 907c3bf26c3..9c84e2c2e89 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1019,7 +1019,7 @@ class SupplierProposal extends CommonObject $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - empty($this->lines[$i]->label) ? '' : $this->lines[$i]->label, // deprecated + empty($this->lines[$i]->label) ? '' : $this->lines[$i]->label, // deprecated $this->lines[$i]->array_options, $this->lines[$i]->ref_fourn, $this->lines[$i]->fk_unit, @@ -1405,7 +1405,9 @@ class SupplierProposal extends CommonObject $soc = new Societe($this->db); $result = $soc->fetch($this->socid); - if ($result < 0) return -1; + if ($result < 0) { + return -1; + } // Define new ref if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life diff --git a/htdocs/theme/eldy/manifest.json.php b/htdocs/theme/eldy/manifest.json.php index 7d0f75614c7..ec6472c80e6 100644 --- a/htdocs/theme/eldy/manifest.json.php +++ b/htdocs/theme/eldy/manifest.json.php @@ -64,7 +64,7 @@ top_httphead('text/json'); if (empty($dolibarr_nocache)) { header('Cache-Control: max-age=10800, public, must-revalidate'); // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server - header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT'); + header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT'); } else { header('Cache-Control: no-cache'); } @@ -79,8 +79,8 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { } -$manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR:'#F05F40'; -$manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_BG_COLOR:"#ffffff"; +$manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR : '#F05F40'; +$manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR : "#ffffff"; $manifest->display = "standalone"; $manifest->splash_pages = null; $manifest->icons = array(); @@ -97,8 +97,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) { $manifest->icons[] = $icon; } elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) { if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)) { - $iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI; - $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; + $iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI; + $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; if (is_readable($iconPath)) { $imgSize = getimagesize($iconPath); if ($imgSize) { @@ -112,8 +112,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) { } if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL)) { - $iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL; - $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; + $iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL; + $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; if (is_readable($iconPath)) { $imgSize = getimagesize($iconPath); if ($imgSize) { @@ -127,8 +127,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) { } if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) { - $iconRelativePath = 'logos/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED; - $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; + $iconRelativePath = 'logos/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED; + $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; if (is_readable($iconPath)) { $imgSize = getimagesize($iconPath); if ($imgSize) { diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php index b249e81e7df..2ad98e7e565 100644 --- a/htdocs/theme/md/manifest.json.php +++ b/htdocs/theme/md/manifest.json.php @@ -71,7 +71,7 @@ top_httphead('text/json'); if (empty($dolibarr_nocache)) { header('Cache-Control: max-age=10800, public, must-revalidate'); // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server - header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT'); + header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT'); } else { header('Cache-Control: no-cache'); } diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 924dceb14ab..c8dbdf2c1b8 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -137,11 +137,11 @@ $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $lastcreatedbox .='
'; - $lastcreatedbox .=''; - $lastcreatedbox .=''; - $lastcreatedbox .=''; - $lastcreatedbox .=''."\n"; + $lastcreatedbox .= '
'; + $lastcreatedbox .= '
'.$langs->trans("LastUsersCreated", min($num, $max)).''.$langs->trans("FullList").'
'; + $lastcreatedbox .= ''; + $lastcreatedbox .= ''; + $lastcreatedbox .= ''."\n"; $i = 0; while ($i < $num && $i < $max) { @@ -162,24 +162,24 @@ if ($resql) { $companystatic->code_client = $obj->code_client; $companystatic->canvas = $obj->canvas; - $lastcreatedbox .=''; - $lastcreatedbox .=''; + $lastcreatedbox .= '"; - $lastcreatedbox .=''; - $lastcreatedbox .=""; + $lastcreatedbox .= ''; + $lastcreatedbox .= "'; - $lastcreatedbox .=''; - $lastcreatedbox .=''; + $lastcreatedbox .= ''; + $lastcreatedbox .= ''; + $lastcreatedbox .= ''; - $lastcreatedbox .=''; + $lastcreatedbox .= ''; $i++; } - $lastcreatedbox .="
'.$langs->trans("LastUsersCreated", min($num, $max)).''.$langs->trans("FullList").'
'; - $lastcreatedbox .=$fuserstatic->getNomUrl(-1); + $lastcreatedbox .= '
'; + $lastcreatedbox .= $fuserstatic->getNomUrl(-1); if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity) { - $lastcreatedbox .=img_picto($langs->trans("SuperAdministrator"), 'redstar'); + $lastcreatedbox .= img_picto($langs->trans("SuperAdministrator"), 'redstar'); } elseif ($obj->admin) { - $lastcreatedbox .=img_picto($langs->trans("Administrator"), 'star'); + $lastcreatedbox .= img_picto($langs->trans("Administrator"), 'star'); } - $lastcreatedbox .="'.$obj->login.'"; + $lastcreatedbox .= "'.$obj->login.'"; if ($obj->fk_soc) { - $lastcreatedbox .=$companystatic->getNomUrl(1); + $lastcreatedbox .= $companystatic->getNomUrl(1); } else { - $lastcreatedbox .=$langs->trans("InternalUser"); + $lastcreatedbox .= $langs->trans("InternalUser"); } if ($obj->ldap_sid) { - $lastcreatedbox .=' ('.$langs->trans("DomainUser").')'; + $lastcreatedbox .= ' ('.$langs->trans("DomainUser").')'; } $entity = $obj->entity; @@ -193,19 +193,19 @@ if ($resql) { $entitystring = $mc->label; } } - $lastcreatedbox .=($entitystring ? ' ('.$entitystring.')' : ''); + $lastcreatedbox .= ($entitystring ? ' ('.$entitystring.')' : ''); - $lastcreatedbox .=''.dol_print_date($db->jdate($obj->datec), 'dayhour').''; - $lastcreatedbox .=$fuserstatic->getLibStatut(3); - $lastcreatedbox .=''.dol_print_date($db->jdate($obj->datec), 'dayhour').''; + $lastcreatedbox .= $fuserstatic->getLibStatut(3); + $lastcreatedbox .= '
"; - $lastcreatedbox .="

"; + $lastcreatedbox .= "
"; + $lastcreatedbox .= "

"; $db->free($resql); } else { @@ -238,11 +238,11 @@ if ($canreadperms) { } $num = $db->num_rows($resql); - $lastgroupbox .='
'; - $lastgroupbox .=''; - $lastgroupbox .=''; - $lastgroupbox .=''; - $lastgroupbox .=''; + $lastgroupbox .= '
'; + $lastgroupbox .= '
'.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).''.$langs->trans("FullList").'
'; + $lastgroupbox .= ''; + $lastgroupbox .= ''; + $lastgroupbox .= ''; $i = 0; $grouptemp = new UserGroup($db); @@ -254,21 +254,21 @@ if ($canreadperms) { $grouptemp->name = $obj->name; $grouptemp->note = $obj->note; - $lastgroupbox .=''; - $lastgroupbox .=''; + $lastgroupbox .= '"; + $lastgroupbox .= ""; if (!empty($conf->multicompany->enabled) && is_object($mc)) { $mc->getInfo($obj->entity); - $lastgroupbox .=''; + $lastgroupbox .= ''; } - $lastgroupbox .=''; - $lastgroupbox .=""; + $lastgroupbox .= ''; + $lastgroupbox .= ""; $i++; } $lastgroupbox .= "
'.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).''.$langs->trans("FullList").'
'; - $lastgroupbox .=$grouptemp->getNomUrl(1); + $lastgroupbox .= '
'; + $lastgroupbox .= $grouptemp->getNomUrl(1); if (!$obj->entity) { - $lastgroupbox .=img_picto($langs->trans("GlobalGroup"), 'redstar'); + $lastgroupbox .= img_picto($langs->trans("GlobalGroup"), 'redstar'); } - $lastgroupbox .="'; - $lastgroupbox .=$mc->label; - $lastgroupbox .=''; + $lastgroupbox .= $mc->label; + $lastgroupbox .= ''.dol_print_date($db->jdate($obj->datec), 'dayhour').'
'.dol_print_date($db->jdate($obj->datec), 'dayhour').'
"; diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 35997d16d6e..25eeec6430f 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -527,7 +527,7 @@ function createProductOrService($authentication, $product) $newobject->label = empty($product['label']) ? '' : $product['label']; $newobject->description = empty($product['description']) ? '' : $product['description']; $newobject->note_public = empty($product['note_public']) ? '' : $product['note_public']; - $newobject->note_private = empty($product['note_private']) ? '' :$product['note_private']; + $newobject->note_private = empty($product['note_private']) ? '' : $product['note_private']; $newobject->status = empty($product['status_tosell']) ? 0 : $product['status_tosell']; $newobject->status_buy = empty($product['status_tobuy']) ? 0 : $product['status_tobuy']; $newobject->price = isset($product['price_net']) ? $product['price_net'] : 0; diff --git a/htdocs/workstation/class/workstationresource.class.php b/htdocs/workstation/class/workstationresource.class.php index 72fb91cfe85..0b670891583 100644 --- a/htdocs/workstation/class/workstationresource.class.php +++ b/htdocs/workstation/class/workstationresource.class.php @@ -38,8 +38,8 @@ class WorkstationResource extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'fk_workstation' => array ('type' => 'integer'), - 'fk_resource' => array ('type' => 'integer') + 'fk_workstation' => array('type' => 'integer'), + 'fk_resource' => array('type' => 'integer') ); /** diff --git a/htdocs/workstation/class/workstationusergroup.class.php b/htdocs/workstation/class/workstationusergroup.class.php index 86fdda7ce66..a40ea43143a 100644 --- a/htdocs/workstation/class/workstationusergroup.class.php +++ b/htdocs/workstation/class/workstationusergroup.class.php @@ -37,8 +37,8 @@ class WorkstationUserGroup extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'fk_workstation' => array ('type' => 'integer'), - 'fk_usergroup' => array ('type' => 'integer') + 'fk_workstation' => array('type' => 'integer'), + 'fk_usergroup' => array('type' => 'integer') ); /** diff --git a/htdocs/workstation/lib/workstation.lib.php b/htdocs/workstation/lib/workstation.lib.php index fc57575bcf9..92ea28d8bfb 100755 --- a/htdocs/workstation/lib/workstation.lib.php +++ b/htdocs/workstation/lib/workstation.lib.php @@ -34,7 +34,7 @@ function workstationAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT . "/admin/workstation.php"; + $head[$h][0] = DOL_URL_ROOT."/admin/workstation.php"; $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++;