Exemple #1
0
 /**
  * Get the toolbar to render.
  *
  * @return  RToolbar
  */
 public function getToolbar()
 {
     $canDo = OpenHrmHelpersAcl::getActions($this->state->get('filter.country_id'));
     $user = JFactory::getUser();
     $firstGroup = new RToolbarButtonGroup();
     $secondGroup = new RToolbarButtonGroup();
     if ($user->authorise('core.admin', 'com_openhrm.panel')) {
         $save = RToolbarBuilder::createSaveButton('organizationinfo.apply');
         $saveClose = RToolbarBuilder::createSaveAndCloseButton('organizationinfo.save');
         $firstGroup->addButton($save)->addButton($saveClose);
         $cancel = RToolbarBuilder::createCloseButton('organizationinfo.close');
         $secondGroup->addButton($cancel);
     }
     $toolbar = new RToolbar();
     $toolbar->addGroup($firstGroup)->addGroup($secondGroup);
     return $toolbar;
 }
Exemple #2
0
 /**
  * Get the toolbar to render.
  *
  * @return  RToolbar
  */
 public function getToolbar()
 {
     $canDo = OpenHrmHelpersAcl::getActions($this->state->get('filter.country_id'));
     $user = JFactory::getUser();
     $firstGroup = new RToolbarButtonGroup();
     $secondGroup = new RToolbarButtonGroup();
     $thirdGroup = new RToolbarButtonGroup();
     if ($user->authorise('core.admin', 'com_openhrm.panel')) {
         $new = RToolbarBuilder::createNewButton('employee.add');
         $edit = RToolbarBuilder::createEditButton('employee.edit');
         $firstGroup->addButton($new)->addButton($edit);
         $publish = RToolbarBuilder::createPublishButton('employees.published');
         $unpublish = RToolbarBuilder::createPublishButton('employees.unpublished');
         $secondGroup->addButton($publish)->addButton($unpublish);
         $delete = RToolbarBuilder::createDeleteButton('employees.delete');
         $thirdGroup->addButton($delete);
     }
     $toolbar = new RToolbar();
     $toolbar->addGroup($firstGroup)->addGroup($secondGroup)->addGroup($thirdGroup);
     return $toolbar;
 }