Esempio n. 1
0
 public static function checkedOut(&$row, $i, $identifier = 'id')
 {
     $user =& JFactory::getUser();
     $userid = $user->get('id');
     $result = false;
     if (is_a($row, 'JTable')) {
         $result = $row->isCheckedOut($userid);
     } else {
         $result = JTable::isCheckedOut($userid, $row->checked_out);
     }
     $checked = '';
     if ($result) {
         $checked = JHTMLGrid::_checkedOut($row);
     } else {
         $checked = JHTML::_('grid.id', $i, $row->{$identifier});
     }
     return $checked;
 }
Esempio n. 2
0
 /**
  * @function checkedOutRadio
  * abstract a little edited default function, just display radio buttons instead checkboxes
  */
 function checkedOutRadio(&$row, $i, $identifier = 'id')
 {
     $user =& JFactory::getUser();
     $userid = $user->get('id');
     $result = false;
     if (is_a($row, 'JTable')) {
         $result = $row->isCheckedOut($userid);
     } else {
         $result = JTable::isCheckedOut($userid, $row->checked_out);
     }
     $checked = '';
     if ($result) {
         $checked = JHTMLGrid::_checkedOut($row);
     } else {
         echo $this->idRadio($i, $row->name);
     }
     return $checked;
 }
Esempio n. 3
0
 function checkedOut(&$row, $i, $identifier = 'id')
 {
     $user =& JFactory::getUser();
     $userid = $user->get('id');
     $acl =& JFactory::getACL();
     $myObjectID = $acl->get_object_id('users', $userid, 'ARO');
     $myGroups = $acl->get_object_groups($myObjectID, 'ARO');
     $myGroupName = strtolower($acl->get_group_name($myGroups[0], 'ARO'));
     $result = false;
     if ($myGroupName == 'super administrator' or $myGroupName == 'administrator') {
         $result = JTable::isCheckedOut($userid);
     } else {
         if (is_a($row, 'JTable')) {
             $result = $row->isCheckedOut($userid);
         } else {
             if ($myGroupName == 'hotels') {
                 $result = JTable::isCheckedOut($userid, $row->user_id_hotel);
             } else {
                 //Esta condicion es para la tabla jos_hg_hotelitems, el caso contrario es para las demas que usen user_id
                 if ($row->created_by) {
                     $result = JTable::isCheckedOut($userid, $row->created_by);
                 } else {
                     $result = JTable::isCheckedOut($userid, $row->user_id);
                 }
             }
         }
     }
     $checked = '';
     if ($result) {
         $checked = JHTMLGrid::_checkedOut($row);
     } else {
         $checked = JHTML::_('grid.id', $i, $row->{$identifier});
     }
     return $checked;
 }