function init() { parent::init(); /*Reset Password Email Content*/ $config_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['reset_subject' => 'Line', 'reset_body' => 'xepan\\base\\RichText', 'update_subject' => 'Line', 'update_body' => 'xepan\\base\\RichText'], 'config_key' => 'ADMIN_LOGIN_RELATED_EMAIL', 'application' => 'communication']); $config_m->add('xepan\\hr\\Controller_ACL'); $config_m->tryLoadAny(); // $resetpass_config = $this->app->epan->config; // $reset_subject = $resetpass_config->getConfig('RESET_PASSWORD_SUBJECT_FOR_ADMIN'); // $reset_body = $resetpass_config->getConfig('RESET_PASSWORD_BODY_FOR_ADMIN'); $form = $this->add('Form', null, 'reset_email'); $form->setModel($config_m, ['reset_subject', 'reset_body']); $form->getElement('reset_subject')->set($config_m['reset_subject']); $form->getElement('reset_body')->set($config_m['reset_body'])->setFieldHint('{$username},{$click_here}'); // $form->addField('line','subject')->set($reset_subject); // $form->addField('xepan\base\RichText','body')->set($reset_body); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); // $resetpass_config->setConfig('RESET_PASSWORD_SUBJECT_FOR_ADMIN',$form['subject'],'base'); // $resetpass_config->setConfig('RESET_PASSWORD_BODY_FOR_ADMIN',$form['body'],'base'); $config_m->app->employee->addActivity("'Reset Password Email' Content's Layout Updated For ERP Users", null, null, null, null, "xepan_communication_general_emailcontent_admin")->notifyWhoCan(' ', ' ', $config_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Layout Successfully Updated')->execute(); } /*Update Password Email Content*/ // $update_config = $this->app->epan->config; // $update_subject = $update_config->getConfig('UPDATE_PASSWORD_SUBJECT_FOR_ADMIN'); // $update_body = $update_config->getConfig('UPDATE_PASSWORD_BODY_FOR_ADMIN'); $form = $this->add('Form', null, 'updatepassword_view'); $form->setModel($config_m, ['update_subject', 'update_body']); $form->getElement('update_subject')->set($config_m['update_subject']); $form->getElement('update_body')->set($config_m['update_body'])->setFieldHint('{$username},{$email_id},{$password},{$organization},{$post}'); // $form->addField('line','subject')->set($update_subject); // $form->addField('xepan\base\RichText','body')->set($update_body); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); // $update_config->setConfig('UPDATE_PASSWORD_SUBJECT_FOR_ADMIN',$form['subject'],'base'); // $update_config->setConfig('UPDATE_PASSWORD_BODY_FOR_ADMIN',$form['body'],'base'); $config_m->app->employee->addActivity("'Update Password Email' Content's Layout Updated For ERP Users", null, null, null, null, "xepan_communication_general_emailcontent_admin")->notifyWhoCan(' ', ' ', $config_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Layout Successfully Updated')->execute(); } }
function init() { parent::init(); $country_model = $this->add('xepan\\base\\Model_Country'); $country_model->setOrder('name', 'asc'); if (!$this->api->auth->model->isSuperUser()) { $this->add('View_Error')->set('Sorry, you are not permitted to handle this section , Ask respective authority / SuperUser'); return; } else { $crud = $this->add('xepan\\hr\\CRUD', null, null, ['view/country-state/country']); $crud->setModel($country_model); $crud->grid->addQuickSearch(['name', 'iso_code']); $crud->grid->addPaginator(50); $crud->grid->add('VirtualPage')->addColumn('State')->set(function ($page) { $country_id = $_GET[$page->short_name . '_id']; $state_model = $page->add('xepan\\base\\Model_State')->addCondition('country_id', $country_id); $state_model->setOrder('name', 'asc'); $crud = $page->add('xepan\\hr\\CRUD', null, null, ['view/country-state/state']); $crud->setModel($state_model); $crud->grid->addQuickSearch(['name', 'abbreviation']); $crud->grid->addPaginator(50); }); } }
function init() { parent::init(); /*Frontend User Configuration*/ $frontend_config_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['user_registration_type' => 'DropDown', 'reset_subject' => 'Line', 'reset_body' => 'xepan\\base\\RichText', 'update_subject' => 'Line', 'update_body' => 'xepan\\base\\RichText', 'registration_subject' => 'Line', 'registration_body' => 'xepan\\base\\RichText', 'verification_subject' => 'Line', 'verification_body' => 'xepan\\base\\RichText', 'subscription_subject' => 'Line', 'subscription_body' => 'xepan\\base\\RichText'], 'config_key' => 'FRONTEND_LOGIN_RELATED_EMAIL', 'application' => 'communication']); $frontend_config_m->add('xepan\\hr\\Controller_ACL'); $frontend_config_m->tryLoadAny(); $f = $this->add('Form', null, 'frontend_user_config'); $f->setModel($frontend_config_m, ['user_registration_type']); $user_registration_type = $f->getElement('user_registration_type')->set($frontend_config_m['user_registration_type']); $user_registration_type->setValueList(['self_activated' => 'Self Activation Via Email', 'admin_activated' => 'Admin Activated', "default_activated" => 'Default Activated'])->validate('required'); $f->addSubmit('Update')->addClass('btn btn-primary'); if ($f->isSubmitted()) { $f->save(); if ($f['user_registration_type'] == 'self_activated') { $type = 'Self Activated Via Email'; } elseif ($f['user_registration_type'] == 'admin_activated') { $type = 'Admin Activated'; } elseif ($f['user_registration_type'] == 'default_activated') { $type = 'Default Activated'; } $frontend_config_m->app->employee->addActivity("'In Frontend User Configuration' User Registration Type Updated as '" . $type . "' For Website Users", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $frontend_config_m); $f->js(null, $f->js()->reload())->univ()->successMessage('Information Successfully Updated')->execute(); } /*Reset Password Email Content*/ $form = $this->add('Form', null, 'reset_email'); $form->setModel($frontend_config_m, ['reset_subject', 'reset_body']); $form->getElement('reset_subject')->set($frontend_config_m['reset_subject']); $form->getElement('reset_body')->set($frontend_config_m['reset_body'])->setFieldHint('{$name},{$email_id},{$password},{$click_here_to_activate}'); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); $frontend_config_m->app->employee->addActivity("'Reset Password Email' Content's Layout Updated For Website Users", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $frontend_config_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Layout Successfully Updated')->execute(); } /*Registration Email Content*/ $form = $this->add('Form', null, 'registration_view'); $form->setModel($frontend_config_m, ['registration_subject', 'registration_body']); $form->getElement('registration_subject')->set($frontend_config_m['registration_subject']); $form->getElement('registration_body')->set($frontend_config_m['registration_body'])->setFieldHint('{$name},{$email_id},{$password},{$click_here_to_activate}'); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); $frontend_config_m->app->employee->addActivity("'New Registration Email' Content's Layout Updated For Website Users", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $frontend_config_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Layout Successfully Updated')->execute(); } /*Verification Email Content*/ $form = $this->add('Form', null, 'verification_view'); $form->setModel($frontend_config_m, ['verification_subject', 'verification_body']); $form->getElement('verification_subject')->set($frontend_config_m['verification_subject']); $form->getElement('verification_body')->set($frontend_config_m['verification_body']); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); $frontend_config_m->app->employee->addActivity("'Verification Email' Content's Layout Updated For Website Users", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $frontend_config_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Layout Successfully Updated')->execute(); } /*Update Password Email Content*/ $form = $this->add('Form', null, 'updatepassword_view'); $form->setModel($frontend_config_m, ['update_subject', 'update_body']); $form->getElement('update_subject')->set($frontend_config_m['update_subject']); $form->getElement('update_body')->set($frontend_config_m['update_body'])->setFieldHint('{$name},{$email_id},{$password}'); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); $frontend_config_m->app->employee->addActivity("'Update Password Email' Content's Layout Updated For Website Users", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $frontend_config_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Layout Successfully Updated')->execute(); } /*Subscription Content*/ $form = $this->add('Form', null, 'subscription_view'); $form->setModel($frontend_config_m, ['subscription_subject', 'subscription_body']); $form->getElement('subscription_subject')->set($frontend_config_m['subscription_subject']); $form->getElement('subscription_body')->set($frontend_config_m['subscription_body'])->setFieldHint('{$name},{$email_id}'); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); $frontend_config_m->app->employee->addActivity("'Subscription Email' Content's Layout Updated For Website Users", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $frontend_config_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Layout Successfully Updated')->execute(); } }
function init() { parent::init(); /*General Email Setting*/ $email_setting = $this->add('xepan\\communication\\Model_Communication_EmailSetting'); $settingview = $this->add('xepan\\hr\\CRUD', ['action_page' => 'xepan_communication_general_email'], 'general_setting', ['view/setting/email-setting-grid']); $settingview->setModel($email_setting); // /*SMS Setting*/ $sms_view_model = $this->add('xepan\\communication\\Model_Communication_SMSSetting'); $sms_view = $this->add('xepan\\hr\\CRUD', null, 'sms_setting', ['view/setting/sms-setting-grid']); if ($sms_view->isEditing()) { $form = $sms_view->form; $form->setLayout('view/setting/form/sms-setting'); $form->js(true)->find('button')->addClass('btn btn-primary'); } if ($sms_view->isEditing()) { if ($emp_id = $this->app->employee->id) { $sms_view_model->addCondition('created_by_id', $emp_id); } } $sms_view->setModel($sms_view_model); // MISC Setting $misc_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['time_zone' => 'DropDown'], 'config_key' => 'Miscellaneous_Technical_Settings', 'application' => 'base']); $misc_m->add('xepan\\hr\\Controller_ACL'); $misc_m->tryLoadAny(); // $misc_config = $this->app->epan->config; // $misc_time_zone = $misc_config->getConfig('TIME_ZONE'); $form = $this->add('Form_Stacked', null, 'misc_view'); $form->setModel($misc_m); $time_zone_field = $form->getElement('time_zone')->set($misc_m['time_zone']); $time_zone_field->setValueList(array_combine(timezone_identifiers_list(), timezone_identifiers_list())); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); $misc_m->app->employee->addActivity("'Time Zone' Updated as '" . $form['time_zone'] . "'", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $misc_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Information Successfully Updated')->execute(); } // Email Setting $email_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['email_duplication_allowed' => 'DropDown'], 'config_key' => 'Email Duplication Allowed Settings', 'application' => 'base']); $email_m->add('xepan\\hr\\Controller_ACL'); $email_m->tryLoadAny(); $form = $this->add('Form_Stacked', null, 'email_view'); $form->setModel($email_m); $allow_email_permission = array('duplication_allowed' => 'Duplication Allowed', 'no_duplication_allowed_for_same_contact_type' => 'No Duplication Allowed For Same Contact Type', 'never_duplication_allowed' => 'Never Duplication Allowed'); $email_allowed_field = $form->getElement('email_duplication_allowed')->set($email_m['email_duplication_allowed']); $email_allowed_field->setValueList($allow_email_permission); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); $email_m->app->employee->addActivity("'Email Duplication Setting' Updated as '" . $form['email_duplication_allowed'] . "'", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $email_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Information Successfully Updated')->execute(); } // Contact No Setting $contactno_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['contact_no_duplcation_allowed' => 'DropDown'], 'config_key' => 'Contact No Duplication Allowed Settings', 'application' => 'base']); $contactno_m->add('xepan\\hr\\Controller_ACL'); $contactno_m->tryLoadAny(); $form = $this->add('Form_Stacked', null, 'contactno_view'); $form->setModel($contactno_m); $allow_contactno_permission = array('duplication_allowed' => 'Duplication Allowed', 'no_duplication_allowed_for_same_contact_type' => 'No Duplication Allowed For Same Contact Type', 'never_duplication_allowed' => 'Never Duplication Allowed'); $email_allowed_field = $form->getElement('contact_no_duplcation_allowed')->set($contactno_m['contact_no_duplcation_allowed']); $email_allowed_field->setValueList($allow_contactno_permission); $form->addSubmit('Update')->addClass('btn btn-primary'); if ($form->isSubmitted()) { $form->save(); $contactno_m->app->employee->addActivity("'Contact No Duplication Setting' Updated as '" . $form['contact_no_duplcation_allowed'] . "'", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $contactno_m); $form->js(null, $form->js()->reload())->univ()->successMessage('Information Successfully Updated')->execute(); } /*Company Info*/ $company_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['company_name' => "Line", 'company_owner' => "Line", 'mobile_no' => "Line", 'company_email' => "Line", 'company_address' => "Line", 'company_pin_code' => "Line", 'company_description' => "xepan\\base\\RichText", 'company_logo_absolute_url' => "Line", 'company_twitter_url' => "Line", 'company_facebook_url' => "Line", 'company_google_url' => "Line", 'company_linkedin_url' => "Line"], 'config_key' => 'COMPANY_AND_OWNER_INFORMATION', 'application' => 'communication']); $company_m->add('xepan\\hr\\Controller_ACL'); $company_m->tryLoadAny(); $c_form = $this->add('Form_Stacked', null, 'company_info'); $c_form->setModel($company_m); $c_form->addSubmit('Save')->addClass('btn btn-primary'); if ($c_form->isSubmitted()) { $c_form->save(); $company_m->app->employee->addActivity("Company Information Updated", null, null, null, null, "xepan_communication_general_emailcontent_usertool")->notifyWhoCan(' ', ' ', $company_m); $c_form->js(null, $c_form->js()->reload())->univ()->successMessage('Information Successfully Updated')->execute(); } // $this->add('View',null,'company_info',['view/schema-micro-data','person_info'])->setModel($company_m); /*Communication Sub Type Form */ $config_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['sub_type' => 'text'], 'config_key' => 'COMMUNICATION_SUB_TYPE', 'application' => 'Communication']); $config_m->add('xepan\\hr\\Controller_ACL'); $config_m->tryLoadAny(); $this->add('View', null, 'comm_subtype')->set('Enter comma seperated values with no space'); $sub_type_form = $this->add('Form_Stacked', null, 'comm_subtype'); $sub_type_form->setModel($config_m, ['sub_type']); $sub_type_form->getElement('sub_type')->set($config_m['sub_type']); $sub_type_form->addSubmit('Save')->addClass('btn btn-primary'); if ($sub_type_form->isSubmitted()) { $sub_type_form->save(); $sub_type_form->js(null, $sub_type_form->js()->reload())->univ()->successMessage('Information Saved')->execute(); } }