diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 8daae94efe6..0193d9c1f75 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -389,11 +389,11 @@ if ($resql) { print ''; if (empty($obj->active)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 965b63ba9b9..984a5b08e90 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -214,11 +214,11 @@ if (! empty($user->admin)) print ''; print '' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ''; if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -227,11 +227,11 @@ if (! empty($user->admin)) print ''; print '' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ''; if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -240,11 +240,11 @@ if (! empty($user->admin)) print ''; print '' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . ''; if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -253,11 +253,11 @@ if (! empty($user->admin)) print ''; print '' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -266,11 +266,11 @@ if (! empty($user->admin)) print ''; print '' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . ''; if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -279,11 +279,11 @@ if (! empty($user->admin)) print ''; print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 8974b65a68f..d94ce0ec315 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -531,11 +531,11 @@ if ($action == 'create') print '' . $langs->trans("Status") . ''; print ''; if (empty($object->validated)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index b9339a8150b..8ca2de4a132 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -616,7 +616,7 @@ class AccountancyExport $date = dol_print_date($line->doc_date, '%d/%m/%Y'); print $date . $separator; - print $line->code_journal; + print $line->code_journal . $separator; if (empty($line->subledger_account)) { print length_accountg($line->numero_compte) . $separator; } else { diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 5b2c3e912dd..105251ec114 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -137,7 +137,7 @@ if ($object->id > 0) print '
'; $object->info($id); - print dol_print_object_info($object, 1); + dol_print_object_info($object, 1); print ''; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index c310bb18627..5e7847efa82 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -65,7 +65,7 @@ class AdherentType extends CommonObject * @var string Adherent type label */ public $label; - + /** * @var string Adherent type nature */ @@ -410,7 +410,7 @@ class AdherentType extends CommonObject return -1; } } - + /** * Return translated label by the nature of a adherent (physical or moral) * @@ -422,7 +422,7 @@ class AdherentType extends CommonObject global $langs; if ($morphy == 'phy') { return $langs->trans("Physical"); } elseif ($morphy == 'mor') { return $langs->trans("Moral"); } - else return $langs->trans("Physical & Morale"); + else return $langs->trans("Physical & Morale"); //return $morphy; } @@ -463,6 +463,7 @@ class AdherentType extends CommonObject } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -472,7 +473,7 @@ class AdherentType extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - private function _load_ldap_dn($info, $mode = 0) + public function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; @@ -485,12 +486,13 @@ class AdherentType extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Initialize the info array (array of LDAP values) that will be used to call LDAP functions * * @return array Tableau info des attributs */ - private function _load_ldap_info() + public function _load_ldap_info() { // phpcs:enable global $conf,$langs; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 4a7229af5ef..5cad21cdd71 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -151,8 +151,7 @@ print '
'; print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index bf02df80b5b..63597eaa22b 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -256,7 +256,7 @@ foreach ($dirmodels as $reldir) } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index a27be02acb0..6d1b640f45b 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -608,9 +608,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; // Delete - print ''; print ''; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 04dcf3ddc36..23a154511c1 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -261,7 +261,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index cac83ef8d8b..da77c0e78d3 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -267,7 +267,7 @@ foreach ($dirmodels as $reldir) } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index b9b78e55ec9..94abf8df2ab 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -66,8 +66,8 @@ else if ($action == 'add' || GETPOST("modify")) { - $external_rss_title = "external_rss_title_" . GETPOST("norss"); - $external_rss_urlrss = "external_rss_urlrss_" . GETPOST("norss"); + $external_rss_title = "external_rss_title_" . GETPOST("norss", 'int'); + $external_rss_urlrss = "external_rss_urlrss_" . GETPOST("norss", 'int'); if (! empty($_POST[$external_rss_urlrss])) { @@ -95,7 +95,7 @@ if ($action == 'add' || GETPOST("modify")) { // Ajoute boite box_external_rss dans definition des boites $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)"; - $sql.= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss").' ('.GETPOST($external_rss_title)).")')"; + $sql.= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss", 'int').' ('.GETPOST($external_rss_title, 'alpha')).")')"; if (! $db->query($sql)) { dol_print_error($db); @@ -103,8 +103,8 @@ if ($action == 'add' || GETPOST("modify")) } } - $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), GETPOST($external_rss_title), 'chaine', 0, '', $conf->entity); - if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), GETPOST($external_rss_urlrss), 'chaine', 0, '', $conf->entity); + $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss", 'int'), GETPOST($external_rss_title, 'alpha'), 'chaine', 0, '', $conf->entity); + if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss", 'int'), GETPOST($external_rss_urlrss, 'alpha'), 'chaine', 0, '', $conf->entity); if ($result1 && $result2) { @@ -122,13 +122,13 @@ if ($action == 'add' || GETPOST("modify")) if ($_POST["delete"]) { - if(GETPOST("norss")) + if (GETPOST("norss", 'int')) { $db->begin(); // Supprime boite box_external_rss de definition des boites $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def"; - $sql.= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss"))." %'"; + $sql.= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss", 'int'))." %'"; $resql=$db->query($sql); if ($resql) @@ -168,8 +168,8 @@ if ($_POST["delete"]) } - $result1=dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), $conf->entity); - if ($result1) $result2=dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), $conf->entity); + $result1=dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_".GETPOST("norss", 'int'), $conf->entity); + if ($result1) $result2=dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_".GETPOST("norss", 'int'), $conf->entity); if ($result1 && $result2) { @@ -270,13 +270,13 @@ if ($resql) print ''; print ""; - print ""; + print ""; print ""; print ''; print ""; - print ""; + print ""; print ""; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 57a18afcbd3..765f2e6f995 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -352,7 +352,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index a407edd3864..27f105435d5 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -331,7 +331,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 347d45d729d..e3571fdb253 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -257,7 +257,7 @@ foreach ($dirmodels as $reldir) } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index d11d07c5f38..7635c9a3c19 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -252,7 +252,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 517ec9b9dc5..4ee9e214890 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -162,7 +162,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; - $link=''; + $link=''; //$link.=$langs->trans("Disable"); $link.=img_picto($langs->trans("Activated"), 'switch_on'); $link.=''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index d74f10ca58c..bc12fd5ddd6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -519,7 +519,7 @@ else { dol_fiche_head($head, 'common', '', -1); - print $langs->trans("EMailsDesc")."
\n"; + print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; print '
'.$langs->trans("Filter").'
'.$langs->trans("Member").''; -$filter='s.client in (1,2,3)'; -print $form->select_company($id,'memberid',$filter,1); +print $form->select_company($id,'memberid','',1); print '
'.$langs->trans("User").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index b7f1f0e6db9..b6e62973cf7 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -275,7 +275,7 @@ foreach ($dirmodels as $reldir) } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index e8e035f8b49..efc192e6de1 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -184,7 +184,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; - print ' '.img_edit().''; - print '   '; + print ''; + print ''.img_edit().''; print ' '.img_delete().''; print '
".$langs->trans("Title")."global->$keyrsstitle . "\">global->$keyrsstitle) . "\">
".$langs->trans("URL")."global->$keyrssurl . "\">global->$keyrssurl) . "\">
'; diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 4ce8d8c0b72..1e54fdea3dd 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -396,7 +396,7 @@ else { dol_fiche_head($head, 'common_emailing', '', -1); - print $langs->trans("EMailsDesc")."
\n"; + print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; print '
'; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index aaba339e30e..4e80fe55e25 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -183,7 +183,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index db41876b02c..843de325e73 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -314,7 +314,7 @@ foreach ($dirmodels as $reldir) } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index f97c1d7823b..a1fd76e0d5d 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -266,7 +266,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 96552ed2c0d..e0b4b986969 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -64,10 +64,10 @@ if ($action == 'update' || $action == 'add') $constnote=$_POST["constnote"][$key]; $res=dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); - + if (! $res > 0) $error++; } - + if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -123,9 +123,9 @@ $head = mailmanspip_admin_prepare_head(); if (! empty($conf->global->ADHERENT_USE_SPIP)) { print ''; - + dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); - + //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); @@ -141,25 +141,25 @@ if (! empty($conf->global->ADHERENT_USE_SPIP)) print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); print '
'; - + form_constantes($constantes, 2); - + dol_fiche_end(); print '
'; - + print ''; } else { dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); - - $link='
'; + + $link=''; //$link.=$langs->trans("Activate"); $link.=img_picto($langs->trans("Disabled"), 'switch_off'); $link.=''; print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); - + dol_fiche_end(); } diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 6d8936fbe71..836afc27a7c 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -276,7 +276,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index c414eca8158..e895a0b4005 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -178,7 +178,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER') // TODO We add/delete permission here until permission can have a condition on a global var include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; $newmodule=new modFournisseur($db); - + if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { // clear default rights array @@ -191,7 +191,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER') $newmodule->rights[$r][3] = 0; $newmodule->rights[$r][4] = 'commande'; $newmodule->rights[$r][5] = 'approve2'; - + // Insert $newmodule->insert_permissions(1); } @@ -199,7 +199,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER') { // Remove all rights with Permission1190 $newmodule->delete_permissions(); - + // Add all right without Permission1190 $newmodule->insert_permissions(1); } @@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 4cf53e6d82f..49af65bd786 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -268,7 +268,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index b757fb66673..8b17c860fd4 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -283,7 +283,7 @@ foreach ($dirmodels as $reldir) } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 8e018bc2255..c04c91e0e66 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -36,7 +36,13 @@ $action=GETPOST('action', 'alpha'); if ($action == 'convert') { - $db->query("alter table ".$_GET["table"]." ENGINE=INNODB"); + $sql="ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB"; + $db->query($sql); +} +if ($action == 'convertutf8') +{ + $sql="ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $db->query($sql); } @@ -111,23 +117,28 @@ else print ''; print ''; - if (isset($row[1]) && $row[1] == "MyISAM") + if (isset($obj->Engine) && $obj->Engine == "MyISAM") { - print ''; + print ''; } else { print ''; } print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; $i++; } diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index f9e985cec94..331d7e992ba 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -259,7 +259,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->TICKET_ADDON == 'mod_' . $classname) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; } print ''; diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index c593846a29d..c1ddedfea53 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -36,6 +36,8 @@ $export_type=GETPOST('export_type', 'alpha'); $file=GETPOST('zipfilename_template', 'alpha'); $compression = GETPOST('compression'); +$file = dol_sanitizeFileName($file); + $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST("page", 'int'); @@ -57,10 +59,11 @@ $errormsg=''; if ($action == 'delete') { - $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); - $ret=dol_delete_file($file, 1); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); + $filerelative = dol_sanitizeFileName(GETPOST('urlfile', 'alpha')); + $filepath=$conf->admin->dir_output.'/'.$filerelative; + $ret=dol_delete_file($filepath, 1); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", $filerelative), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", $filerelative), null, 'errors'); $action=''; } diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index b1e8c310ed0..806f53c463c 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -171,13 +171,13 @@ foreach($workflowcodes as $key => $params) { if (! empty($conf->global->$key)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index 6d7ac9d2f85..ed23151d99b 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -108,13 +108,13 @@ print ''; $production_mode=(empty($conf->global->API_PRODUCTION_MODE)?false:true); if ($production_mode) { - print ''; } else { - print ''; } diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index a1db711dd3e..a4bf134e3ce 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -23,25 +23,12 @@ */ // Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php"; -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php"; -if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php"; -if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php"; -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/bom/class/bom.class.php'); -dol_include_once('/bom/lib/bom.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; // Load translation files required by the page @@ -196,7 +183,7 @@ if ($object->id > 0) print '
'; $object->info($object->id); - print dol_print_object_info($object, 1); + dol_print_object_info($object, 1); print ''; diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 4fcb7450e9d..cdba572f96c 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -121,7 +121,7 @@ print "\n"; print ''; print ''; if (! empty($conf->banque->enabled)) { diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index a7aab12b2ef..6dbbdd4f900 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -49,11 +49,11 @@ switch($action) // Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ... if ( $_POST['hdnSource'] == 'LISTE' ) { - $sql.= " AND p.rowid = ".$_POST['selProduit']; + $sql.= " AND p.rowid = ".((int) GETPOST('selProduit', 'int')); } elseif ( $_POST['hdnSource'] == 'REF' ) { - $sql.= " AND p.ref = '".$_POST['txtRef']."'"; + $sql.= " AND p.ref = '".$db->escape(GETPOST('txtRef', 'alpha'))."'"; } $result = $db->query($sql); diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 56da8496b9f..8bd64c76e2b 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -134,7 +134,7 @@ print ''; print "\n"; diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index d65a39fc6aa..bc8bb1bcaed 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -78,7 +78,7 @@ print '
'.$obj->Name.''.$obj->Engine.''.$langs->trans("Convert").''.$langs->trans("Convert").' InnoDB '.$obj->Row_format.''.$obj->Rows.''.$obj->Avg_row_length.''.$obj->Data_length.''.$obj->Max_data_length.''.$obj->Index_length.''.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation.''.$obj->Rows.''.$obj->Avg_row_length.''.$obj->Data_length.''.$obj->Max_data_length.''.$obj->Index_length.''.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation; + if (isset($obj->Collation) && ($obj->Collation == "utf8mb4_general_ci" || $obj->Collation == "utf8mb4_unicode_ci")) + { + print '
'.$langs->trans("Convert").' UTF8'; + } + print '
'.$langs->trans("ApiProductionMode").''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print '
'.$langs->trans("CashDeskThirdPartyForSell").''; -print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3) AND s.status = 1', 1, 0, 0, array(), 0); +print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', '(s.client in (1,3) AND s.status = 1)', 1, 0, 0, array(), 0); print '
'; $disabled=0; $langs->load("companies"); if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice -print $form->select_company(GETPOST('socid', 'int')?GETPOST('socid', 'int'):$conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3) AND s.status = 1', !$disabled, $disabled, 1); +print $form->select_company(GETPOST('socid', 'int')?GETPOST('socid', 'int'):$conf->global->CASHDESK_ID_THIRDPARTY, 'socid', '(s.client IN (1,3) AND s.status = 1)', !$disabled, $disabled, 1); //print ''; print '
'; + print '
'; // Prospect/Customer print '
'.$langs->trans('ProspectCustomer').''; @@ -534,7 +534,7 @@ if ($object->id > 0) print '
'; print '
'; - print ''; + print '
'; // Level of prospect print '
'; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 34ed7708e9e..9f31e8f64c1 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -471,13 +471,13 @@ if (empty($reshook)) if ($result) { setEventMessages($langs->trans("MailSuccessfulySent", $mailfile->getValidAddress($object->email_from, 2), $mailfile->getValidAddress($object->sendto, 2)), null, 'mesgs'); + $action = ''; } else { setEventMessages($langs->trans("ResultKo").'
'.$mailfile->error.' '.$result, null, 'errors'); + $action = 'test'; } - - $action=''; } } @@ -746,7 +746,7 @@ if ($action == 'create') dol_fiche_head(); - print ''; + print '
'; print ''; print ''; print ''; @@ -893,7 +893,7 @@ else print '
'; print '
'; - print '
'.$langs->trans("MailTitle").'
'.$langs->trans("MailFrom").'
'.$langs->trans("MailErrorsTo").'
'; + print '
'; // Description print '
'.$form->editfieldkey("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 619f61bdc67..3cc5f12566d 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -130,13 +130,12 @@ if ($action == 'delete') $resql=$db->query($sql); if ($resql) { - if (!empty($id)) + if (! empty($id)) { $obj = new MailingTargets($db); $obj->update_nb($id); - header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); - exit; + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } else { @@ -196,7 +195,7 @@ if ($object->fetch($id) >= 0) print '
'; print '
'; - print ''; + print '
'; print ''; @@ -432,7 +431,6 @@ if ($object->fetch($id) >= 0) $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); $param = "&id=".$object->id; @@ -471,7 +469,7 @@ if ($object->fetch($id) >= 0) if ($page) $param.= "&page=".$page; print '
'; - print '
'.$langs->trans("MailTitle").''.$object->titre.'
'; + print '
'; // Ligne des champs de filtres print ''; @@ -533,6 +531,15 @@ if ($object->fetch($id) >= 0) if ($num) { + include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $objectstaticmember=new Adherent($db); + $objectstaticuser=new User($db); + $objectstaticcompany=new Societe($db); + $objectstaticcontact=new Contact($db); + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -551,32 +558,23 @@ if ($object->fetch($id) >= 0) { if ($obj->source_type == 'member') { - include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - $objectstatic=new Adherent($db); - $objectstatic->fetch($obj->source_id); - print $objectstatic->getNomUrl(1); + $objectstaticmember->fetch($obj->source_id); + print $objectstaticmember->getNomUrl(1); } elseif ($obj->source_type == 'user') { - include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; - $objectstatic=new User($db); - $objectstatic->fetch($obj->source_id); - $objectstatic->id=$obj->source_id; - print $objectstatic->getNomUrl(1); + $objectstaticuser->fetch($obj->source_id); + print $objectstaticuser->getNomUrl(1); } elseif ($obj->source_type == 'thirdparty') { - include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $objectstatic=new Societe($db); - $objectstatic->fetch($obj->source_id); - print $objectstatic->getNomUrl(1); + $objectstaticcompany->fetch($obj->source_id); + print $objectstaticcompany->getNomUrl(1); } elseif ($obj->source_type == 'contact') { - include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; - $objectstatic=new Contact($db); - $objectstatic->fetch($obj->source_id); - print $objectstatic->getNomUrl(1); + $objectstaticcontact->fetch($obj->source_id); + print $objectstaticcontact->getNomUrl(1); } else { @@ -605,7 +603,7 @@ if ($object->fetch($id) >= 0) if ($obj->statut == 0) // Not sent yet { if ($user->rights->mailing->creer && $allowaddtarget) { - print ''.img_delete($langs->trans("RemoveRecipient")).''; + print ''.img_delete($langs->trans("RemoveRecipient")).''; } } /*if ($obj->statut == -1) // Sent with error diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 4950efb19ab..c8cba5c3dda 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1679,7 +1679,7 @@ if ($action == 'create') print ''; print ''; print ''; } diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 48138246824..aa47f1c226d 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -252,7 +252,7 @@ print '
'; print '
'; // Company print ''; // User diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 3a40f6b1863..81a477d07c5 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -264,7 +264,7 @@ print '
' . $langs->trans("Project") . ''; $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id).'">' . $langs->trans("AddProject") . ''; + print '   id).'">' . $langs->trans("AddProject") . ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - $filter='s.client in (1,2,3)'; + $filter='s.client IN (1,2,3)'; print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'; print ''; // Company print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b8842328263..ae9641a1600 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2736,7 +2736,7 @@ if ($action == 'create') else { print '\n"; print ''; print ''; if (! empty($conf->banque->enabled)) { diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index ab4be871d7c..984315b0bde 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -23,8 +23,8 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> } .badge-pill, .tabs .badge { - padding-right: .6em; - padding-left: .6em; + padding-right: .5em; + padding-left: .5em; border-radius: 0.25rem; } diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index 50a042d1390..b20db935154 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -1,9 +1,9 @@ -/*
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; -if ($mode == 'customer') $filter='s.client in (1,2,3)'; +if ($mode == 'customer') $filter='s.client IN (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'; - print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print $form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // Option to reload page to retrieve customer informations. Note, this clear other input if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) { diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 867b4e8df30..5eedb9b5740 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -281,141 +281,6 @@ if (empty($reshook)) // Set mode elseif ($action == 'setmode' && $user->rights->facture->creer) { - // Add custom code and origin country into description - if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) - { - $tmptxt = '('; - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { - $outputlangs = $langs; - $newlang = ''; - if (empty($newlang) && GETPOST('lang_id', 'alpha')) $newlang = GETPOST('lang_id', 'alpha'); - if (empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - $outputlangs->load('products'); - } - if (! empty($prod->customcode)) $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; - if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt .= ' - '; - if (! empty($prod->country_code)) $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0); - } else { - if (! empty($prod->customcode)) $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; - if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt .= ' - '; - if (! empty($prod->country_code)) $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); - } - $tmptxt .= ')'; - $desc = dol_concatdesc($desc, $tmptxt); - } - - $type = $prod->type; - $fk_unit = $prod->fk_unit; - } - else - { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); - $tva_tx = str_replace('*', '', $tva_tx); - if (empty($tva_tx)) $tva_npr=0; - $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); - $desc = $product_desc; - $type = GETPOST('type'); - $fk_unit= GETPOST('units', 'alpha'); - } - - $date_start_fill = GETPOST('date_start_fill', 'int'); - $date_end_fill = GETPOST('date_end_fill', 'int'); - - // Margin - $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); - $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value - - // Local Taxes - $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr); - $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr); - - $info_bits = 0; - if ($tva_npr) - $info_bits |= 0x01; - - if ($usercanproductignorepricemin && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { - $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); - setEventMessages($mesg, null, 'errors'); - } - else - { - // Insert line - $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, - 1, $special_code, $label, $fk_unit, 0, $date_start_fill, $date_end_fill, $fournprice, $buyingprice); - - if ($result > 0) - { - // Define output language and generate document - /*if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model=$object->modelpdf; - $ret = $object->fetch($id); // Reload to get new records - - $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); - }*/ - $object->fetch($object->id); // Reload lines - - unset($_POST['prod_entry_mode']); - - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['multicurrency_price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - unset($_POST['np_marginRate']); - unset($_POST['np_markRate']); - unset($_POST['dp_desc']); - unset($_POST['idprod']); - unset($_POST['units']); - - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); - - unset($_POST['date_start_fill']); - unset($_POST['date_end_fill']); - - unset($_POST['situations']); - unset($_POST['progress']); - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } - - $action = ''; - } $result=$object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); } // Set project diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 6e093a934dd..2b135c3cc37 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -227,7 +227,7 @@ else print '
'; $object->info($id); - print dol_print_object_info($object, 1); + dol_print_object_info($object, 1); print ''; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 886e836f10e..3451e14ae2a 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -145,7 +145,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print ''; + print '
'; // Ligne info remises tiers diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 272ac1532a6..72c78cb8a4d 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -194,7 +194,7 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha')) // Security: // Disallow file with some extensions. We rename them. // Because if we put the documents directory into a directory inside web root (very bad), this allows to execute on demand arbitrary code. - if (preg_match('/(\.htm|\.html|\.php|\.pl|\.cgi)$/i', $filenameto) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED)) + if (isAFileWithExecutableContent($filenameto) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED)) { $filenameto.= '.noexe'; } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index ddb1bb0c6d0..a58a768eace 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -505,6 +505,31 @@ class CMailFile return true; } + $sendingmode = $this->sendmode; + if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail') + { + // List of sending methods + $listofmethods=array(); + $listofmethods['mail']='PHP mail function'; + //$listofmethods['simplemail']='Simplemail class'; + $listofmethods['smtps']='SMTP/SMTPS socket library'; + + // EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent. + // You ensure that every user is using its own SMTP server when using the mass emailing module. + $linktoadminemailbefore=''; + $linktoadminemailend=''; + $this->error = $langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]); + $this->errors[] = $langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]); + $this->error .= '
'.$langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']); + $this->errors[] = $langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']); + if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) + { + $this->error .= '
'.$langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS); + $this->errors[] = $langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS); + } + return false; + } + // Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10; $tmparray1 = explode(',', $this->addr_to); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e7d8742a3f5..0c22b463975 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1046,7 +1046,7 @@ class Form * * @param string $selected Preselected type * @param string $htmlname Name of field in form - * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)') + * @param string $filter Optional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>] are allowed here (example: 's.rowid <> x', 's.client IN (1,3)') * @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty') * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) @@ -1080,7 +1080,7 @@ class Form unset($societetmp); } // mode 1 - $urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter.($showtype?'&showtype='.$showtype:''); + $urloption='htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).($showtype?'&showtype='.urlencode($showtype):''); $out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); $out.=''; if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : '; @@ -1138,7 +1138,7 @@ class Form // Clean $filter that may contains sql conditions so sql code if (function_exists('testSqlAndScriptInject')) { - if (testSqlAndScriptInject($filter, 3)>0) { + if (testSqlAndScriptInject($filter, 3) > 0) { $filter =''; } } @@ -5704,7 +5704,6 @@ class Form { $objectdesc=$classname.':'.$classpath; $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; - //if ($objecttmp->element == 'societe') $urlforajaxcall = DOL_URL_ROOT.'/societe/ajax/company.php'; // No immediate load of all database $urloption='htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.($moreparams?$moreparams:''); diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 6b546f5dfc3..a0dede0a895 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -141,12 +141,14 @@ class DoliDBMysqli extends DoliDB // If client is old latin, we force utf8 $clientmustbe=empty($conf->db->dolibarr_main_db_character_set)?'utf8':$conf->db->dolibarr_main_db_character_set; if (preg_match('/latin1/', $clientmustbe)) $clientmustbe='utf8'; + if (preg_match('/utf8mb4/', $clientmustbe)) $clientmustbe='utf8'; - if ($this->db->character_set_name() != $clientmustbe) { - $this->db->set_charset($clientmustbe); // This set utf8_general_ci + if ($this->db->character_set_name() != $clientmustbe) { + $this->db->set_charset($clientmustbe); // This set utf8_unicode_ci - $collation = $conf->db->dolibarr_main_db_collation; - if (preg_match('/latin1/', $collation)) $collation='utf8_unicode_ci'; + $collation = $conf->db->dolibarr_main_db_collation; + if (preg_match('/latin1/', $collation)) $collation='utf8_unicode_ci'; + if (preg_match('/utf8mb4/', $collation)) $collation='utf8_unicode_ci'; if (! preg_match('/general/', $collation)) $this->db->query("SET collation_connection = ".$collation); } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index e080cc89796..99344b12dc1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -187,11 +187,13 @@ function societe_prepare_head(Societe $object) $foundonexternalonlinesystem=0; $langs->load("banks"); - $title = $langs->trans("BankAccounts"); + //$title = $langs->trans("BankAccounts"); + $title = $langs->trans("PaymentInformation"); + if (! empty($conf->stripe->enabled)) { - $langs->load("stripe"); - $title = $langs->trans("BankAccountsAndGateways"); + //$langs->load("stripe"); + //$title = $langs->trans("BankAccountsAndGateways"); $servicestatus = 0; if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox', 'alpha')) $servicestatus = 1; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8ad47bd4444..9d0a12e3b74 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1056,7 +1056,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable // Security: // Disallow file with some extensions. We rename them. // Because if we put the documents directory into a directory inside web root (very bad), this allows to execute on demand arbitrary code. - if (preg_match('/(\.htm|\.html|\.php|\.pl|\.cgi)$/i', $dest_file) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED)) + if (isAFileWithExecutableContent($dest_file) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED)) { $file_name.= '.noexe'; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f6e530ba8de..bcd1b555906 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7955,7 +7955,6 @@ function roundUpToNextMultiple($n, $x = 5) */ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '', $params = array()) { - $attr=array( 'class'=>'badge'.(!empty($mode)?' badge-'.$mode:'').(!empty($type)?' badge-'.$type:'') ); @@ -8118,7 +8117,6 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = $attr['aria-label'] = $label; } - if(empty($userRight)){ $attr['class'] = 'butActionRefused'; $attr['href'] = ''; @@ -8156,8 +8154,6 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = return '
<'.$tag.' '.$compiledAttributes.'>'.$html.'
'; } - - /** * Function dolGetButtonTitle : this kind of buttons are used in title in list * @@ -8269,3 +8265,18 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u return $button; } + +/** + * Return if a file can contains executable content + * + * @param string $filename File NamedRange + * @return boolean True if yes, False if no + */ +function isAFileWithExecutableContent($filename) +{ + if (preg_match('/\.(htm|html|js|php|phtml|pl|py|cgi|ksh|sh|bash)$/i', $filename)) + { + return true; + } + return false; +} diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index be88c709090..a08ce2f7873 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -70,7 +70,7 @@ class modDataPolicy extends DolibarrModules { $this->descriptionlong = ""; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = 'development'; + $this->version = 'experimental'; // Key used in llx_const table to save module status enabled/disabled (where datapolicy is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); // Name of image file used for this module. diff --git a/htdocs/core/modules/modIFTTT.class.php b/htdocs/core/modules/modIFTTT.class.php deleted file mode 100644 index c3bab06ed93..00000000000 --- a/htdocs/core/modules/modIFTTT.class.php +++ /dev/null @@ -1,251 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \defgroup ifttt Module IFTTT - * \brief Descriptor file for IFTTT module - * \file htdocs/core/modules/modIFTTT.class.php - * \ingroup ifttt - * \brief Description and activation file for module IFTTT - */ -include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; - - -/** - * Description and activation class for module IFTTT - */ -class modIFTTT extends DolibarrModules -{ - /** - * Constructor. Define names, constants, directories, boxes, permissions - * - * @param DoliDB $db Database handler - */ - public function __construct($db) - { - global $langs,$conf; - - $this->db = $db; - - // Id for module (must be unique). - // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). - $this->numero = 2620; - // Key text used to identify module (for permissions, menus, etc...) - $this->rights_class = 'ifttt'; - - // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' - // It is used to group modules in module setup page - $this->family = "interface"; - // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = preg_replace('/^mod/i', '', get_class($this)); - // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) - $this->description = "IFTTT interface"; - // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version - $this->version = 'development'; - // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) - $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - // Can be enabled / disabled only in the main company with superadmin account - $this->core_enabled = 1; - // Name of image file used for this module. - // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' - // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' - $this->picto='technic'; - - $this->module_parts = array(); - - // Data directories to create when module is enabled. - // Example: this->dirs = array("/api/temp"); - $this->dirs = array(); - - // Config pages. Put here list of php page, stored into api/admin directory, to use to setup module. - $this->config_page_url = array("index.php@ifttt"); - - // Dependencies - $this->hidden = false; // A condition to hide module - $this->depends = array(); // List of modules id that must be enabled if this module is enabled - $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5,4); // Minimum version of PHP required by module - $this->langfiles = array("other"); - - // Constants - // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) - // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1), - // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1) - // ); - $this->const = array(); - - // Array to add new pages in new tabs - // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@api:$user->rights->ifttt->read:/api/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 - // 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@api:$user->rights->othermodule->read:/api/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. - // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname - // where objecttype can be - // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) - // 'contact' to add a tab in contact view - // 'contract' to add a tab in contract view - // 'group' to add a tab in group view - // 'intervention' to add a tab in intervention view - // 'invoice' to add a tab in customer invoice view - // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view - // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view - // 'order_supplier' to add a tab in supplier order view - // 'payment' to add a tab in payment view - // 'payment_supplier' to add a tab in supplier payment view - // 'product' to add a tab in product view - // 'propal' to add a tab in propal view - // 'project' to add a tab in project view - // 'stock' to add a tab in stock view - // 'thirdparty' to add a tab in third party view - // 'user' to add a tab in user view - $this->tabs = array(); - - // Dictionaries - if (! isset($conf->ifttt->enabled)) - { - $conf->ifttt=new stdClass(); - $conf->ifttt->enabled=0; - } - $this->dictionaries=array(); - - // Boxes - // Add here list of php file(s) stored in core/boxes that contains class to show a box. - $this->boxes = array(); // List of boxes - // Example: - //$this->boxes=array(array(0=>array('file'=>'myboxa.php','note'=>'','enabledbydefaulton'=>'Home'),1=>array('file'=>'myboxb.php','note'=>''),2=>array('file'=>'myboxc.php','note'=>''));); - - // Permissions - $this->rights = array(); // Permission array used by this module - $r=0; - - // Add here list of permission defined by an id, a label, a boolean and two constant strings. - // Example: - // $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) - // $this->rights[$r][1] = 'Permision label'; // Permission label - // $this->rights[$r][3] = 0; // Permission by default for new user (0/1) - // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - // $r++; - - - // Main menu entries - $this->menu = array(); // List of menus to add - $r=0; - - // Add here entries to declare new menus - // - // Example to declare a new Top Menu entry and its Left menu entry: - // $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu - // 'type'=>'top', // This is a Top menu entry - // 'titre'=>'Api top menu', - // 'mainmenu'=>'api', - // 'leftmenu'=>'api', - // 'url'=>'/api/pagetop.php', - // 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - // 'position'=>100, - // 'enabled'=>'$conf->ifttt->enabled', // Define condition to show or hide menu entry. Use '$conf->ifttt->enabled' if entry must be visible if module is enabled. - // 'perms'=>'1', // Use 'perms'=>'$user->rights->ifttt->level1->level2' if you want your menu with a permission rules - // 'target'=>'', - // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - // $r++; - // - // Example to declare a Left Menu entry into an existing Top menu entry: - // $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - // 'type'=>'left', // This is a Left menu entry - // 'titre'=>'Api left menu', - // 'mainmenu'=>'xxx', - // 'leftmenu'=>'api', - // 'url'=>'/api/pagelevel2.php', - // 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - // 'position'=>100, - // 'enabled'=>'$conf->ifttt->enabled', // Define condition to show or hide menu entry. Use '$conf->ifttt->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - // 'perms'=>'1', // Use 'perms'=>'$user->rights->ifttt->level1->level2' if you want your menu with a permission rules - // 'target'=>'', - // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - // $r++; - - - // Exports - $r=1; - - // Example: - // $this->export_code[$r]=$this->rights_class.'_'.$r; - // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) - // $this->export_enabled[$r]='1'; // Condition to show export in list (ie: '$user->id==3'). Set to 1 to always show when module is enabled. - // $this->export_permission[$r]=array(array("facture","facture","export")); - // $this->export_fields_array[$r]=array( - // 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone', - // 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode', - // 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation", - // 'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus', - // 'f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate", - // 'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart", - // 'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef' - //); - // $this->export_entities_array[$r]=array( - // 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company', - // 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company', - // 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice", - // 'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line", - // 'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line", - // 'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product' - //); - // $this->export_sql_start[$r]='SELECT DISTINCT '; - // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; - // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; - // $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; - // $this->export_sql_order[$r] .=' ORDER BY s.nom'; - // $r++; - } - - /** - * Function called when module is enabled. - * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. - * It also creates data directories - * - * @param string $options Options when enabling module ('', 'noboxes') - * @return int 1 if OK, 0 if KO - */ - public function init($options = '') - { - $sql = array(); - - $result=$this->_load_tables('/ifttt/sql/'); - - return $this->_init($sql, $options); - } - - /** - * Function called when module is disabled. - * Remove from database constants, boxes and permissions from Dolibarr database. - * Data directories are not deleted. - * - * @param string $options Options when enabling module ('', 'noboxes') - * @return int 1 if OK, 0 if KO - */ - public function remove($options = '') - { - // Remove old constants with entity fields different of 0 - $sql = array( - "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('MAIN_MODULE_IFTTT', 1), - "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('IFTTT_PRODUCTION_MODE', 1) - ); - - return $this->_remove($sql, $options); - } -} diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index fa972d38c71..7cf5f6ba5df 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -77,7 +77,7 @@ print ''."\n"; print '
'."\n"; if ($module != 'product') { // No public note yet on products - print '
'."\n"; + print '
'."\n"; print '
'."\n"; print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; @@ -87,7 +87,7 @@ if ($module != 'product') { print '
'."\n"; } if (empty($user->societe_id)) { - print '
'."\n"; + print '
'."\n"; print '
'."\n"; print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index ba41de80a72..ab737f679ca 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -122,7 +122,7 @@ llxHeader('', $langs->trans($page_name)); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans($page_name), $linkback, 'object_datapolicy@datapolicy'); +print load_fiche_titre($langs->trans($page_name), $linkback, 'object_generic'); // Configuration header $head = datapolicyAdminPrepareHead(); diff --git a/htdocs/datapolicy/img/datapolicy.png b/htdocs/datapolicy/img/datapolicy.png deleted file mode 100644 index 2681ccc1d3a..00000000000 Binary files a/htdocs/datapolicy/img/datapolicy.png and /dev/null differ diff --git a/htdocs/datapolicy/img/gfdl.png b/htdocs/datapolicy/img/gfdl.png deleted file mode 100644 index f2bacfd179a..00000000000 Binary files a/htdocs/datapolicy/img/gfdl.png and /dev/null differ diff --git a/htdocs/datapolicy/img/gplv3.png b/htdocs/datapolicy/img/gplv3.png deleted file mode 100644 index ba78d4c4941..00000000000 Binary files a/htdocs/datapolicy/img/gplv3.png and /dev/null differ diff --git a/htdocs/datapolicy/img/object_datapolicy.png b/htdocs/datapolicy/img/object_datapolicy.png deleted file mode 100644 index 5d65c309cca..00000000000 Binary files a/htdocs/datapolicy/img/object_datapolicy.png and /dev/null differ diff --git a/htdocs/datapolicy/img/object_inoveaconseil.png b/htdocs/datapolicy/img/object_inoveaconseil.png deleted file mode 100644 index 292a9c75ef2..00000000000 Binary files a/htdocs/datapolicy/img/object_inoveaconseil.png and /dev/null differ diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index cc25ea8ae7b..34c505cf849 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -64,7 +64,7 @@ print load_fiche_titre($langs->trans("StatisticsOfSendings"), $mesg); dol_mkdir($dir); -$stats = new DonationStats($db, $socid, $mode, ($userid>0?$userid:0)); +$stats = new DonationStats($db, $socid, '', ($userid>0?$userid:0)); // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); @@ -75,14 +75,10 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; } else { $filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsnbinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsnbinyear-'.$year.'.png'; } $px1 = new DolGraph(); @@ -121,14 +117,10 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filenameamount = $dir.'/shipmentsamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsamountinyear-'.$user->id.'-'.$year.'.png'; } else { $filenameamount = $dir.'/shipmentsamountinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsamountinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsamountinyear-'.$year.'.png'; } $px2 = new DolGraph(); @@ -164,14 +156,10 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filename_avg = $dir.'/shipmentsaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsaverage-'.$user->id.'-'.$year.'.png'; } else { $filename_avg = $dir.'/shipmentsaverage-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsaverage-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsaverage-'.$year.'.png'; } $px3 = new DolGraph(); @@ -214,7 +202,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear; $h=0; $head = array(); -$head[$h][0] = DOL_URL_ROOT . '/don/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT . '/don/stats/index.php'; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; @@ -233,14 +221,13 @@ print '
'; //{ // Show filter box print ''; - print ''; + print ''; + print '
'; print ''; // Company print ''; // User print ''; - print ''; + print ''; print ''; /*print ''; @@ -285,7 +272,7 @@ foreach ($data as $val) } print ''; - print ''; + print ''; print ''; /*print ''; print '';*/ diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 812d1b9eccf..84681f049c4 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -324,7 +324,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - if ($mode == 'customer') $filter='s.client in (1,2,3)'; - if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); + print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'.$langs->trans("CreatedBy").''; @@ -276,7 +263,7 @@ foreach ($data as $val) { // If we have empty year $oldyear--; print '
'.$oldyear.''.$oldyear.'00
'.$year.''.$year.''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).'
'; + print '
'; // Discounts for third party if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { @@ -549,7 +549,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print '
'; + print '
'; if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index c678c6d934d..7fb7f647258 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -63,7 +63,7 @@ print load_fiche_titre($langs->trans("StatisticsOfSendings"), $mesg); dol_mkdir($dir); -$stats = new ExpeditionStats($db, $socid, $mode, ($userid>0?$userid:0)); +$stats = new ExpeditionStats($db, $socid, '', ($userid>0?$userid:0)); // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); @@ -74,14 +74,10 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; } else { $filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsnbinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsnbinyear-'.$year.'.png'; } $px1 = new DolGraph(); @@ -120,14 +116,10 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filenameamount = $dir.'/shipmentsamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsamountinyear-'.$user->id.'-'.$year.'.png'; } else { $filenameamount = $dir.'/shipmentsamountinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsamountinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsamountinyear-'.$year.'.png'; } $px2 = new DolGraph(); @@ -163,14 +155,10 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filename_avg = $dir.'/shipmentsaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsaverage-'.$user->id.'-'.$year.'.png'; } else { $filename_avg = $dir.'/shipmentsaverage-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsaverage-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsaverage-'.$year.'.png'; } $px3 = new DolGraph(); @@ -213,7 +201,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear; $h=0; $head = array(); -$head[$h][0] = DOL_URL_ROOT . '/expedition/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT . '/expedition/stats/index.php'; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; @@ -232,15 +220,13 @@ print '
'; //{ // Show filter box print ''; - print ''; + print ''; print '
'; print ''; // Company print ''; // User print ''; - print ''; + print ''; print ''; /*print ''; @@ -289,7 +275,7 @@ foreach ($data as $val) print ''; print ''; print ''; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 2be1409bd45..d79dd624e4f 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -221,8 +221,7 @@ print ''; */ // User diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 824dfff8c84..9b0ceb754ee 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -234,7 +234,7 @@ print '
'; print '
'; // Company print ''; // User diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 98048552911..da2930ed667 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1545,7 +1545,7 @@ if ($action=='create') } else { - print $form->select_company((empty($socid)?'':$socid), 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print $form->select_company((empty($socid)?'':$socid), 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // reload page to retrieve customer informations if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) { @@ -1895,7 +1895,7 @@ elseif (! empty($object->id)) $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $form->select_company($object->thirdparty->id, 'new_socid', 's.fournisseur = 1', '', 0, 0, array(), 0, 'minwidth300'); + $morehtmlref .= $form->select_company($object->thirdparty->id, 'new_socid', 's.fournisseur=1', '', 0, 0, array(), 0, 'minwidth300'); $morehtmlref .= ''; $morehtmlref .= ''; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f7a1c800443..5ec65444746 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1741,7 +1741,7 @@ if ($action == 'create') } else { - print $form->select_company($societe->id, 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print $form->select_company($societe->id, 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // reload page to retrieve supplier informations if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index f91cbd8f1eb..233861a2f0e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -970,3 +970,4 @@ TMenuMRP=MRP ShowMoreInfos=Show More Infos NoFilesUploadedYet=Please upload a document first SeePrivateNote=See private note +PaymentInformation=Payment information diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index c3f75301f67..cc55c7ba10a 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -68,6 +68,7 @@ PageForLib=File for PHP library PageForObjLib=File for PHP library dedicated to object SqlFileExtraFields=Sql file for complementary attributes SqlFileKey=Sql file for keys +SqlFileKeyExtraFields=Sql file for keys of complementary attributes AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case UseAsciiDocFormat=You can use Markdown format, but it is recommended to use Asciidoc format (omparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown) IsAMeasure=Is a measure diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b0036b01ed4..b0d34db43eb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -91,7 +91,7 @@ function testSqlAndScriptInject($val, $type) } if ($type == 3) { - $inj += preg_match('/select|update|delete|replace|group\s+by|concat|count|from/i', $val); + $inj += preg_match('/select|update|delete|truncate|replace|group\s+by|concat|count|from|union/i', $val); } if ($type != 2) // Not common key strings, so we can check them both on GET and POST { @@ -1811,11 +1811,11 @@ function top_menu_user(User $user, Translate $langs) $btnUser = ' '; print ''; $client = true; @@ -111,8 +110,7 @@ if ($socid > 0) { else { print ''; print ''; } diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index e5024f6949f..e2ab8d964a3 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1203,9 +1203,11 @@ print load_fiche_titre($text, '', 'title_setup'); print ''.$langs->trans("ModuleBuilderDesc", 'https://wiki.dolibarr.org/index.php/Module_development#Create_your_module').'
'; $dirsrootforscan=array($dirread); -if ($dirread != DOL_DOCUMENT_ROOT && $conf->global->MAIN_FEATURES_LEVEL >=2) { $dirsrootforscan[]=DOL_DOCUMENT_ROOT; } +// Add also the core modules into the list of modules to show/edit +if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >=2 || ! empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT))) { $dirsrootforscan[]=DOL_DOCUMENT_ROOT; } // Search modules to edit +print ''."\n"; $listofmodules=array(); foreach($dirsrootforscan as $dirread) { @@ -1873,6 +1875,12 @@ elseif (! empty($module)) $realpathtopicto = dol_buildpath($pathtopicto, 0, 2); $realpathtoscript = dol_buildpath($pathtoscript, 0, 2); + if (empty($realpathtoapi)) // For compatibility with some old modules + { + $pathtoapi = strtolower($module).'/class/api_'.strtolower($module).'s.class.php'; + $realpathtoapi = dol_buildpath($pathtoapi, 0, 2); + } + print '
'; print ' '.$langs->trans("ClassFile").' : '.($realpathtoclass?'':'').$pathtoclass.($realpathtoclass?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; @@ -1962,12 +1970,27 @@ elseif (! empty($module)) print '
'; print ' '.$langs->trans("PageForAgendaTab").' : '.($realpathtoagenda?'':'').$pathtoagenda.($realpathtoagenda?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; + if ($realpathtoagenda) + { + print '   '; + print ''.img_picto($langs->trans("Delete"), 'delete').''; + } print '
'; print ' '.$langs->trans("PageForDocumentTab").' : '.($realpathtodocument?'':'').$pathtodocument.($realpathtodocument?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; + if ($realpathtodocument) + { + print '   '; + print ''.img_picto($langs->trans("Delete"), 'delete').''; + } print '
'; print ' '.$langs->trans("PageForNoteTab").' : '.($realpathtonote?'':'').$pathtonote.($realpathtonote?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; + if ($realpathtonote) + { + print '   '; + print ''.img_picto($langs->trans("Delete"), 'delete').''; + } print '
'; /* This is already on Tab CLI diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index a434833c792..fea88479abf 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -119,7 +119,7 @@ else { if (! empty($arrayofparameters)) { - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - if ($mode == 'customer') $filter='s.client in (1,2,3)'; - if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); + print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'.$langs->trans("CreatedBy").''; @@ -279,7 +265,7 @@ foreach ($data as $val) print '
'.$oldyear.''.$oldyear.'00
'; - if ($year) print ''.$year.''; + if ($year) print ''.$year.''; else print $langs->trans("ValidationDateNotDefinedEvenIfShipmentValidated"); print ''.$val['nb'].'
'.$langs->tra // Company /* print '
'.$langs->trans("ThirdParty").''; -$filter=''; -print $form->select_company($socid,'socid',$filter,1,1,0,array(),0,'','style="width: 95%"'); +print $form->select_company($socid,'socid','',1,1,0,array(),0,'','style="width: 95%"'); print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - $filter = 's.client in (1,2,3)'; + $filter = 's.client IN (1,2,3)'; print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'.$langs->trans('ThirdPartyName').''; - print $form->select_company($socid, 'socid', 'client=1 OR client=3', 1, 0, 0); - //$form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$socid,$socid,'socid','client=1 OR client=3',1,0,1); + print $form->select_company($socid, 'socid', '(client=1 OR client=3)', 1, 0, 0); print '
'.$langs->trans('ThirdPartyName').''; - print $form->select_company(null, 'socid', 'client=1 OR client=3', 1, 0, 0); - //$form->form_thirdparty($_SERVER['PHP_SELF'],null,'socid','client=1 OR client=3',1,0,1); + print $form->select_company(null, 'socid', '(client=1 OR client=3)', 1, 0, 0); print '
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 924db3b8632..b536b264952 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -196,7 +196,7 @@ if ($object->id > 0) print '
'; $object->info($object->id); - print dol_print_object_info($object, 1); + dol_print_object_info($object, 1); print ''; diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 02b7aa42315..e24c6b6d32d 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -389,7 +389,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (! empty($object->lines)) { - $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1); + // printObjectLines return void + $object->printObjectLines($action, $mysoc, $soc, $lineid, 1); } // Form to add new line diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index b2491b74b72..aefcb50369a 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -149,12 +149,12 @@ print ''; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 2efd3ab14f1..888863e5e66 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -143,7 +143,7 @@ if ($action == 'other') $value = GETPOST('activate_usesearchtoselectproduct', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_USE_SEARCH_TO_SELECT", $value, 'chaine', 0, '', $conf->entity); - + $value = GETPOST('activate_useProdFournDesc', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_FOURN_TEXTS", $value, 'chaine', 0, '', $conf->entity); if ($value) { @@ -354,7 +354,7 @@ foreach ($dirproduct as $dirroot) $disabled = false; if (! empty($conf->multicompany->enabled) && (is_object($mc) && ! empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true); print ''; diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 28b3c06ffa1..2ec5345009e 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -141,7 +141,7 @@ if ($id > 0 || $ref) print '
'; $object->info($object->id); - print dol_print_object_info($object, 1); + dol_print_object_info($object, 1); print ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 6d43e4d4a3f..dbcdec666e3 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -440,7 +440,7 @@ if ($id > 0 || $ref) { $events=array(); $events[]=array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php', 1), 'htmlname' => 'tva_tx', 'params' => array()); - print $form->select_company(GETPOST("id_fourn"), 'id_fourn', 'fournisseur=1', 'SelectThirdParty', 0, 0, $events); + print $form->select_company(GETPOST("id_fourn", 'alpha'), 'id_fourn', 'fournisseur=1', 'SelectThirdParty', 0, 0, $events); $parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$object->id); $reshook=$hookmanager->executeHooks('formCreateThirdpartyOptions', $parameters, $object, $action); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index ccde05d1e24..5b5b9ad48fa 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1666,7 +1666,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ''; print ''; print ''; print ''; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index ca4663bd43e..4e76f954717 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -405,7 +405,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -506,7 +506,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index e7e06e93352..cfacde6566b 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -264,7 +264,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear; $h=0; $head = array(); -$head[$h][0] = DOL_URL_ROOT . '/projet/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT . '/projet/stats/index.php'; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; @@ -282,9 +282,7 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $langs->trans("PaypalLiveEnabled").''; if (empty($conf->global->PAYPAL_API_SANDBOX)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print '
'; - if (! $disabled) print ''; + if (! $disabled) print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); if (! $disabled) print ''; print '
' . $langs->trans('ThirdParty') . ''; - print $form->select_company('', 'socid', 's.client in (1,2,3)', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); + print $form->select_company('', 'socid', 's.client IN (1,2,3)', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); print '
'; print ''; // Company print ''; // User /*print ''; - print ''; + print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print ''; @@ -336,7 +334,7 @@ foreach ($data_all_year as $val) } print ''; - print ''; + print ''; print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index 6a715f5030e..3cae0571e6a 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -146,9 +146,7 @@ print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; -if ($mode == 'customer') $filter='s.client in (1,2,3)'; -if ($mode == 'supplier') $filter='s.fournisseur = 1'; -print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'.$langs->trans("ProjectCommercial").''; @@ -324,7 +322,7 @@ foreach ($data_all_year as $val) $oldyear--; print '
0?'&userid='.$userid:'').'">'.$oldyear.'0?'&userid='.$userid:'').'">'.$oldyear.'0
0?'&userid='.$userid:'').'">'.$year.'0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].'
'; print ''; // Company /*print ''; */ // User diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index 94e77c3c4b5..cbffa3ef177 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -52,6 +52,7 @@ $langs->load("other"); $langs->load("companies"); + /* * View */ @@ -65,7 +66,7 @@ print load_fiche_titre($langs->trans("StatisticsOfReceptions"), $mesg); dol_mkdir($dir); -$stats = new ReceptionStats($db, $socid, $mode, ($userid>0?$userid:0)); +$stats = new ReceptionStats($db, $socid, '', ($userid>0?$userid:0)); // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); @@ -76,14 +77,10 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filenamenb = $dir.'/receptionsnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsnbinyear-'.$user->id.'-'.$year.'.png'; } else { $filenamenb = $dir.'/receptionsnbinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsnbinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsnbinyear-'.$year.'.png'; } $px1 = new DolGraph(); @@ -122,14 +119,10 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filenameamount = $dir.'/receptionsamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsamountinyear-'.$user->id.'-'.$year.'.png'; } else { $filenameamount = $dir.'/receptionsamountinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsamountinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsamountinyear-'.$year.'.png'; } $px2 = new DolGraph(); @@ -165,14 +158,10 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filename_avg = $dir.'/receptionsaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsaverage-'.$user->id.'-'.$year.'.png'; } else { $filename_avg = $dir.'/receptionsaverage-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsaverage-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsaverage-'.$year.'.png'; } $px3 = new DolGraph(); @@ -215,7 +204,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear; $h=0; $head = array(); -$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php'; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; @@ -234,15 +223,13 @@ print '
'; //{ // Show filter box print '
'; - print ''; + print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; -if ($mode == 'customer') $filter='s.client in (1,2,3)'; -if ($mode == 'supplier') $filter='s.fournisseur = 1'; -print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); +print $form->select_company($socid,'socid','',1,0,0,array(),0,'','style="width: 95%"'); print '
'; print ''; // Company print ''; // User print ''; - print ''; + print ''; print ''; /*print ''; @@ -289,7 +276,7 @@ foreach ($data as $val) print ''; print ''; print ''; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 4a614c02312..d07ddfc2b4f 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -404,7 +404,7 @@ foreach ($dirsociete as $dirroot) $disabled = false; if (! empty($conf->multicompany->enabled) && (is_object($mc) && ! empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true); print ''; @@ -478,7 +478,7 @@ foreach ($dirsociete as $dirroot) } else { - print ''; } @@ -813,12 +813,12 @@ print ''; print ''; @@ -830,12 +830,12 @@ print ''; print ''; @@ -849,12 +849,12 @@ print ''; print ''; @@ -867,12 +867,12 @@ print ''; print ''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 2bf407ec88d..a9283f6e236 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -127,7 +127,7 @@ if ($socid > 0) print '
'; $object->info($socid); - print dol_print_object_info($object, 1); + dol_print_object_info($object, 1); print ''; diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index 4323a4c57ac..acf10428717 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -81,7 +81,7 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn')) if (! empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) $sql.=" OR rowid = '" . $db->escape($socid) . "'"; $sql.=")"; } - if (GETPOST("filter")) $sql.= " AND ".GETPOST("filter", "alpha"); // Add other filters + //if (GETPOST("filter")) $sql.= " AND (".GETPOST("filter", "alpha").")"; // Add other filters $sql.= " ORDER BY nom ASC"; //dol_syslog("ajaxcompanies", LOG_DEBUG); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 0cf2ae21790..af134dcd354 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2213,7 +2213,7 @@ else 'name' => 'soc_origin', 'label' => $langs->trans('MergeOriginThirdparty'), 'type' => 'other', - 'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 'SelectThirdParty', 0, 0, array(), 0, 'minwidth200') + 'value' => $form->select_company('', 'soc_origin', 's.rowid <> '.$object->id, 'SelectThirdParty', 0, 0, array(), 0, 'minwidth200') ) ); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index d158fb49698..afd3a51ec8e 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -114,7 +114,7 @@ dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'n print '
'; print '
'; -print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - if ($mode == 'customer') $filter='s.client in (1,2,3)'; - if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); + print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'.$langs->trans("CreatedBy").''; @@ -279,7 +266,7 @@ foreach ($data as $val) print '
'.$oldyear.''.$oldyear.'00
'; - if ($year) print ''.$year.''; + if ($year) print ''.$year.''; else print $langs->trans("ValidationDateNotDefinedEvenIfReceptionValidated"); print ''.$val['nb'].''; - if (! $disabled) print ''; + if (! $disabled) print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); if (! $disabled) print ''; print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ' '; if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ' '; if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ' '; if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ' '; if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print '
'; +print '
'; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index 08783fa16ad..0a345fc6369 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -87,7 +87,7 @@ if ($socid) print '
'; print '
'; - print '
'; + print '
'; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 2bc257e1f77..3966a3f439f 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -225,12 +225,12 @@ if (empty($conf->stripeconnect->enabled)) $endpoint->save(); if ($endpoint->status == 'enabled') { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } //print $endpoint; @@ -298,12 +298,12 @@ if (empty($conf->stripeconnect->enabled)) $endpoint->save(); if ($endpoint->status == 'enabled') { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } //print $endpoint; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index f52a846f4c2..56473959a39 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1083,7 +1083,7 @@ if ($action == 'create') print ''; } else { print ''; } diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index b685d9e97d2..f331587723b 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -64,21 +64,6 @@ if (GETPOST('action', 'alpha') == 'set') $db->begin(); if (GETPOST('socid', 'int') < 0) $_POST["socid"]=''; - /* - $res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY", (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity); - - $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH", (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') : ''), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE", (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') : ''), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB", (GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') : ''), 'chaine', 0, '', $conf->entity); - foreach($paiements as $modep) { - if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; - $name="CASHDESK_ID_BANKACCOUNT_".$modep->code; - $res = dolibarr_set_const($db, $name, (GETPOST($name, 'alpha') > 0 ? GETPOST($name, 'alpha') : ''), 'chaine', 0, '', $conf->entity); - } - $res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE", (GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", GETPOST('CASHDESK_NO_DECREASE_STOCK', 'alpha'), 'chaine', 0, '', $conf->entity); - */ - $res = dolibarr_set_const($db, "CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ROOT_CATEGORY_ID", GETPOST('TAKEPOS_ROOT_CATEGORY_ID', 'alpha'), 'chaine', 0, '', $conf->entity); @@ -270,82 +255,6 @@ print '
'; - print $form->select_company('', 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print $form->select_company('', 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); print ' '.$langs->trans("AddThirdParty").''; print '
'; print '
'; -/* -print ''; -print ''; -if (!$conf->global->TAKEPOS_NUM_TERMINALS || $conf->global->TAKEPOS_NUM_TERMINALS=="1") print ''; -else print ''; -print "\n"; - -print ''; -print ''; -if (! empty($conf->banque->enabled)) -{ - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - foreach($paiements as $modep) { - if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; - $name="CASHDESK_ID_BANKACCOUNT_".$modep->code; - print ''; - print ''; - } -} - -if (! empty($conf->stock->enabled)) -{ - - print ''; // Force warehouse (this is not a default value) - print ''; - - $disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK; - - - print ''; // Force warehouse (this is not a default value) - print ''; -} - -print '
'.$langs->trans("Parameters").''.$langs->trans("Value").''.$langs->trans("Terminal").' 1'.$langs->trans("Value").'
'.$langs->trans("CashDeskThirdPartyForSell").''; -print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1, 3) AND s.status = 1', 1, 0, 0, array(), 0); -print '
'.$langs->trans("CashDeskBankAccountForSell").''; - $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH, 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", 1); - print '
'.$langs->trans("CashDeskBankAccountForCheque").''; - $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE, 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", 1); - print '
'.$langs->trans("CashDeskBankAccountForCB").''; - $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB, 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", 1); - print '
'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).''; - $cour=preg_match('|^LIQ.*|', $modep->code)?2:1; - $form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1); - print '
'.$langs->trans("CashDeskDoNotDecreaseStock").''; - if (empty($conf->productbatch->enabled)) { - print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK', $conf->global->CASHDESK_NO_DECREASE_STOCK, 1); - } - else - { - if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) { - $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", 1, 'chaine', 0, '', $conf->entity); - } - print $langs->trans("Yes").'
'; - print ''.$langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch').''; - } - print '
'.$langs->trans("CashDeskIdWareHouse").''; - if (! $disabled) - { - print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE, 'CASHDESK_ID_WAREHOUSE', '', 1, $disabled); - print ' ('.$langs->trans("Create").')'; - } - else - { - print ''.$langs->trans("StockDecreaseForPointOfSaleDisabled").''; - } - print '
'; -print '
'; -*/ - print '
'; print "\n"; diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 66a8a90f528..2b29f46120d 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -127,7 +127,7 @@ print "
'.$langs->trans("CashDeskThirdPartyForSell").''; -print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', 's.client in (1, 3) AND s.status = 1', 1, 0, 0, array(), 0); +print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0); print '