Migliorato supporto per extra modules.
Ora i programmi di CA, se si possiede il module CM, mostrano nel titolo "Gestione Commesse" invece di "Contabilità analitica" git-svn-id: svn://10.65.10.50/branches/R_10_00@22694 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
081be4b720
commit
59d2c2c657
@ -334,7 +334,7 @@ const char* TApplication::get_module_name() const
|
||||
module = d.module_code2desc(aut);
|
||||
bool ok = module.full();
|
||||
if (ok && aut > 0 && check_autorization())
|
||||
ok = dongle().login(modname);
|
||||
ok = has_module(aut) && dongle().login(modname);
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
@ -344,8 +344,19 @@ const char* TApplication::get_module_name() const
|
||||
if (!em.empty_items())
|
||||
{
|
||||
ok = em == "*";
|
||||
FOR_EACH_TOKEN(em, cod) if (!ok)
|
||||
ok = dongle().login(cod);
|
||||
if (!ok)
|
||||
{
|
||||
FOR_EACH_TOKEN(em, cod)
|
||||
{
|
||||
const word codice = d.module_name2code(cod);
|
||||
ok = has_module(codice) && dongle().login(cod);
|
||||
if (ok)
|
||||
{
|
||||
module = d.module_code2desc(codice);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ok)
|
||||
{
|
||||
|
@ -1178,7 +1178,7 @@ int Tdninst::test_cmdline(const TString& cmdline, bool key_must_exist, TString&
|
||||
const long serno = don.number();
|
||||
if (serno == 0)
|
||||
{
|
||||
if (is_power_reseller(true))
|
||||
if (is_power_station())
|
||||
return 0; // Solo chiavi per uso interno aga
|
||||
msg = TR("Chiave di sviluppo non autorizzata");
|
||||
return 1;
|
||||
|
@ -801,23 +801,6 @@ const char* TBaseisamfile::module() const
|
||||
curr().get_relapp(app);
|
||||
if (app.full())
|
||||
return app.left(2);
|
||||
|
||||
switch (num())
|
||||
{
|
||||
case LF_CLIFO:
|
||||
case LF_CAUSALI:
|
||||
case LF_RCAUSALI:
|
||||
case LF_MOV:
|
||||
case LF_RMOV:
|
||||
case LF_RMOVIVA:
|
||||
return "cg";
|
||||
case LF_ANAMAG:
|
||||
case LF_DOC:
|
||||
case LF_RIGHEDOC:
|
||||
return "ve";
|
||||
default: break;
|
||||
}
|
||||
|
||||
return "ba";
|
||||
}
|
||||
|
||||
|
@ -1432,7 +1432,7 @@ bool TPrint_application::print_one (
|
||||
_PrintfRef *pr = (_PrintfRef *) t;
|
||||
TString ps;
|
||||
TParagraph_string * para_str = NULL;
|
||||
bool islong = (pr->_fmt).find ('l') != -1;
|
||||
const bool islong = (pr->_fmt).find ('l') >= 0;
|
||||
switch (pr->_type)
|
||||
{
|
||||
case 'd':
|
||||
@ -1450,7 +1450,7 @@ bool TPrint_application::print_one (
|
||||
*((float *) (pr->_what)));
|
||||
break;
|
||||
case 'c':
|
||||
ps.format (pr->_fmt, *((char *) (pr->_what)));
|
||||
ps.format (pr->_fmt, *((const char*) (pr->_what)));
|
||||
break;
|
||||
case 's':
|
||||
ps.format (pr->_fmt, (char *) (pr->_what));
|
||||
|
@ -211,25 +211,17 @@ int list_files(
|
||||
|
||||
bool input_filename(TFilename& file)
|
||||
{
|
||||
DIRECTORY dir;
|
||||
FILE_SPEC fs;
|
||||
DIRECTORY dir; xvt_fsys_get_dir(&dir);
|
||||
|
||||
xvt_fsys_get_dir(&dir);
|
||||
xvt_fsys_get_dir(&fs.dir);
|
||||
strcpy(fs.type, file.ext());
|
||||
strcpy(fs.name, file);
|
||||
strcpy(fs.creator, "AGA");
|
||||
|
||||
FILE_SPEC fs;
|
||||
xvt_fsys_convert_str_to_fspec(file, &fs);
|
||||
const bool good = xvt_dm_post_file_open(&fs, TR("Selezionare il file")) == FL_OK;
|
||||
|
||||
xvt_fsys_set_dir(&dir);
|
||||
|
||||
|
||||
if (good)
|
||||
{
|
||||
char buf[_MAX_PATH];
|
||||
xvt_fsys_convert_dir_to_str(&fs.dir, buf, sizeof(buf));
|
||||
file = buf;
|
||||
file.add(fs.name);
|
||||
}
|
||||
xvt_fsys_convert_fspec_to_str(&fs, file.get_buffer(), file.size());
|
||||
|
||||
return good;
|
||||
}
|
||||
|
||||
@ -551,7 +543,7 @@ istream & eatwhite(istream & i)
|
||||
|
||||
const TString& get_hostname()
|
||||
{
|
||||
TString& tmp = get_tmp_string(80);
|
||||
TString& tmp = get_tmp_string(50);
|
||||
xvt_sys_get_host_name(tmp.get_buffer(), tmp.size());
|
||||
return tmp;
|
||||
}
|
||||
@ -565,7 +557,7 @@ long daytime()
|
||||
// DON'T cache this bool because hostname can be local or server
|
||||
static bool is_aga_station(const char* hostname)
|
||||
{
|
||||
const char* const ranger[] = { "BATMOBILE", "KIRK", "MOBILE", "PCTRUFFELLI", "SPOCK", NULL };
|
||||
const char* const ranger[] = { "BATMOBILE", "KIRK", "KLINGON", "MOBILE", "PCTRUFFELLI", "SPOCK", NULL };
|
||||
for (int i = 0; ranger[i]; i++)
|
||||
if (xvt_str_compare_ignoring_case(hostname, ranger[i]) == 0)
|
||||
return true;
|
||||
@ -578,7 +570,8 @@ bool is_power_station()
|
||||
if (ps < 0)
|
||||
{
|
||||
const TDongle& d = dongle();
|
||||
if ((d.local() && (d.number() == 0 || d.number()==1045)) || (d.network() && is_aga_station(d.server_name())))
|
||||
if ((d.local() && (d.number() == 0 || d.number()==1045)) ||
|
||||
(d.network() && is_aga_station(d.server_name())))
|
||||
ps = is_aga_station(get_hostname());
|
||||
else
|
||||
ps = FALSE;
|
||||
@ -588,10 +581,9 @@ bool is_power_station()
|
||||
|
||||
bool is_power_reseller(bool power_user_only)
|
||||
{
|
||||
bool yes = xvt_sys_get_oem_int("OEM", -1) == 0;
|
||||
if (yes && power_user_only)
|
||||
yes = is_power_station();
|
||||
return yes;
|
||||
if (power_user_only && !is_power_station())
|
||||
return false;
|
||||
return xvt_sys_get_oem_int("OEM", 1) == 0;
|
||||
}
|
||||
|
||||
bool expand_sys_vars(TString& str)
|
||||
|
Loading…
x
Reference in New Issue
Block a user