diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index dfe3fa53994..1bbd13d9022 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -41,6 +41,8 @@ return (new PhpCsFixer\Config()) // So we use target PHP70 for the moment. '@PHP70Migration' => true, //'@PHP71Migration' => true, + // Avoid adding public to const (incompatible with PHP 7.0): + 'visibility_required' => ['elements'=>['property', 'method']], //'strict_param' => true, //'array_syntax' => ['syntax' => 'short'], diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index 11b0d8668af..f71ddb0ca60 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -43,8 +43,9 @@ class PrestaShopWebservice /** @var string PS version */ protected $version; - /** @var array compatible versions of PrestaShop Webservice */ + /** @var string compatible min version of PrestaShop Webservice */ const PSCOMPATIBLEVERSIONMIN = '1.4.0.0'; + /** @var string compatible max version of PrestaShop Webservice */ const PSCOMPATIBLEVERSIONMAX = '1.7.99.99'; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 0f33e1506f5..714dd781d28 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -707,7 +707,7 @@ if ($action == 'edit') { // SMTPS PW if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') != "XOAUTH2") { - print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).''; + print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW')).''; } // SMTPS oauth service diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 27ac6154296..44a7565e9be 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -70,7 +70,7 @@ $now = dol_now(); //restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); if (!$user->hasRight('propal', 'read') && !$user->hasRight('supplier_proposal', 'read') && !$user->hasRight('commande', 'read') && !$user->hasRight('fournisseur', 'commande', 'read') - && !$user->hasRight('supplier_order', 'read') && !$user->hasRight('fichinter', 'read')) { + && !$user->hasRight('supplier_order', 'read') && !$user->hasRight('fichinter', 'read') && !$user->hasRight('contrat', 'read')) { accessforbidden(); } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9bc9d68220f..fb8949c6309 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -181,8 +181,6 @@ class Facture extends CommonInvoice public $fk_facture_source; public $linked_objects = array(); - public $date_lim_reglement; - /** * @var int ID Field to store bank id to use when payment mode is withdraw */ diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 0f3b8628122..1047e0f884f 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -49,6 +49,12 @@ abstract class CommonInvoice extends CommonObject */ public $subtype; + /** + * @var int Thirdparty ID + * @deprecated + * @see $socid + */ + public $fk_soc; /** * @var int Thirdparty ID */ @@ -63,6 +69,8 @@ abstract class CommonInvoice extends CommonObject */ public $date; + public $date_lim_reglement; + public $cond_reglement_id; // Id in llx_c_paiement public $cond_reglement_code; // Code in llx_c_paiement public $cond_reglement_label; diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 061d5fd3c95..bcc89ae3f9c 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -101,7 +101,7 @@ $arrayofjs = array(); $arrayofcss = array(); top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); -print ''."\n"; +print ''."\n"; // Javascript to make menu active like Jmobile did. print ' @@ -125,6 +125,22 @@ print ' padding-left: 40px; /* width = 20 for level0, 20 for level1 */ } + .getmenudiv a:hover { + text-decoration: none; + } + + .pictofixedwidth { + text-align: left; + padding-right: 10px !important; + } + + li.lilevel1 > a, li.lilevel1 > i { + padding-left: 30px !important; + } + li.lilevel2 a { + padding-left: 60px !important; + } + a.alilevel0, span.spanlilevel0 { background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/next.png\') !important; background-repeat: no-repeat !important;'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index a08b6b19030..c4f8972253a 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -364,6 +364,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir) $filearray[$key]['position'] = '999999'; // File not indexed are at end. So if we add a file, it will not replace an existing position $filearray[$key]['cover'] = 0; $filearray[$key]['acl'] = ''; + $filearray[$key]['share'] = 0; $rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filearray[$key]['fullname']); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index e7610b466ff..a9a750b34a6 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2256,7 +2256,7 @@ class FactureFournisseur extends CommonInvoice $supplierinvoiceline->fk_remise_except = $fk_remise_except; - $supplierinvoiceline->special_code = ((string) $special_code != '' ? $special_code : $this->special_code); + $supplierinvoiceline->special_code = (string) $special_code; $supplierinvoiceline->fk_parent_line = $fk_parent_line; $supplierinvoiceline->origin = $this->origin; $supplierinvoiceline->origin_id = $origin_id; @@ -3699,7 +3699,6 @@ class SupplierInvoiceLine extends CommonObjectLine $this->product_type = $obj->product_type; $this->product_label = $obj->product_label; $this->info_bits = $obj->info_bits; - $this->tva_npr = ($obj->info_bits & 1 == 1) ? 1 : 0; $this->fk_parent_line = $obj->fk_parent_line; $this->special_code = $obj->special_code; $this->rang = $obj->rang; @@ -3723,7 +3722,7 @@ class SupplierInvoiceLine extends CommonObjectLine */ public function delete($notrigger = 0) { - global $user, $conf; + global $user; dol_syslog(get_class($this)."::deleteline rowid=".((int) $this->id), LOG_DEBUG); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 26751c291d7..fd9e0245ad8 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -67,6 +67,11 @@ class ProductFournisseur extends Product public $desc_supplier; public $vatrate_supplier; // default vat rate for this supplier/qty/product (can be set by get_buyprice) + /** + * @deprecated + * @see $product_id + */ + public $fk_product; public $product_id; public $product_ref; diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index 9409ae0d40f..c234f22c7e4 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -45,17 +45,20 @@ $langs->loadLangs(array("intracommreport")); // Get Parameters $id = GETPOST('id', 'int'); $action = GETPOST('action'); -$exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB or DES $year = GETPOSTINT('year'); $month = GETPOSTINT('month'); $label = (string) GETPOST('label', 'alphanohtml'); -$type_declaration = (string) GETPOST('type_declaration', 'alphanohtml'); + +$exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB or DES +$type_declaration = (string) GETPOST('type_declaration', 'alphanohtml'); // 'introduction' or 'expedition' + $backtopage = GETPOST('backtopage', 'alpha'); $declaration = array( "deb" => $langs->trans("DEB"), "des" => $langs->trans("DES"), ); + $typeOfDeclaration = array( "introduction" => $langs->trans("Introduction"), "expedition" => $langs->trans("Expedition"), @@ -121,8 +124,8 @@ if ($permissiontodelete && $action == 'confirm_delete' && $confirm == 'yes') { if ($action == 'add' && $permissiontoadd) { $object->label = trim($label); - $object->type = trim($exporttype); - $object->type_declaration = $type_declaration; + $object->exporttype = trim($exporttype); // 'des' or 'deb' + $object->type_declaration = $type_declaration; // 'introduction' or 'expedition' //$object->subscription = (int) $subscription; // Fill array 'array_options' with data from add form @@ -272,7 +275,7 @@ if ($id > 0 && $action != 'edit') { print ''; // Type of Declaration - print ''.$langs->trans("TypeOfDeclaration").''.$object->type_declaration.''; + print ''.$langs->trans("TypeOfDeclaration").''.$object->exporttype.''; print ''; print "\n"; diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index 7512813ebae..bd6646ffe37 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -67,7 +67,9 @@ class IntracommReport extends CommonObject */ public $declaration_number; - public $type_declaration; // deb or des + public $exporttype; // deb or des + public $type_declaration; // 'introduction' or 'expedition' + public $numero_declaration; /** @@ -199,7 +201,7 @@ class IntracommReport extends CommonObject * * @param int $period_year Year of declaration * @param int $period_month Month of declaration - * @param string $type_declaration Declaration type by default - introduction or expedition (always 'expedition' for Des) + * @param string $type_declaration Declaration type by default - 'introduction' or 'expedition' (always 'expedition' for Des) * @return SimpleXMLElement|int */ public function getXMLDes($period_year, $period_month, $type_declaration = 'expedition') @@ -214,9 +216,8 @@ class IntracommReport extends CommonObject $declaration_des->addChild('mois_des', $period_month); $declaration_des->addChild('an_des', $period_year); - /**************Ajout des lignes de factures**************************/ + // Add invoice lines $res = $this->addItemsFact($declaration_des, $type_declaration, $period_year.'-'.$period_month, 'des'); - /********************************************************************/ $this->errors = array_unique($this->errors); @@ -231,9 +232,9 @@ class IntracommReport extends CommonObject * Add line from invoice * * @param SimpleXMLElement $declaration Reference declaration - * @param string $type Declaration type by default - introduction or expedition (always 'expedition' for Des) + * @param string $type Declaration type by default - 'introduction' or 'expedition' (always 'expedition' for Des) * @param int $period_reference Reference period - * @param string $exporttype deb=DEB, des=DES + * @param string $exporttype 'deb' for DEB, 'des' for DES * @return int Return integer <0 if KO, >0 if OK */ public function addItemsFact(&$declaration, $type, $period_reference, $exporttype = 'deb') @@ -297,7 +298,7 @@ class IntracommReport extends CommonObject * @param string $type Declaration type by default - introduction or expedition (always 'expedition' for Des) * @param int $period_reference Reference declaration * @param string $exporttype deb=DEB, des=DES - * @return string Return integer <0 if KO, >0 if OK + * @return string Return integer <0 if KO, >0 if OK */ public function getSQLFactLines($type, $period_reference, $exporttype = 'deb') { @@ -454,7 +455,8 @@ class IntracommReport extends CommonObject */ public function getNextDeclarationNumber() { - $sql = "SELECT MAX(numero_declaration) as max_declaration_number FROM ".MAIN_DB_PREFIX.$this->table_element; + $sql = "SELECT MAX(numero_declaration) as max_declaration_number"; + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE exporttype = '".$this->db->escape($this->exporttype)."'"; $resql = $this->db->query($sql); if ($resql) { @@ -478,9 +480,10 @@ class IntracommReport extends CommonObject /** * Generate XML file * + * @param string $content_xml Content * @return void */ - public function generateXMLFile() + public function generateXMLFile($content_xml) { $name = $this->period.'.xml'; @@ -488,7 +491,7 @@ class IntracommReport extends CommonObject $fname = sys_get_temp_dir().'/'.$name; $f = fopen($fname, 'w+'); - fwrite($f, $this->content_xml); + fwrite($f, $content_xml); fclose($f); header('Content-Description: File Transfer');