diff --git a/ChangeLog b/ChangeLog index b67064c7fc3..a248962124c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,9 +19,9 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup. * API /setup/shipment_methods has been replaced with API /setup/shipping_methods -* Field "total" renamed into to "total_ht" in llx_facture, llx_facture_rec for better field name consistency -* Field "tva" renamed into to "total_tva" in llx_facture, llx_facture_rec, llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency -* Field "total" renamed into "total_ttc" in llx_propal, llx_supplier_proposal for better field name consistency +* Field "total" renamed into to "total_ht" for table llx_facture, llx_facture_rec for better field name consistency +* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency +* Field "total" renamed into "total_ttc" for table lx_propal, llx_supplier_proposal for better field name consistency * If your database is PostgreSql, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT) * If your database is MySql or MariaDB, you need at least version 5.1 diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index b040e4cec99..1c12b6c9f45 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -286,6 +286,7 @@ class modBom extends DolibarrModules $langs->load("mrp"); $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'BomAndBomLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_permission[$r] = array(array("bom", "read")); $this->export_icon[$r] = 'bom'; $keyforclass = 'BOM'; $keyforclassfile = '/bom/class/bom.class.php'; diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index f16a29728be..1d53ee4e15a 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -109,6 +109,12 @@ class modWebsite extends DolibarrModules $this->rights[$r][4] = 'delete'; $r++; + $this->rights[$r][0] = 10008; + $this->rights[$r][1] = 'Export website content'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'export'; + $r++; + // Main menu entries $r = 0; $this->menu[$r] = array('fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode @@ -130,6 +136,7 @@ class modWebsite extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'MyWebsitePages'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_permission[$r] = array(array("website", "export")); $this->export_icon[$r] = 'globe'; $keyforclass = 'WebsitePage'; $keyforclassfile = '/website/class/websitepage.class.php'; diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index dc23a8ab362..b3d0cf49a32 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -154,6 +154,9 @@ $upload_dir = $conf->export->dir_temp.'/'.$user->id; //$usefilters=($conf->global->MAIN_FEATURES_LEVEL > 1); $usefilters = 1; +// Security check +$result = restrictedArea($user, 'export'); + /* * Actions @@ -449,7 +452,7 @@ if ($step == 1 || !$datatoexport) { if ($objexport->array_export_perms[$key]) { print ''.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15x"').''; } else { - print $langs->trans("NotEnoughPermissions"); + print ''.$langs->trans("NotEnoughPermissions").''; } print ''; } diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index 22b1729550d..3ba5e0a3591 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -27,11 +27,12 @@ require_once DOL_DOCUMENT_ROOT.'/exports/class/export.class.php'; // Load translation files required by the page $langs->load("exports"); +$export = new Export($db); +$export->load_arrays($user); + // Security check $result = restrictedArea($user, 'export'); -$export = new Export($db); -$export->load_arrays($user); /* * View diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 74b7e70e582..f6a0c731e14 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -32,6 +32,8 @@ $langs->load("users"); // Security check $id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + $object = new User($db); if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref, '', 1); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index fa2cf5a5d41..228bbd7882e 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -32,9 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php'; // Load translation files required by page -$langs->loadLangs(array('companies', 'mails', 'admin', 'other')); +$langs->loadLangs(array('companies', 'mails', 'admin', 'other', 'errors')); $id = GETPOST("id", 'int'); +$ref = GETPOST('ref', 'alpha'); + $action = GETPOST('action', 'aZ09'); $actionid = GETPOST('actionid'); @@ -63,11 +65,24 @@ $pagenext = $page + 1; $now = dol_now(); +// Security check +$object = new User($db); +if ($id > 0 || !empty($ref)) { + $result = $object->fetch($id, $ref, '', 1); + $object->getrights(); +} + +$permissiontoadd = (($object->id == $user->id) || (!empty($user->rights->user->user->lire))); + /* * Actions */ +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; +} + // Add a notification if ($action == 'add') { $error = 0; @@ -75,6 +90,7 @@ if ($action == 'add') { if ($actionid <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors'); $error++; + $action = 'create'; } if (!$error) { @@ -98,6 +114,7 @@ if ($action == 'add') { $db->commit(); } else { $db->rollback(); + $action = 'create'; } } } @@ -185,7 +202,7 @@ if ($result > 0) { // Add notification form - print load_fiche_titre($langs->trans("AddNewNotification"), '', ''); + // print load_fiche_titre($langs->trans("AddNewNotification"), '', ''); print '