Redesign - tabela s podatki - mass delete

This commit is contained in:
pero1203 2022-03-15 10:40:26 +01:00
parent 33f2030c1f
commit 60543eddbf
3 changed files with 159 additions and 45 deletions

View File

@ -1085,17 +1085,20 @@ class SurveyDataDisplay{
}
// Prikazemo editiranje na dnu (brisanje vecih hkrati...)
public static function displayBottomEdit(){
// Prikazemo brisanje vecih hkrati
public static function displayMassDelete(){
global $lang;
if ((int)self::$_RECORD_COUNT > 0){
echo '<div id="bottom_edit" class="floatLeft'.( self::$displayEditIcons['dataIcons_quick_view'] == true ? '' : ' shifted').'">';
echo '<div class="mass_delete">';
echo '<span class="faicon arrow_up"></span> ';
echo '<span id="switch_on"><a href="javascript:selectAll(1);">'.$lang['srv_select_all'].'</a></span>';
echo '<span id="switch_off" style="display:none;"><a href="javascript:selectAll(0);">'.$lang['srv_deselect_all'].'</a></span>';
echo '&nbsp;&nbsp;<a href="#" onClick="deleteMultipleData();"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_delete_data_multirow'].'"/></span>&nbsp;'.$lang['srv_delete_selected'].'</a>';
echo '<p>'.$lang['srv_delete_infotext'].' '.Help::display('srv_delete_infotext').'</p>';
echo '<span id="switch_on" class="faicon plus_square" onClick="selectAll(1);"></span>';
echo '<span id="switch_off" class="faicon minus_square" onClick="selectAll(0);" style="display:none;"></span>';
//echo '<span id="switch_on"><a href="javascript:selectAll(1);">'.$lang['srv_select_all'].'</a></span>';
//echo '<span id="switch_off" style="display:none;"><a href="javascript:selectAll(0);">'.$lang['srv_deselect_all'].'</a></span>';
echo '<button class="white-black small" onClick="deleteMultipleData();"><span class="faicon delete" title="'.$lang['srv_delete_data_multirow'].'"/></span>'.$lang['srv_delete_selected'].'</button>';
echo '</div>';
}
@ -1535,7 +1538,17 @@ class SurveyDataDisplay{
# colspan za ikonce
if ($stolpci > 0) {
echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'>&nbsp;</td>';
$show_mass_delete = (self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1) ? true : false;
echo '<th class="data_edit" '.($stolpci > 1 ? ('colspan="'.$stolpci.'"') : '').' '.($show_mass_delete ? 'style="min-width:190px"' : '').'>';
// Editiranje na dnu - brisanje vec userjev hkrati...
if($show_mass_delete){
self::displayMassDelete();
}
echo '</th>';
}
# dodamo skrit stolpec uid
@ -1760,20 +1773,24 @@ class SurveyDataDisplay{
echo '<tr class="row_data">';
if ((int)$display1kaIcon == 1) {
echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view icon-as_link"></span></td>';
}
if ($stolpci > 0 ) {
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
// checkbox za brisanje vecih vrstic hkrati
echo '<td class="data_edit" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" id="delete_data_row_'.$cntLines.'" class="delete_data_row" /><label for="delete_data_row_'.$cntLines.'"></label></td>';
echo '<td class="data_edit"><span class="faicon delete_circle icon-orange_link" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
echo '<td class="data_edit"><span class="faicon edit_square icon-as_link" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
echo '<td class="data_edit"><span class="faicon edit smaller icon-as_link" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
}
}
if ((int)$display1kaIcon == 1) {
echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view"></span></td>';
}
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
echo '<td class="data_edit"><span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
echo '<td class="data_edit"><span class="faicon edit" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
echo '<td class="data_edit"><span class="faicon delete" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
}
if (self::$displayEditIcons['dataIcons_write'] == true) {
echo '<td class="data_edit"><span class="faicon pdf icon-as_link" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
echo '<td class="data_edit"><span class="faicon rtf icon-as_link" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
echo '<td class="data_edit"><span class="faicon pdf" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
echo '<td class="data_edit"><span class="faicon rtf" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
// Evoli ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('evoli')) {
@ -1894,12 +1911,6 @@ class SurveyDataDisplay{
if ($_GET['debug'] == 1) {
print_r("<pre>".$_command."</pre>");
}
// Editiranje na dnu - brisanje vec userjev hkrati...
if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1){
self::displayBottomEdit();
}
}
static public function DisplayDataMultipleTable() {
@ -2131,9 +2142,17 @@ class SurveyDataDisplay{
# colspan za ikonce
if ($stolpci > 0) {
//for ($i=0; $i<$stolpci; $i++)
// echo '<th class="data_edit">&nbsp;</th>';
echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'>&nbsp;</th>';
$show_mass_delete = (self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1) ? true : false;
echo '<th class="data_edit" '.($stolpci > 1 ? ('colspan="'.$stolpci.'"') : '').' '.($show_mass_delete ? 'style="min-width:190px"' : '').'>';
// Editiranje na dnu - brisanje vec userjev hkrati...
if($show_mass_delete){
self::displayMassDelete();
}
echo '</th>';
}
# dodamo skrit stolpec uid
@ -2434,21 +2453,24 @@ class SurveyDataDisplay{
echo '<tr>';
if ((int)$display1kaIcon == 1) {
echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view icon-as_link"></span></td>';
}
if ($stolpci > 0 ) {
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
// checkbox za brisanje vecih vrstic hkrati
echo '<td class="data_edit" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" id="delete_data_row_'.$cntLines.'" class="delete_data_row" /><label for="delete_data_row_'.$cntLines.'"></label></td>';
echo '<td class="data_edit"><span class="faicon delete_circle icon-orange_link" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
echo '<td class="data_edit"><span class="faicon edit_square icon-as_link" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
echo '<td class="data_edit"><span class="faicon edit smaller icon-as_link" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
}
}
if ((int)$display1kaIcon == 1) {
echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view"></span></td>';
}
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
echo '<td class="data_edit"><span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
echo '<td class="data_edit"><span class="faicon edit" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
echo '<td class="data_edit"><span class="faicon delete" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
}
if (self::$displayEditIcons['dataIcons_write'] == true) {
echo '<td class="data_edit"><span class="faicon pdf icon-as_link" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
echo '<td class="data_edit"><span class="faicon rtf icon-as_link" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
echo '<td class="data_edit"><span class="faicon pdf" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
echo '<td class="data_edit"><span class="faicon rtf" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
}
}
@ -2534,11 +2556,6 @@ class SurveyDataDisplay{
if ($_GET['debug'] == 1) {
print_r("<pre>".$_command."</pre>");
}
// Editiranje na dnu - brisanje vec userjev hkrati...
if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1){
self::displayBottomEdit();
}
}
public static function url_to_link($text) {

View File

@ -16690,11 +16690,34 @@ dl.arch_email dd {
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon {
cursor: pointer;
}
#div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.quick_view:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.quick_view:before,
#div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon:before {
font-size: 14px;
transition: 0.2s;
}
#div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.edit:before, #div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.edit_square:before, #div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.delete:before, #div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.quick_view:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.edit:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.edit_square:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.delete:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.quick_view:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon.edit:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon.edit_square:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon.delete:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon.quick_view:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon.edit:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon.edit_square:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon.delete:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon.quick_view:before {
color: #1E88E5;
}
#div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.edit:hover:before, #div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.edit_square:hover:before, #div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.delete:hover:before, #div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon .faicon.quick_view:hover:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.edit:hover:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.edit_square:hover:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.delete:hover:before, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit .faicon.quick_view:hover:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon.edit:hover:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon.edit_square:hover:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon.delete:hover:before,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon .faicon.quick_view:hover:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon.edit:hover:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon.edit_square:hover:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon.delete:hover:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit .faicon.quick_view:hover:before {
color: #0059ab;
}
#div_vnosi_data #tableContainer table#dataTable tr td.enkaIcon label, #div_vnosi_data #tableContainer table#dataTable tr td.data_edit label,
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon label,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit label {
@ -16704,6 +16727,7 @@ dl.arch_email dd {
#div_vnosi_data #tableContainer table#dataTable tr th.enkaIcon label:before,
#div_vnosi_data #tableContainer table#dataTable tr th.data_edit label:before {
letter-spacing: 0;
font-size: 16px;
}
#div_vnosi_data #tableContainer table#dataTable tr td.data_uid,
#div_vnosi_data #tableContainer table#dataTable tr th.data_uid {
@ -16725,6 +16749,30 @@ dl.arch_email dd {
#div_vnosi_data #tableContainer table#dataTable thead tr.row3 th {
cursor: pointer;
}
#div_vnosi_data #tableContainer table#dataTable thead tr.row3 th .mass_delete {
display: flex;
}
#div_vnosi_data #tableContainer table#dataTable thead tr.row3 th .mass_delete > .faicon {
margin: 5px 0 0 13px;
}
#div_vnosi_data #tableContainer table#dataTable thead tr.row3 th .mass_delete > .faicon:before {
color: #1E88E5;
font-size: 16px;
font-weight: 700;
}
#div_vnosi_data #tableContainer table#dataTable thead tr.row3 th .mass_delete button {
width: auto;
min-width: auto;
height: 28px;
padding: 0 16px;
margin-left: 12px;
font-weight: 400;
border: 1px solid #E5E5E5;
border-radius: 2px;
}
#div_vnosi_data #tableContainer table#dataTable thead tr.row3 th .mass_delete button .faicon {
margin-right: 8px;
}
#div_vnosi_data #tableContainer table#dataTable tbody tr td {
height: 40px;
max-height: 40px;

View File

@ -54,8 +54,25 @@
.faicon{
cursor: pointer;
&.quick_view:before{
color: $blue;
&:before{
font-size: 14px;
transition: 0.2s;
}
&.edit,
&.edit_square,
&.delete,
&.quick_view{
&:before{
color: $blue;
}
&:hover{
&:before{
color: $dark-blue;
}
}
}
}
@ -64,6 +81,7 @@
&:before{
letter-spacing: 0;
font-size: 16px;
}
}
}
@ -98,6 +116,37 @@
&.row3 th{
cursor: pointer;
.mass_delete{
display: flex;
>.faicon{
margin: 5px 0 0 13px;
&:before{
color: $blue;
font-size: 16px;
font-weight: 700;
}
}
button{
width: auto;
min-width: auto;
height: 28px;
padding: 0 16px;
margin-left: 12px;
font-weight: 400;
border: 1px solid $gray;
border-radius: 2px;
.faicon{
margin-right: 8px;
}
}
}
}
}