Esempio n. 1
0
    $object->label = GETPOST('label');
    $object->command = GETPOST('command');
    $object->classesname = GETPOST('classesname', 'alpha');
    $object->priority = GETPOST('priority', 'int');
    $object->objectname = GETPOST('objectname', 'alpha');
    $object->methodename = GETPOST('methodename', 'alpha');
    $object->params = GETPOST('params');
    $object->md5params = GETPOST('md5params');
    $object->module_name = GETPOST('module_name', 'alpha');
    $object->note = GETPOST('note');
    $object->datestart = dol_mktime(GETPOST('datestarthour', 'int'), GETPOST('datestartmin', 'int'), 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int'));
    $object->dateend = dol_mktime(GETPOST('dateendhour', 'int'), GETPOST('dateendmin', 'int'), 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int'));
    $object->unitfrequency = GETPOST('unitfrequency', 'int');
    $object->frequency = $object->unitfrequency * GETPOST('nbfrequency', 'int');
    // Add cron task
    $result = $object->update($user);
    // test du Resultat de la requete
    if ($result < 0) {
        setEventMessage($object->error, 'errors');
        $action = 'edit';
    } else {
        setEventMessage($langs->trans('CronSaveSucess'), 'mesgs');
        $action = '';
    }
}
if ($action == 'activate') {
    $object->status = 1;
    // Add cron task
    $result = $object->update($user);
    // test du Resultat de la requete
    if ($result < 0) {