Пример #1
0
echo Language::show('enabled', 'groups');
?>
" data-off-text="<?php 
echo Language::show('disabled', 'groups');
?>
" class="switch" <?php 
echo $checked;
?>
 value="1">
                            </div>

                        </div>
                    </div>   
                    
                    <?php 
$languageL18n = L18n::getLanguagesForL18n();
if (!empty($languageL18n)) {
    echo "<legend class=\"text-semibold text-grey border-bottom-grey-100\">" . Language::show('localize_data', 'l18n') . "</legend>";
    echo "<div class=\"row\">";
    foreach ($languageL18n as $language) {
        ?>
                            
								<div class="col-md-6">								
									<div class="form-group has-feedback has-feedback-left">
										<label><?php 
        echo Language::show('name', 'groups');
        ?>
<span class="text-danger">*</span></label>
										<input tabindex="5" type="text" required="required"  class="form-control input-lg" name="name_<?php 
        echo $language->code;
        ?>
Пример #2
0
 /**
  * Edit Role
  */
 public function edit($id)
 {
     $data['js'] = array(Url::assetPath('js') . 'plugins/forms/selects/select2.min.js', Url::assetPath('js') . 'plugins/forms/validation/validate.min.js', Url::assetPath('js') . 'plugins/notifications/bootbox.min.js', Url::assetPath('js') . 'pages/roles_add.js');
     $data['role'] = $this->role->getRole($id);
     $data['rolesL18n'] = $this->role->getRoleL18n($id);
     if (isset($_POST['update'])) {
         $name = $_POST['name'];
         $name = strtoupper(Url::generateSafeSlug($name, ''));
         $display_name = $_POST['display_name'];
         $description = $_POST['description'];
         $unique = $this->role->isNameUnique($name, $id);
         if ($name == '') {
             $error[] = $this->language->get('required');
         }
         if ($display_name == '') {
             $error[] = $this->language->get('required');
         }
         if (!empty($unique)) {
             $error[] = $this->language->get('unique_name_required');
         }
         if (!$error) {
             $data = array('name' => $name);
             $where = array('id' => $id);
             $this->role->updateRole($data, $where);
             $data_l18n = array('role_id' => $id, 'language_id' => Session::get('language_id'), 'display_name' => $display_name, 'description' => $description);
             $this->role->updateRoleL18n($data_l18n);
             $languageL18n = L18n::getLanguagesForL18n();
             if (!empty($languageL18n)) {
                 foreach ($languageL18n as $language) {
                     $display_name_l18n = $_POST['display_name_' . $language->code];
                     $description_l18n = $_POST['description_' . $language->code];
                     $data_l18n = array('role_id' => $id, 'language_id' => $language->id, 'display_name' => $display_name_l18n, 'description' => $description_l18n);
                     $this->role->updateRoleL18n($data_l18n);
                 }
             }
             Session::set('success', $this->language->get('msg_role_edit'));
             Log::notice('log_role_edit', 'id: ' . $id . ', name: ' . $name . ', display_name: ' . $display_name);
             Url::redirect('roles');
         }
     }
     if (isset($_POST['cancel'])) {
         Url::redirect('roles');
     }
     if (isset($_POST['delete'])) {
         Url::redirect('roles/delete/' . $id . '');
     }
     View::renderTemplate('header', $data);
     View::render('roles/edit', $data, $error);
     View::renderTemplate('footer', $data);
 }
Пример #3
0
    <div class="navbar navbar-default header-highlight">
        <div class="navbar-header">
            <a class="navbar-brand" href="index.html"><img src="/assets/images/logo_light.png" alt=""></a>
    
            <ul class="nav navbar-nav visible-xs-block">
                <li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
                <li><a class="sidebar-mobile-main-toggle"><i class="icon-paragraph-justify3"></i></a></li>
                <li><a class="sidebar-mobile-detached-toggle"><i class="icon-grid7"></i></a></li>
            </ul>
        </div>
    
        <div class="navbar-collapse collapse" id="navbar-mobile">
            <ul class="nav navbar-nav">
                <li><a class="sidebar-control sidebar-main-toggle hidden-xs"><i class="icon-paragraph-justify3"></i></a></li>
                <?php 
echo L18n::getLanguageNavigation();
?>
            
            </ul>       
    
            <ul class="nav navbar-nav navbar-right">
    
                <li>
                    <a href="#">
                        <i class="icon-bell3"></i>
                        <span class="visible-xs-inline-block position-right">Notifications</span>
                        <span class="badge bg-danger">4</span>
                    </a>
                </li>
                <li class="dropdown dropdown-user">
                    <a class="dropdown-toggle" data-toggle="dropdown">
Пример #4
0
 /**
  * Edit Office
  */
 public function edit($id)
 {
     $data['title'] = $this->language->get('title_edit');
     $data['js'] = array(Url::assetPath('js') . 'plugins/forms/selects/select2.min.js', Url::assetPath('js') . 'plugins/forms/validation/validate.min.js', Url::assetPath('js') . 'plugins/notifications/bootbox.min.js', Url::assetPath('js') . 'pages/offices_add.js');
     $data['office'] = $this->office->getOffice($id);
     $data['offices'] = $this->office->getOffices();
     $data['officesL18n'] = $this->office->getOfficeL18n($id);
     $data['companies'] = $this->company->getCompanies();
     if (isset($_POST['update'])) {
         $name = $_POST['name'];
         $address_1 = $_POST['address_1'];
         $address_2 = $_POST['address_2'];
         $city = $_POST['city'];
         $country = $_POST['country'];
         $post_code = $_POST['post_code'];
         $state = $_POST['state'];
         $company = $_POST['company'];
         $status = isset($_POST['status']) ? '1' : '0';
         if ($name == '') {
             $error[] = $this->language->get('name_required');
         }
         if ($address_1 == '') {
             $error[] = $this->language->get('address_1_required');
         }
         if ($city == '') {
             $error[] = $this->language->get('city_required');
         }
         if ($country == '') {
             $error[] = $this->language->get('country_required');
         }
         if ($company == '') {
             $error[] = $this->language->get('company_required');
         }
         if (!$error) {
             $data = array('status' => $status, 'company_id' => $company);
             $where = array('id' => $id);
             $this->office->updateOffice($data, $where);
             $data_l18n = array('office_id' => $id, 'language_id' => Session::get('language_id'), 'name' => $name, 'address_1' => $address_1, 'address_2' => $address_2, 'city' => $city, 'post_code' => $post_code, 'country' => $country, 'state' => $state);
             $this->office->updateOfficeL18n($data_l18n);
             $languageL18n = L18n::getLanguagesForL18n();
             if (!empty($languageL18n)) {
                 foreach ($languageL18n as $language) {
                     $name_l18n = $_POST['name_' . $language->code];
                     $data_l18n = array('office_id' => $id, 'language_id' => $language->id, 'name' => $name, 'address_1' => $address_1, 'address_2' => $address_2, 'city' => $city, 'post_code' => $post_code, 'country' => $country, 'state' => $state);
                     $this->office->updateOfficeL18n($data_l18n);
                 }
             }
             Session::set('success', $this->language->get('msg_office_edit'));
             Log::notice('log_office_edit', 'id: ' . $office_id . ', address_1: ' . $address_1 . ', address_2: ' . $address_2 . ', city: ' . $city . ', post_code: ' . $post_code . ', country: ' . $country . ', state: ' . $state . ', status: ' . $status);
             Url::redirect('offices');
         }
     }
     if (isset($_POST['cancel'])) {
         Url::redirect('offices');
     }
     if (isset($_POST['delete'])) {
         Url::redirect('offices/delete/' . $id . '');
     }
     View::renderTemplate('header', $data);
     View::render('offices/edit', $data, $error);
     View::renderTemplate('footer', $data);
 }
Пример #5
0
 /**
  * Edit Team
  */
 public function edit($id)
 {
     $data['title'] = $this->language->get('title_edit');
     $data['js'] = array(Url::assetPath('js') . 'plugins/forms/selects/select2.min.js', Url::assetPath('js') . 'plugins/forms/validation/validate.min.js', Url::assetPath('js') . 'plugins/notifications/bootbox.min.js', Url::assetPath('js') . 'pages/teams_add.js');
     $data['team'] = $this->team->getTeam($id);
     $data['teams'] = $this->team->getTeams();
     $data['teamsL18n'] = $this->team->getTeamL18n($id);
     $data['departments'] = $this->department->getDepartments();
     if (isset($_POST['update'])) {
         $name = $_POST['name'];
         $email = $_POST['email'];
         $department = $_POST['department'];
         $status = isset($_POST['status']) ? '1' : '0';
         if ($name == '') {
             $error[] = $this->language->get('name_required');
         }
         if ($department == '') {
             $error[] = $this->language->get('department_required');
         }
         if (!$error) {
             $data = array('email' => $email, 'status' => $status, 'department_id' => $department);
             $where = array('id' => $id);
             $this->team->updateTeam($data, $where);
             $data_l18n = array('team_id' => $id, 'language_id' => Session::get('language_id'), 'name' => $name);
             $this->team->updateTeamL18n($data_l18n);
             $languageL18n = L18n::getLanguagesForL18n();
             if (!empty($languageL18n)) {
                 foreach ($languageL18n as $language) {
                     $name_l18n = $_POST['name_' . $language->code];
                     $data_l18n = array('team_id' => $id, 'language_id' => $language->id, 'name' => $name_l18n);
                     $this->team->updateTeamL18n($data_l18n);
                 }
             }
             Session::set('success', $this->language->get('msg_team_edit'));
             Log::notice('log_team_edit', 'id: ' . $id . ', name: ' . $name . ', email: ' . $email . ', status: ' . $status);
             Url::redirect('teams');
         }
     }
     if (isset($_POST['cancel'])) {
         Url::redirect('teams');
     }
     if (isset($_POST['delete'])) {
         Url::redirect('teams/delete/' . $id . '');
     }
     View::renderTemplate('header', $data);
     View::render('teams/edit', $data, $error);
     View::renderTemplate('footer', $data);
 }
Пример #6
0
 /**
  * Edit Company
  */
 public function edit($id)
 {
     $data['title'] = $this->language->get('title_edit');
     $data['js'] = array(Url::assetPath('js') . 'plugins/forms/selects/select2.min.js', Url::assetPath('js') . 'plugins/forms/validation/validate.min.js', Url::assetPath('js') . 'plugins/notifications/bootbox.min.js', Url::assetPath('js') . 'pages/companies_add.js');
     $data['company'] = $this->company->getCompany($id);
     $data['companies'] = $this->company->getCompanies();
     $data['companiesL18n'] = $this->company->getCompanyL18n($id);
     if (isset($_POST['update'])) {
         $description = $_POST['description'];
         $name = $_POST['name'];
         $status = isset($_POST['status']) ? '1' : '0';
         if ($description == '') {
             $error[] = $this->language->get('required');
         }
         if (!$error) {
             $data = array('name' => $name, 'status' => $status);
             $where = array('id' => $id);
             $this->company->updateCompany($data, $where);
             $data_l18n = array('company_id' => $id, 'language_id' => Session::get('language_id'), 'description' => $description);
             $this->company->updateCompanyL18n($data_l18n);
             $languageL18n = L18n::getLanguagesForL18n();
             if (!empty($languageL18n)) {
                 foreach ($languageL18n as $language) {
                     $description_l18n = $_POST['description_' . $language->code];
                     $data_l18n = array('company_id' => $id, 'language_id' => $language->id, 'description' => $description_l18n);
                     $this->company->updateCompanyL18n($data_l18n);
                 }
             }
             Session::set('success', $this->language->get('msg_company_edit'));
             Log::notice('log_company_edit', 'id: ' . $id . ', name: ' . $name . ', status: ' . $status);
             Url::redirect('companies');
         }
     }
     if (isset($_POST['cancel'])) {
         Url::redirect('companies');
     }
     if (isset($_POST['delete'])) {
         Url::redirect('companies/delete/' . $id . '');
     }
     View::renderTemplate('header', $data);
     View::render('companies/edit', $data, $error);
     View::renderTemplate('footer', $data);
 }
Пример #7
0
 /**
  * Edit Navigation Item
  */
 public function edit($menu_id, $id)
 {
     $data['js'] = array(Url::assetPath('js') . 'plugins/forms/selects/select2.min.js', Url::assetPath('js') . 'plugins/forms/validation/validate.min.js', Url::assetPath('js') . 'plugins/extensions/quicksearch.js', Url::assetPath('js') . 'plugins/notifications/bootbox.min.js', Url::assetPath('js') . 'pages/navigation_add.js');
     $data['parent'] = $this->navigation->getNavigations();
     $data['role'] = $this->role->getRoles();
     $data['menu_id'] = $menu_id;
     $data['navigation'] = $this->navigation->getNavigation($id);
     $data['navigationL18n'] = $this->navigation->getNavigationL18n($id);
     if (isset($_POST['save'])) {
         $name = $_POST['name'];
         $description = $_POST['description'];
         $link = $_POST['link'];
         $icon = $_POST['icon'];
         if (empty($_POST['parent'])) {
             $parent_id = $menu_id;
         } else {
             $parent_id = $_POST['parent'];
         }
         $role_id = $_POST['role'];
         $status = isset($_POST['status']) ? '1' : '0';
         if ($name == '') {
             $error[] = $this->language->get('name_required');
         }
         if ($link == '') {
             $error[] = $this->language->get('link_required');
         }
         if ($role_id == '') {
             $error[] = $this->language->get('role_required');
         }
         if (!$error) {
             $data = array('parent_id' => $parent_id, 'link' => $link, 'icon' => $icon, 'role_id' => $role_id, 'status' => $status);
             $where = array('id' => $id);
             $this->navigation->updateNavigation($data, $where);
             $data_l18n = array('navigation_id' => $id, 'language_id' => Session::get('language_id'), 'name' => $name, 'description' => $description);
             $this->navigation->updateNavigationL18n($data_l18n);
             $languageL18n = L18n::getLanguagesForL18n();
             if (!empty($languageL18n)) {
                 foreach ($languageL18n as $language) {
                     $name_l18n = $_POST['name_' . $language->code];
                     $description_l18n = $_POST['description_' . $language->code];
                     $data_l18n = array('navigation_id' => $id, 'language_id' => $language->id, 'name' => $name_l18n, 'description' => $description_l18n);
                     $this->navigation->updateNavigationL18n($data_l18n);
                 }
             }
             Session::set('success', $this->language->get('msg_navigation_item_edit'));
             Log::notice('log_navigation_item_edit', 'id: ' . $id . ', name: ' . $name . ', parent_id: ' . $parent_id . ', link: ' . $link . ', icon: ' . $icon . ', role_id: ' . $role_id . ', status: ' . $status);
             Url::redirect('navigation/' . $menu_id);
         }
     }
     if (isset($_POST['cancel'])) {
         Url::redirect('navigation/' . $menu_id . '');
     }
     if (isset($_POST['delete'])) {
         Url::redirect('navigation/delete/' . $id . '');
     }
     View::renderTemplate('header', $data);
     View::render('navigation/edit', $data, $error);
     View::render('icons', $data);
     View::renderTemplate('footer', $data);
 }
Пример #8
0
 /**
  * Edit Department
  */
 public function edit($id)
 {
     $data['js'] = array(Url::assetPath('js') . 'plugins/forms/selects/select2.min.js', Url::assetPath('js') . 'plugins/forms/validation/validate.min.js', Url::assetPath('js') . 'plugins/pickers/color/spectrum.js', Url::assetPath('js') . 'plugins/notifications/bootbox.min.js', Url::assetPath('js') . 'pages/departments_add.js');
     $data['department'] = $this->department->getDepartment($id);
     $data['departments'] = $this->department->getDepartments();
     $data['users'] = $this->department->getUsers();
     $data['departmentsL18n'] = $this->department->getDepartmentL18n($id);
     if (isset($_POST['update'])) {
         $name = $_POST['name'];
         $email = !empty($_POST['email']) ? $_POST['email'] : NULL;
         $color = !empty($_POST['color']) ? $_POST['color'] : NULL;
         $parent = !empty($_POST['parent']) ? $_POST['parent'] : NULL;
         $supervisor = !empty($_POST['supervisor']) ? $_POST['supervisor'] : NULL;
         $status = isset($_POST['status']) ? '1' : '0';
         if ($name == '') {
             $error[] = $this->language->get('required');
         }
         if (!$error) {
             $data = array('parent_id' => $parent, 'user_id' => $supervisor, 'color' => $color, 'email' => $email, 'status' => $status);
             $where = array('id' => $id);
             $this->department->updateDepartment($data, $where);
             $data_l18n = array('department_id' => $id, 'language_id' => Session::get('language_id'), 'name' => $name);
             $this->department->updateDepartmentL18n($data_l18n);
             $languageL18n = L18n::getLanguagesForL18n();
             if (!empty($languageL18n)) {
                 foreach ($languageL18n as $language) {
                     $name_l18n = $_POST['name_' . $language->code];
                     $data_l18n = array('department_id' => $id, 'language_id' => $language->id, 'name' => $name_l18n);
                     $this->department->updateDepartmentL18n($data_l18n);
                 }
             }
             Session::set('success', $this->language->get('msg_department_edit'));
             Log::notice('log_department_edit', json_encode(array($data, $data_l18n)));
             Url::redirect('departments');
         }
     }
     if (isset($_POST['cancel'])) {
         Url::redirect('departments');
     }
     if (isset($_POST['delete'])) {
         Url::redirect('departments/delete/' . $id . '');
     }
     View::renderTemplate('header', $data);
     View::render('departments/edit', $data, $error);
     View::renderTemplate('footer', $data);
 }