eduTrac SIS Support Center
  • Support
    • Forums
    • Issues
  • Services
    • Support
    • Enterprise
  • News
  • Resources
  • Subscription

Community Forums

KnowledgeBase/Forums/Development/Alpha / Beta / Release Candidate/Can't create staff record

Can't create staff record

6.3.0-RC3
  • 5 years, 7 months ago Teja Majety
    Moderator
    • Topics: 38
    • Replies: 204
    • Total Posts: 242

    I think the problem could be with function in external services, the “enrol_manual_unenrol_users” function doesn’t exist in my installed version of Moodle. It exists from version 3.0. https://docs.moodle.org/dev/Web_service_API_functions#Core_web_service_functions

    5 years, 7 months ago Joshua Parker
    Keymaster
    • Topics: 5
    • Replies: 638
    • Total Posts: 643

    With regards to Moodle, the only thing that could be an issue is the condition check. Open the moodle.class.php file.

    Change this:

    _h(get_option('moodle_unenroll_student')) === null

    to this:

    _h(get_option('moodle_unenroll_student')) == ''

    If that still doesn’t work, then double check to make sure that the enrol_manual_unenrol_users function exists in External Services in Moodle: Home > Site administration > Plugins > Web services > External services

    Joshua Parker
    Twitter | Facebook | DigitalOcean | tinyCampaign

    5 years, 7 months ago Joshua Parker
    Keymaster
    • Topics: 5
    • Replies: 638
    • Total Posts: 643

    The css on the field has been fixed in RC4 which will be released later today. I will take a look at the Moodle issue.

    Joshua Parker
    Twitter | Facebook | DigitalOcean | tinyCampaign

    5 years, 7 months ago Teja Majety
    Moderator
    • Topics: 38
    • Replies: 204
    • Total Posts: 242

    The staff record is fine and working good.

    As I am testing out few other things like students records and enrolments, I came across that after the application is accepted, in the student record screen, the field to select the start date, that date selection field has a kind of glitch I think.

    and the Moodle plugin is working really good except that after withdrawing the student from course section it should automatically unenroll from Moodle as well, as I have selected “Yes” in Moodle plugin. I think that’s kind of not sure, I tried with a test student everything worked very well except for that part. Am I missing something there?

    I think that’s kind of not sure, I tried with a test student everything worked very well except for that part. Am I missing something there?

     

    Attachments:
    You must be logged in to view attached files.
    5 years, 7 months ago Joshua Parker
    Keymaster
    • Topics: 5
    • Replies: 638
    • Total Posts: 643

    With regards to creating new staff records, do the following.

    Open app/views/staff/add.php and change this:

    <?php table_dropdown('job',null,'ID','ID','title'); ?>

    to this:

    <?php table_dropdown('job',null,'id','id','title'); ?>

    In the same file, change all of these:

    $person[0]

    to this (i.e. $person[0][‘personID’] will become $person[‘personID’]):

    $person

     

    Open app/router/staff.router.php and replace the add route with the one below:

        $app->match('GET|POST', '/add/(\d+)/', function ($id) use($app) {
    
            $get_person = get_person($id);
            $get_staff = get_staff($id);
    
            if ($app->req->isPost()) {
                try {
                    $staff = $app->db->staff();
                    $staff->staffID = $id;
                    $staff->schoolCode = $app->req->post['schoolCode'];
                    $staff->buildingCode = $app->req->post['buildingCode'];
                    $staff->officeCode = $app->req->post['officeCode'];
                    $staff->office_phone = $app->req->post['office_phone'];
                    $staff->deptCode = $app->req->post['deptCode'];
                    $staff->status = $app->req->post['status'];
                    $staff->addDate = Jenssegers\Date\Date::now();
                    $staff->approvedBy = get_persondata('personID');
                    /**
                     * Fires during the saving/creating of a staff record.
                     *
                     * @since 6.1.12
                     * @param array $staff Staff object.
                     */
                    $app->hook->do_action('save_staff_db_table', $staff);
                    $staff->save();
    
                    $meta = $app->db->staff_meta();
                    $meta->jobStatusCode = $app->req->post['jobStatusCode'];
                    $meta->jobID = $app->req->post['jobID'];
                    $meta->staffID = $id;
                    $meta->supervisorID = $app->req->post['supervisorID'];
                    $meta->staffType = $app->req->post['staffType'];
                    $meta->hireDate = $app->req->post['hireDate'];
                    $meta->startDate = $app->req->post['startDate'];
                    $meta->endDate = ($app->req->post['endDate'] != '' ? $app->req->post['endDate'] : NULL);
                    $meta->addDate = Jenssegers\Date\Date::now();
                    $meta->approvedBy = get_persondata('personID');
                    /**
                     * Fires during the saving/creating of staff
                     * meta data.
                     *
                     * @since 6.1.12
                     * @param array $meta Staff meta object.
                     */
                    $app->hook->do_action('save_staff_meta_db_table', $meta);
                    $meta->save();
                    /**
                     * Is triggered after staff record has been created.
                     * 
                     * @since 6.1.12
                     * @param mixed $staff Staff data object.
                     */
                    $app->hook->do_action('post_save_staff', $staff);
    
                    /**
                     * Is triggered after staff meta data is saved.
                     * 
                     * @since 6.1.12
                     * @param mixed $staff Staff meta data object.
                     */
                    $app->hook->do_action('post_save_staff_meta', $meta);
                    etsis_logger_activity_log_write('New Record', 'Staff Member', get_name($id), get_persondata('uname'));
                    _etsis_flash()->success(_etsis_flash()->notice(200), get_base_url() . 'staff' . '/' . $id . '/');
                } catch (NotFoundException $e) {
                    Cascade::getLogger('error')->error($e->getMessage());
                    _etsis_flash()->error(_etsis_flash()->notice(409));
                } catch (ORMException $e) {
                    Cascade::getLogger('error')->error($e->getMessage());
                    _etsis_flash()->error(_etsis_flash()->notice(409));
                } catch (Exception $e) {
                    Cascade::getLogger('error')->error($e->getMessage());
                    _etsis_flash()->error(_etsis_flash()->notice(409));
                }
            }
    
            /**
             * If the database table doesn't exist, then it
             * is false and a 404 should be sent.
             */
            if ($get_person == false) {
    
                $app->view->display('error/404', ['title' => '404 Error']);
            }
            /**
             * If the query is legit, but there
             * is no data in the table, then 404
             * will be shown.
             */ elseif (empty($get_person) == true) {
    
                $app->view->display('error/404', ['title' => '404 Error']);
            }
            /**
             * If data is zero, 404 not found.
             */ elseif (_h($get_person->personID) <= 0) {
    
                $app->view->display('error/404', ['title' => '404 Error']);
            }
            /**
             * If staffID already exists, then redirect
             * the user to the staff record.
             */ elseif (_h($get_staff->staffID) > 0) {
    
                etsis_redirect(get_base_url() . 'staff' . '/' . _h($get_staff->staffID) . '/');
            }
            /**
             * If we get to this point, the all is well
             * and it is ok to process the query and print
             * the results in a html format.
             */ else {
    
                etsis_register_style('form');
                etsis_register_script('select');
                etsis_register_script('select2');
                etsis_register_script('datepicker');
    
                $app->view->display('staff/add', [
                    'title' => get_name(_h($get_person->personID)),
                    'person' => (array) $get_person
                    ]
                );
            }
        });

     

    Joshua Parker
    Twitter | Facebook | DigitalOcean | tinyCampaign

    5 years, 7 months ago Joshua Parker
    Keymaster
    • Topics: 5
    • Replies: 638
    • Total Posts: 643

    When I speak of cache in a generic sense, I am always talking about the system’s object cache. eduTrac SIS has it’s own caching system.

    What’s suppose to happen during update is that the old cache is supposed to be incremented causing it to become void and deleted two minutes later. At the same time, a new cache is supposed to be generated from the newly saved values.

    I’ve updated the Hooks library again and now it should be fixed. It is attached.

    Attachments:
    You must be logged in to view attached files.

    Joshua Parker
    Twitter | Facebook | DigitalOcean | tinyCampaign

    5 years, 7 months ago Teja Majety
    Moderator
    • Topics: 38
    • Replies: 204
    • Total Posts: 242

    After changing the index for altID, the new person records can be created.

    But I am not sure about the settings, as you have suggested after replacing the file hooks.php the changes are taking effect.

    I mean for some reason it may be my PC issue, I am not sure, I can’t see the changes right after changing the value in the field, it’s taking some time to show the values, even reloading doesn’t seem to change.

    5 years, 7 months ago Joshua Parker
    Keymaster
    • Topics: 5
    • Replies: 638
    • Total Posts: 643

    I will check out staff and see what the issue may be.

    For person, go to your PHPMyAdmin, the person table, and drop the unique key for altID: run the following query ALTER TABLE person DROP INDEX altID;

    For settings, I think it is a cache issue. Replace app/src/Hooks.php with the one attached, and let me know the outcome.

    Attachments:
    You must be logged in to view attached files.

    Joshua Parker
    Twitter | Facebook | DigitalOcean | tinyCampaign

    5 years, 7 months ago Teja Majety
    Moderator
    • Topics: 38
    • Replies: 204
    • Total Posts: 242

    Yes, I was just checking them, After replacing the files with new release some of the issues have been solved like the course section button and the mail format.

    I can create course section now and the mail format was good.

    Still, the staff record can’t be created, and a new person as well. For the staff record I can’t find any error logs but for the new person, there has been an error generating every time, when I tried to create a new person.

    Integrity constraint violation: 1062 Duplicate entry '' for key 'altID' [] []

    also in the general settings, it still remains same, multiple fields can’t be updated at the same time.

    It may be that some of the files have been missed while uploading?

    5 years, 7 months ago Joshua Parker
    Keymaster
    • Topics: 5
    • Replies: 638
    • Total Posts: 643

    I am unable to create staff record, it always ends up showing 404 error.

    In Generals Settings or in Registration Settings when trying to update multiple fields at the same time, the updates are limited to the single field. I mean at a time I am able to update/change single field.

    I can’t seem to have a “Create Section” button, in course field, I can see only “view” and “Clone”. I checked with role and permissions, everything seems fine.

    Are these issues still valid now that you are using the correct release candidate?

    When creating a person an automated mail will be sent to recipients mail ID but that mail is in HTML format, I mean it’s all in HTML code version.

    Is this with or without the SMTP plugin being activated? Can you try both scenarios and let me know the outcome? Thanks.

    Joshua Parker
    Twitter | Facebook | DigitalOcean | tinyCampaign

    5 years, 7 months ago Teja Majety
    Moderator
    • Topics: 38
    • Replies: 204
    • Total Posts: 242

    There are some other issues that I’ve just come across some other issues.

    1. In Generals Settings or in Registration Settings when trying to update multiple fields at the same time, the updates are limited to the single field. I mean at a time I am able to update/change single field.
    2. I can’t seem to have a “Create Section” button, in course field, I can see only “view” and “Clone”. I checked with role and permissions, everything seems fine.
    3. When creating a person an automated mail will be sent to recipients mail ID but that mail is in HTML format, I mean it’s all in HTML code version.
    Attachments:
    You must be logged in to view attached files.
    5 years, 7 months ago Teja Majety
    Moderator
    • Topics: 38
    • Replies: 204
    • Total Posts: 242

    I am unable to create staff record, it always ends up showing 404 error.

    I have super admin role and enabled all the permissions for that role.

    There aren’t any error logs as well.

     

    • This topic was modified 5 years, 7 months ago by Joshua Parker. Reason: RC4 is not out yet, so updated Release to RC3
    Attachments:
    You must be logged in to view attached files.
Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

The Educator

Subscribe to The Educator to receive weekly updates and educational resources.

Search Forums

Support Forum Topics

  • List of All Screens by A. David Rivera
    3 years, 6 months ago
  • Warning after first intallation by Cits Ser
    3 years, 9 months ago
  • Blank screen after install by Adebobola Adesuyan
    3 years, 9 months ago
  • etSIS Analytics by David Casas
    4 years ago
  • etSIS Analytics by David Casas
    4 years ago

Topic Tags

6.3.0-RC3 6.3.0-RC4 6.3.4 acceptance letter batchregistration Canvas Contributing Cron custom_fields error FERPA Forms get_option graduation Importer LMS manual user account moduleversion NAE offline Search filter in RGN SQL SROS SSO Student application Student Program stuLoad cannot be null Transfer

Support Topics Stats

No statisitcs available.

Follow eduTrac On Facebook

About eduTrac SIS

eduTrac SIS is a free and open source student information system for higher education. We believe that it is the best free system out there for higher education and specialized schools.

Lastest Updates

  • eduTrac SIS 6.3.4 Maintenance Release
  • eduTrac SIS 6.3.1 Maintenance Release

Follow eduTrac SIS