diff options
author | M.Gergo | 2020-03-24 18:56:00 +0100 |
---|---|---|
committer | M.Gergo | 2020-03-24 18:56:00 +0100 |
commit | 2f93e272054ed126be63db31d33e90f51f09d30e (patch) | |
tree | 0344db4e179a6aa9ccf2503d6d6ca25fa39e53d0 /mayor-orig/mayor-naplo | |
parent | 351ace3031cf063cef346027ae209d218225242a (diff) | |
download | mayor-c97988dabec601323e27087ad7cf7fbf5ca90719.tar.gz mayor-c97988dabec601323e27087ad7cf7fbf5ca90719.zip |
Rev: 4633rev4633
Diffstat (limited to 'mayor-orig/mayor-naplo')
7 files changed, 56 insertions, 10 deletions
diff --git a/mayor-orig/mayor-naplo/install/module-naplo/mysql/tanev.sql b/mayor-orig/mayor-naplo/install/module-naplo/mysql/tanev.sql index 65b3a584..efe43f5d 100644 --- a/mayor-orig/mayor-naplo/install/module-naplo/mysql/tanev.sql +++ b/mayor-orig/mayor-naplo/install/module-naplo/mysql/tanev.sql @@ -147,6 +147,7 @@ CREATE TABLE `oraHazifeladat` ( `hazifeladatId` int(10) unsigned NOT NULL AUTO_INCREMENT, `oraId` int(10) unsigned DEFAULT NULL, `hazifeladatLeiras` text COLLATE utf8_hungarian_ci NOT NULL, + `hazifeladatFeltoltesEngedely` tinyint(3) unsigned DEFAULT '0', PRIMARY KEY (`hazifeladatId`), UNIQUE KEY `oraId` (`oraId`), CONSTRAINT `oraHazifeladat_ibfk_1` FOREIGN KEY (`oraId`) REFERENCES `ora` (`oraId`) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/mayor-orig/mayor-naplo/log/mayor-naplo.rev b/mayor-orig/mayor-naplo/log/mayor-naplo.rev index 5becefaa..2e58f957 100644 --- a/mayor-orig/mayor-naplo/log/mayor-naplo.rev +++ b/mayor-orig/mayor-naplo/log/mayor-naplo.rev @@ -1 +1 @@ -4632 +4633 diff --git a/mayor-orig/mayor-naplo/update/pre004632-1-naplo.sql b/mayor-orig/mayor-naplo/update/pre004632-1-naplo.sql new file mode 100644 index 00000000..7a2be452 --- /dev/null +++ b/mayor-orig/mayor-naplo/update/pre004632-1-naplo.sql @@ -0,0 +1,18 @@ +DELIMITER $$ +DROP PROCEDURE IF EXISTS upgrade_database_4632 $$ + +CREATE PROCEDURE upgrade_database_4632() +BEGIN +SET NAMES utf8 COLLATE utf8_hungarian_ci; + +IF NOT EXISTS ( + SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE() and TABLE_NAME='oraHazifeladat' and COLUMN_NAME='hazifeladatFeltoltesEngedely' +) THEN + +ALTER TABLE `oraHazifeladat` ADD `hazifeladatFeltoltesEngedely` tinyint unsigned DEFAULT 0; + +END IF; + +END $$ +DELIMITER ; +CALL upgrade_database_4632(); diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php index d0f4cb6b..a26b39fa 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php @@ -55,14 +55,14 @@ $ADAT['oraAdat'] = getOraadatById($oraId); if (__TANAR===true && $action=='hazifeladatBeiras') { - + $hazifeladatFeltoltesEngedely = readVariable($_POST['hazifeladatFeltoltesEngedely'],'id',0); if ($hazifeladatId>0) { // update - $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s' WHERE hazifeladatId=%u"; - $values = array($ADAT['hazifeladatLeiras'],$ADAT['hazifeladatId']); + $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u WHERE hazifeladatId=%u"; + $values = array($ADAT['hazifeladatLeiras'],$hazifeladatFeltoltesEngedely,$ADAT['hazifeladatId']); $r = db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values)); } elseif ($oraId>0) { // insert - $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId) VALUES ('%s',%u)"; - $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId']); + $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId,hazifeladatFeltoltesEngedely) VALUES ('%s',%u,%u)"; + $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId'],$hazifeladatFeltoltesEngedely); $hazifeladatId = db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values)); } diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css index 1169d008..127dfa75 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css @@ -24,8 +24,14 @@ form button.btnHfStatusz:hover span { color: white; } form button.btnHfStatusz.kesz:hover span { color: orange } + #hazifeladatFeltoltesEngedely { + padding:15px 0px 15px 0px; margin:5px 0px; text-align:center; border-radius:2px; background-color:#eee + } + #hazifeladatFeltoltesEngedely.engedelyezve { background-color: #c8e6c9; } - + input.btnSubmit { + margin: 5px auto 5px auto; + } /*---*/ form button.btnLattamStatusz { diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml index a8540faa..cddfd0e8 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml @@ -36,8 +36,9 @@ echo '<fieldset class="adatok '.$_class.'"><legend>'._HAZIFELTOLTES.'</legend>'."\n"; echo formBegin(array('enctype'=>'multipart/form-data')); - if (FILE_UPLOAD_ENABLED===false || $ADAT['hazifeladatDiak']['tanarLattamDt']!='' || $ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') { + if (FILE_UPLOAD_ENABLED===false || $ADAT['hazifeladatAdat']['hazifeladatFeltoltesEngedely'] == 0 || $ADAT['hazifeladatDiak']['tanarLattamDt']!='' || $ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') { if (FILE_UPLOAD_ENABLED===false) $mert = ', mert a feltöltés le van tiltva'; + elseif ($ADAT['hazifeladatAdat']['hazifeladatFeltoltesEngedely']==0) $mert = ', mert a tanár nem kért ide csatolt házi feladatot'; elseif ($ADAT['hazifeladatDiak']['tanarLattamDt']!='') $mert = ', mert már láttamozta a tanár'; elseif ($ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') $mert = ', mert már késznek jelölted a feladatot'; echo '<p style="color:#888">nem tudsz új filet feltölteni'.$mert.'</p>'; @@ -131,11 +132,19 @@ removeButtons: 'Cut,Copy,Paste,PasteText,PasteFromWord,Anchor,Underline,Strike,SpecialChar,HorizontalRule' }); </script>"; - echo '<input type="submit">'; + + $_CHK = ($ADAT['hazifeladatAdat']['hazifeladatFeltoltesEngedely']==1) ? 'checked="checked"':''; + $_cls = ($ADAT['hazifeladatAdat']['hazifeladatFeltoltesEngedely']==1) ? 'class="engedelyezve"':''; + echo '<div id="hazifeladatFeltoltesEngedely" '.$_cls.'>'; + echo '<input type="checkbox" name="hazifeladatFeltoltesEngedely" id="hazifeladatFeltoltesEngedelyChk" value="1" '.$_CHK.'/>'; + echo '<label for="hazifeladatFeltoltesEngedelyChk">Diák/Szülő házi feladat csatolás engedélyezve</label>'; + echo '</div>'; + echo '<div style="width:100%; margin:auto; text-align:center;">'; + echo '<input type="submit" class="btnSubmit">'; + echo '</div>'; echo '</fieldset>'."\n"; if ($skin != 'ajax') formEnd(); - if (count($ADAT['hazifeladatDiak'])>0) { echo '<fieldset class="adatok">'; echo '<legend>Visszajelzések</legend>'; diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/hazifeladat.jquery.min.js b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/hazifeladat.jquery.min.js new file mode 100644 index 00000000..4d225a86 --- /dev/null +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/hazifeladat.jquery.min.js @@ -0,0 +1,12 @@ +$(function() { + + $('input[type="checkbox"]').click(function(){ + if($(this).is(":checked")){ + $('#hazifeladatFeltoltesEngedely').addClass('engedelyezve'); + } + else if($(this).is(":not(:checked)")){ + $('#hazifeladatFeltoltesEngedely').removeClass('engedelyezve'); + } + }); + +});
\ No newline at end of file |