Fix missing test of action when using canvas

This commit is contained in:
Laurent Destailleur 2015-02-16 02:02:11 +01:00
parent 2045fb22e9
commit 3cf4b80baa
2 changed files with 4 additions and 4 deletions

View File

@ -114,7 +114,7 @@ class modMyModule extends DolibarrModules
// Array to add new pages in new tabs // Array to add new pages in new tabs
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2 // 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/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 // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
// where objecttype can be // 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) // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)

View File

@ -67,7 +67,7 @@ class Canvas
$newaction = $action; $newaction = $action;
if ($newaction == 'add') $newaction='create'; if ($newaction == 'add') $newaction='create';
if ($newaction == 'update') $newaction='edit'; if ($newaction == 'update') $newaction='edit';
if (empty($newaction) || $newaction == 'delete' || $newaction == 'create_user') $newaction='view'; if (empty($newaction) || $newaction == 'delete' || $newaction == 'create_user' || $newaction == 'presend' || $newaction == 'send') $newaction='view';
return $newaction; return $newaction;
} }