diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index dc451855c0a..cf0fa1cd697 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -64,9 +64,7 @@ class Categorie extends CommonObject /** - * @var array ID mapping from type string - * - * @note This array should be removed in future, once previous constants are moved to the string value. Deprecated + * @var array Table of mapping between type string and ID used for field 'type' in table llx_categories */ protected $MAP_ID = array( 'product' => 0, @@ -79,7 +77,8 @@ class Categorie extends CommonObject 'user' => 7, 'bank_line' => 8, 'warehouse' => 9, - 'actioncomm' => 10 + 'actioncomm' => 10, + 'website_page' => 11 ); /** @@ -1113,6 +1112,10 @@ class Categorie extends CommonObject global $conf, $langs; if (!is_numeric($type)) $type = $this->MAP_ID[$type]; + if (is_null($type)) { + $this->error = 'BadValueForParameterType'; + return -1; + } if (is_string($markafterid)) { diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index b36101750f2..db6f5a2eec4 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -54,6 +54,7 @@ $typetext = $type; if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea'); elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea'); elseif ($type == Categorie::TYPE_ACTIONCOMM) $title = $langs->trans('ActionCommCategoriesArea'); +elseif ($type == Categorie::TYPE_WEBSITE_PAGE) $title = $langs->trans('WebsitePagesCategoriesArea'); else $title = $langs->trans(ucfirst($type).'sCategoriesArea'); $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); @@ -69,8 +70,6 @@ if (!empty($user->rights->categorie->creer)) { print load_fiche_titre($title, $newcardbutton, 'object_category'); -//print ''; -//print ''; print ''; print ''; -/* -// faire une rech dans une sous categorie uniquement -print ''; -print ''; -*/ - print '
'; print '
'; @@ -88,20 +87,9 @@ print '
'.$langs->trans("Search").'
'; print $langs->trans("Name").':
'; -print $langs->trans("SubCatOf").':'; - -print $form->select_all_categories('','subcatof'); -print '
'; -//print ''; print '
'; @@ -138,7 +126,6 @@ if ($catname || $id > 0) else print ' '; -//print ''; print '
'; print '

'; diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 30bace0574c..9bb71984ecf 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -86,4 +86,5 @@ ByDefaultInList=By default in list ChooseCategory=Choose category StocksCategoriesArea=Warehouses Categories Area ActionCommCategoriesArea=Events Categories Area +WebsitePagesCategoriesArea=Page-Container Categories Area UseOrOperatorForCategories=Use or operator for categories