NEW: Move Expense report menu from module to menu files

This commit is contained in:
aspangaro
2016-03-20 07:34:48 +01:00
parent 8689240b7f
commit 57ebb7c997
3 changed files with 18 additions and 109 deletions

View File

@@ -212,113 +212,6 @@ class modExpenseReport extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON ed.fk_projet = p.rowid';
$this->export_sql_end[$r] .=' WHERE ed.fk_expensereport = d.rowid AND d.fk_user_author = u.rowid';
$this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('expensereport',1).')';
// Main menu entries
$this->menu = array(); // List of menus to add
$r=0;
// Example to declare a Left Menu entry: fk_mainmenu=home,fk_leftmenu=admintools
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry
'titre'=>'TripsAndExpenses',
'mainmenu'=>'hrm',
'leftmenu'=>'expensereport',
'url'=>'/expensereport/index.php',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->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++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry
'titre'=>'New',
'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detailnew',
'url'=>'/expensereport/card.php?action=create',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->expensereport->creer', // Use 'perms'=>'$user->rights->mymodule->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++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry
'titre'=>'List',
'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detaillist',
'url'=>'/expensereport/list.php',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->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++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport_detaillist', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry
'titre'=>'ListToApprove',
'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detaillist_approve',
'url'=>'/expensereport/list.php?search_status=2',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->expensereport->approve', // Use 'perms'=>'$user->rights->mymodule->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++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry
'titre'=>'Statistics',
'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detail',
'url'=>'/expensereport/stats/index.php',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->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++;
// Disabled, not yet stable
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry
'titre'=>'ExportTripCSV',
'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detail',
'url'=>'/expensereport/export_csv.php',
'langs'=>'expensereport', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->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++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry
'titre'=>'Synchro_Compta',
'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detail',
'url'=>'/expensereport/synchro_compta.php',
'langs'=>'expensereport', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->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++;
}
/**