Clean module
This commit is contained in:
parent
04114a5e1e
commit
ecc338b1eb
@ -85,7 +85,7 @@ if ($action == 'add_currency')
|
|||||||
|
|
||||||
if ($currency->create($user) > 0)
|
if ($currency->create($user) > 0)
|
||||||
{
|
{
|
||||||
if ($currency->addRate($rate)) setEventMessages($langs->trans('SuccessAddRate'), array());
|
if ($currency->addRate($rate)) setEventMessages($langs->trans('RecordSaved'), array());
|
||||||
else setEventMessages($langs->trans('ErrorAddRateFail'), array(), 'errors');
|
else setEventMessages($langs->trans('ErrorAddRateFail'), array(), 'errors');
|
||||||
}
|
}
|
||||||
else setEventMessages($langs->trans('ErrorAddCurrencyFail'), array());
|
else setEventMessages($langs->trans('ErrorAddCurrencyFail'), array());
|
||||||
@ -112,7 +112,7 @@ elseif ($action == 'update_currency')
|
|||||||
|
|
||||||
if ($currency->fetch($fk_multicurrency) > 0)
|
if ($currency->fetch($fk_multicurrency) > 0)
|
||||||
{
|
{
|
||||||
if ($currency->delete() > 0) setEventMessages($langs->trans('SuccessDeleteCurrency'), array());
|
if ($currency->delete() > 0) setEventMessages($langs->trans('RecordDeleted'), array());
|
||||||
else setEventMessages($langs->trans('ErrorDeleteCurrencyFail'), array(), 'errors');
|
else setEventMessages($langs->trans('ErrorDeleteCurrencyFail'), array(), 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,10 +131,13 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
$page_name = "multicurrency";
|
|
||||||
|
$page_name = "MultiCurrency";
|
||||||
|
|
||||||
llxHeader('', $langs->trans($page_name));
|
llxHeader('', $langs->trans($page_name));
|
||||||
|
|
||||||
// Subheader
|
// Subheader
|
||||||
@ -147,7 +150,7 @@ $head = multicurrencyAdminPrepareHead();
|
|||||||
dol_fiche_head(
|
dol_fiche_head(
|
||||||
$head,
|
$head,
|
||||||
'settings',
|
'settings',
|
||||||
$langs->trans("Module500000Name"),
|
$langs->trans("ModuleSetup"),
|
||||||
0,
|
0,
|
||||||
"multicurrency"
|
"multicurrency"
|
||||||
);
|
);
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class modMultiCurrency extends DolibarrModules
|
|||||||
|
|
||||||
// Id for module (must be unique).
|
// Id for module (must be unique).
|
||||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||||
$this->numero = 500000; // TODO Go on page http://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module
|
$this->numero = 40000;
|
||||||
// Key text used to identify module (for permissions, menus, etc...)
|
// Key text used to identify module (for permissions, menus, etc...)
|
||||||
$this->rights_class = 'multicurrency';
|
$this->rights_class = 'multicurrency';
|
||||||
|
|
||||||
@ -54,14 +54,12 @@ class modMultiCurrency extends DolibarrModules
|
|||||||
// It is used to group modules in module setup page
|
// It is used to group modules in module setup page
|
||||||
$this->family = "financial";
|
$this->family = "financial";
|
||||||
// Module position in the family
|
// Module position in the family
|
||||||
$this->module_position = 500;
|
$this->module_position = 555;
|
||||||
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
|
||||||
$this->familyinfo = array('financial' => array('position'=>'009', 'label'=>$langs->trans("ModuleFamilyFinancial")));
|
|
||||||
|
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// 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));
|
$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)
|
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->description = "Description of module MyModule";
|
$this->description = "Module to enter elements with a foreign currency";
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
||||||
$this->version = 'development';
|
$this->version = 'development';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user