Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 6 лет назад
Родитель
Сommit
51ff36e012

+ 1 - 1
modules/boonex/classes/classes/BxClssDb.php

@@ -38,7 +38,7 @@ class BxClssDb extends BxBaseModTextDb
     {        
         $aClass = $this->getRow("SELECT `c`.`id`, `c`.`order`, `m`.`order` as `order_module`, `allow_view_to` as `context_profile_id` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `c` INNER JOIN `" . $this->_oConfig->CNF['TABLE_MODULES'] . "` AS `m` ON (`m`.`id` = `c`.`module_id`) WHERE `c`.`id` = :class", array('class' => $iClassId));
 
-        $sQuery = "SELECT `c`.`*`, `m`.`module_title` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `c` INNER JOIN `" . $this->_oConfig->CNF['TABLE_MODULES'] . "` AS `m` ON (`m`.`id` = `c`.`module_id`) WHERE `m`.`order`*1000000 + `c`.`order` $sOp :order_module*1000000 + :order AND `c`.`id` != :id AND `allow_view_to` = :context_profile ORDER BY `m`.`order`*1000000 + `c`.`order` $sSorting LIMIT 1";
+        $sQuery = "SELECT `c`.*, `m`.`module_title` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `c` INNER JOIN `" . $this->_oConfig->CNF['TABLE_MODULES'] . "` AS `m` ON (`m`.`id` = `c`.`module_id`) WHERE `m`.`order`*1000000 + `c`.`order` $sOp :order_module*1000000 + :order AND `c`.`id` != :id AND `allow_view_to` = :context_profile ORDER BY `m`.`order`*1000000 + `c`.`order` $sSorting LIMIT 1";
 
         $a = $this->getRow($sQuery, array(
             'order_module' => $aClass['order_module'], 

+ 3 - 2
modules/boonex/classes/classes/BxClssFormEntry.php

@@ -212,7 +212,7 @@ class BxClssFormEntry extends BxBaseModTextFormEntry
         if (!$this->_bViewMode && isset($this->aInputs['module_id']) && !$this->aInputs['module_id']['values'])
             return MsgBox(_t('_bx_classes_txt_err_cant_add_class_without_modules'));
 
-        if (!$this->_oModule->serviceIsCourseAdmin($this->_oProfileContext->id()))
+        if (!$this->_bViewMode && !$this->_oModule->serviceIsCourseAdmin($this->_oProfileContext->id()))
             return MsgBox(_t('_sys_txt_access_denied'));
 
         return parent::getCode($bDynamicMode);
@@ -245,7 +245,8 @@ class BxClssFormEntry extends BxBaseModTextFormEntry
         $sClass .= ' ' . $sClassAdd;
 
         $aInput['name'] .= '!';
-        return '<div class="' . $sClass . '">' . parent::genViewRowValue($aInput) . '</div>';
+        $s = parent::genViewRowValue($aInput);
+        return $aInput['value'] ? '<div class="' . $sClass . '">' . $s . '</div>' : $s;
     }
 }
 

+ 1 - 0
modules/boonex/classes/install/langs/en.xml

@@ -137,6 +137,7 @@
     <string name="_bx_classes_page_block_title_prev_entry"><![CDATA[Previous class]]></string>
     <string name="_bx_classes_page_block_title_entry_students_completed_class"><![CDATA[Passed students]]></string>
     <string name="_bx_classes_page_block_title_entry_students_not_completed_class"><![CDATA[Not passed students]]></string>
+    <string name="_bx_classes_page_block_title_group_entries"><![CDATA[Classes]]></string>
 
     <string name="_bx_classes_menu_title_entry_attachments"><![CDATA[Form Attachments]]></string>
     <string name="_bx_classes_menu_set_title_entry_attachments"><![CDATA[Form Attachments]]></string>

+ 0 - 6
modules/boonex/classes/install/sql/enable.sql

@@ -106,12 +106,6 @@ SET @iPBCellGroup = 4;
 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
 ('trigger_page_group_view_entry', @iPBCellGroup, 'bx_classes', '_bx_classes_page_block_title_group_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_classes";s:6:"method";s:18:"classes_in_context";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 0, 0, 0);
 
--- MENU: add to "add content" menu
-
-SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
-INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('sys_add_content_links', 'bx_classes', 'create-class', '_bx_classes_menu_item_title_system_create_entry', '_bx_classes_menu_item_title_create_entry', 'page.php?i=create-class', '', '', 'file-alt col-red3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
-
 -- MENU: create post form attachments (link, photo, video, etc)
 
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES