saimod_person
This commit is contained in:
parent
7674904eb3
commit
791a7c789e
@ -24,7 +24,7 @@ class default_page implements \SYSTEM\PAGE\DefaultPage {
|
||||
$_content_imgs = '';
|
||||
$_content_details = '';
|
||||
|
||||
$persons = \SQL\SELECT_PERSONS::QQ();
|
||||
$persons = \SQL\SELECT_PERSONS_VISIBLE::QQ();
|
||||
$person_badges = \SQL\SELECT_BADGES_VISIBLE::QA(array(\SAI\saimod_project::BADGE_TYPE_PERSON_ABILITIES)); // This part we filter phpside due to performance.
|
||||
$person_projects= \SQL\SELECT_PERSON_PROJECTS::QA(); // This part we filter phpside due to performance.
|
||||
while($row = $persons->next()){
|
||||
|
||||
@ -14,7 +14,7 @@ namespace SQL;
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class SELECT_PERSONS extends \SYSTEM\DB\QQ {
|
||||
class SELECT_PERSONS_VISIBLE extends \SYSTEM\DB\QQ {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
@ -1,2 +1,3 @@
|
||||
<?php
|
||||
require_once dirname(__FILE__).'/saimod_project/autoload.inc';
|
||||
require_once dirname(__FILE__).'/saimod_project/autoload.inc';
|
||||
require_once dirname(__FILE__).'/saimod_person/autoload.inc';
|
||||
5
wecker_manufaktur/sai/saimod_person/autoload.inc
Normal file
5
wecker_manufaktur/sai/saimod_person/autoload.inc
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
require_once dirname(__FILE__).'/sql/autoload.inc';
|
||||
require_once dirname(__FILE__).'/path/autoload.inc';
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SAI');
|
||||
\SYSTEM\SAI\sai::register('\SAI\saimod_person');
|
||||
398
wecker_manufaktur/sai/saimod_person/js/saimod_person.js
Normal file
398
wecker_manufaktur/sai/saimod_person/js/saimod_person.js
Normal file
@ -0,0 +1,398 @@
|
||||
function init_saimod_person() {
|
||||
$('#btn_search').click(function(){
|
||||
system.load($(this).attr('state')+$('#input_search').val(),true);
|
||||
});
|
||||
|
||||
$('#btn-person-del').click(function(){
|
||||
var persons = [];
|
||||
$('.person-check:checked').each(function() {
|
||||
persons.push($(this).attr('person'));
|
||||
});
|
||||
if (confirm('Are you sure you want to delete '+persons.length+' Persons PERMANENTLY?')) {
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'person_delete',
|
||||
data: persons
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('.person-order-up').click(function(e){
|
||||
e.preventDefault();
|
||||
person = $(this).attr('person');
|
||||
order = $(this).attr('order');
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'person_order',
|
||||
data: {
|
||||
action: 'up',
|
||||
person: person,
|
||||
order: order
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.person-order-down').click(function(e){
|
||||
e.preventDefault();
|
||||
person = $(this).attr('person');
|
||||
order = $(this).attr('order');
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'person_order',
|
||||
data: {
|
||||
action: 'down',
|
||||
person: person,
|
||||
order: order
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.person-visibility').click(function(){
|
||||
person = $(this).attr('person');
|
||||
visibility = $(this).val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'person_visibility',
|
||||
data: {
|
||||
person: person,
|
||||
visibility: visibility
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function init_saimod_person_new(){
|
||||
// Image Preview
|
||||
$('#input-person-image').change(function(){
|
||||
$('#output-person-image').attr('src','./files/persons/'+$(this).val())
|
||||
});
|
||||
|
||||
// Update Button
|
||||
$('#btn-person-save').click(function(e){
|
||||
e.preventDefault();
|
||||
img = $('#input-person-image').val();
|
||||
name = $('#input-person-name').val();
|
||||
info = $('#input-person-info').val();
|
||||
visibility = $('#input-person-visibility').val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'person_save',
|
||||
data: {
|
||||
img: img,
|
||||
name: name,
|
||||
info: info,
|
||||
visibility: visibility,
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.back();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#input-person-image').trigger('change');
|
||||
}
|
||||
|
||||
function init_saimod_person_details(){
|
||||
// Image Preview
|
||||
$('#input-person-image').change(function(){
|
||||
$('#output-person-image').attr('src','./files/persons/'+$(this).val())
|
||||
});
|
||||
|
||||
// Badge Preview Text
|
||||
$('.input-badge-badge, #input-ability-badge').on('input',function(){
|
||||
$(this).parent().parent().find('.badge').html($(this).val());
|
||||
});
|
||||
// Badge Preview Color
|
||||
$('.input-badge-color, #input-ability-color').change(function(){
|
||||
$(this).parent().parent().find('.badge').removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)badge-\S+/g) || []).join(' ');
|
||||
});
|
||||
$(this).parent().parent().find('.badge').addClass($(this).val());
|
||||
});
|
||||
|
||||
// Ability New Button
|
||||
$('#btn-person-ability-new').click(function(){
|
||||
person = $(this).attr('person');
|
||||
badge = $('#input-ability-badge').val();
|
||||
color = $('#input-ability-color').val();
|
||||
visibility = $('#input-ability-visibility').val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'person_ability_new',
|
||||
data: {
|
||||
person: person,
|
||||
badge: badge,
|
||||
color: color,
|
||||
visibility: visibility
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Badges Visibility
|
||||
$('.badge-visibility').click(function(){
|
||||
badge = $(this).attr('badge');
|
||||
visibility = $(this).val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'badge_visibility',
|
||||
data: {
|
||||
badge: badge,
|
||||
visibility: visibility
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Badge Order
|
||||
$('.badge-order-up').click(function(e){
|
||||
e.preventDefault();
|
||||
badge = $(this).attr('badge');
|
||||
type = $(this).attr('type');
|
||||
ref_id = $(this).attr('ref_id');
|
||||
order = $(this).attr('order');
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'badge_order',
|
||||
data: {
|
||||
action: 'up',
|
||||
badge: badge,
|
||||
type: type,
|
||||
ref_id: ref_id,
|
||||
order: order
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.badge-order-down').click(function(e){
|
||||
e.preventDefault();
|
||||
badge = $(this).attr('badge');
|
||||
type = $(this).attr('type');
|
||||
ref_id = $(this).attr('ref_id');
|
||||
order = $(this).attr('order');
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'badge_order',
|
||||
data: {
|
||||
action: 'down',
|
||||
badge: badge,
|
||||
type: type,
|
||||
ref_id: ref_id,
|
||||
order: order
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Badges Delete
|
||||
$('#btn-abilities-del').click(function(){
|
||||
var badges = [];
|
||||
$(this).parent().parent().parent().parent().find('.badge-check:checked').each(function() {
|
||||
badges.push($(this).attr('badge'));
|
||||
});
|
||||
if (confirm('Are you sure you want to delete '+badges.length+' Badges PERMANENTLY?')) {
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'badge_delete',
|
||||
data: badges
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Back Button
|
||||
$('.btn-person-back').click(function(){
|
||||
system.back();
|
||||
});
|
||||
|
||||
// Update Button
|
||||
$('#btn-person-update').click(function(e){
|
||||
e.preventDefault();
|
||||
person = $(this).attr('person');
|
||||
img = $('#input-person-image').val();
|
||||
name = $('#input-person-name').val();
|
||||
info = $('#input-person-info').val();
|
||||
visibility = $('#input-person-visibility').val();
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SAI.saimod_person',
|
||||
action: 'person_update',
|
||||
data: {
|
||||
person: person,
|
||||
img: img,
|
||||
name: name,
|
||||
info: info,
|
||||
visibility: visibility,
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
system.reload();
|
||||
} else {
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
6
wecker_manufaktur/sai/saimod_person/path/PPERSON.php
Normal file
6
wecker_manufaktur/sai/saimod_person/path/PPERSON.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace SAI;
|
||||
class PPERSON extends \SYSTEM\PATH {
|
||||
public function __construct($subpath = '') {
|
||||
parent::__construct(new \PSAI(), 'saimod_person/', $subpath);}
|
||||
}
|
||||
2
wecker_manufaktur/sai/saimod_person/path/autoload.inc
Normal file
2
wecker_manufaktur/sai/saimod_person/path/autoload.inc
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SAI');
|
||||
211
wecker_manufaktur/sai/saimod_person/saimod_person.php
Normal file
211
wecker_manufaktur/sai/saimod_person/saimod_person.php
Normal file
@ -0,0 +1,211 @@
|
||||
<?php
|
||||
namespace SAI;
|
||||
class saimod_person extends \SYSTEM\SAI\sai_module{
|
||||
|
||||
public static function sai_mod__SAI_saimod_person($search='%',$page=0){
|
||||
$vars = array();
|
||||
$vars['search'] = $search;
|
||||
$vars['page'] = $page;
|
||||
$vars['data'] = '';
|
||||
|
||||
$count = \SQL\COUNT_PERSONS::Q1(array($search,$search))['count'];
|
||||
$abilities = \SQL\SELECT_BADGES_VISIBLE::QA(array(\SAI\saimod_project::BADGE_TYPE_PERSON_ABILITIES)); // This part we filter phpside due to performance.
|
||||
$res = \SQL\SELECT_PERSONS::QQ(array($search,$search));
|
||||
$res->seek(25*$page);
|
||||
|
||||
$count_filtered = 0;
|
||||
while(($row = $res->next()) && ($count_filtered < 25)){
|
||||
$fabilities = array_filter($abilities, function($v)use($row){return $v['ref_id'] == $row['id'];});
|
||||
$row['abilities'] = '';
|
||||
foreach($fabilities as $a){
|
||||
$row['abilities'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/content_badge.tpl'))->SERVERPATH(),$a);
|
||||
}
|
||||
|
||||
$row['selected_invisible'] = $row['visible'] !== 1 ? 'selected' : '';
|
||||
$row['selected_visible'] = $row['visible'] == 1 ? 'selected' : '';
|
||||
|
||||
$vars['data'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/saimod_person_tr.tpl'))->SERVERPATH(),$row);
|
||||
$count_filtered++;
|
||||
}
|
||||
// Pagintation
|
||||
$vars['pagination'] = '';
|
||||
$vars['page_last'] = floor($count/25);
|
||||
for($i=0;$i < ceil($count/25);$i++){
|
||||
$data = array('page' => $i,'search' => $search, 'active' => ($i == $page) ? 'active' : '');
|
||||
$vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/saimod_person_pagination.tpl'))->SERVERPATH(), $data);
|
||||
}
|
||||
$vars['count'] = ($count_filtered+$page*25).'/'.$count;
|
||||
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/saimod_person.tpl'))->SERVERPATH(),$vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_person_action_person_delete($data){
|
||||
foreach($data as $id){
|
||||
\SQL\DELETE_PERSON::QI(array($id));
|
||||
\SQL\DELETE_BADGES::QI(array(self::BADGE_TYPE_PERSON_ABILITIES,$id));
|
||||
}
|
||||
return \JsonResult::ok();
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_person_action_person_order($data){
|
||||
$person = $data['person'];
|
||||
switch($data['action']){
|
||||
case 'up':
|
||||
$new_order = $data['order'] -1;
|
||||
$new_order = $new_order > 0 ? $new_order : 1;
|
||||
\SQL\UPDATE_PERSON_ORDER_DOWN_ORDER::QI(array($new_order));
|
||||
\SQL\UPDATE_PERSON_ORDER_DOWN_ID::QI(array($person));
|
||||
break;
|
||||
case 'down':
|
||||
$new_order = $data['order'] +1;
|
||||
\SQL\UPDATE_PERSON_ORDER_UP_ORDER::QI(array($new_order));
|
||||
\SQL\UPDATE_PERSON_ORDER_UP_ID::QI(array($person));
|
||||
break;
|
||||
default:
|
||||
throw new \SYSTEM\LOG\ERROR('Operration not supported');
|
||||
}
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_person_action_person_visibility($data){
|
||||
\SQL\UPDATE_PERSON_VISIBILITY::QI(array($data['visibility'],$data['person']));
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_person_action_person_new(){
|
||||
$vars = array();
|
||||
|
||||
//images
|
||||
$images = \SYSTEM\FILES\files::get('persons');
|
||||
$vars['images'] = '';
|
||||
foreach($images as $image){
|
||||
$img = ['name' => $image, 'selected' => ''];
|
||||
$vars['images'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/saimod_person_image_file.tpl'))->SERVERPATH(),$img);
|
||||
}
|
||||
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/saimod_person_new.tpl'))->SERVERPATH(),$vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_person_action_person_save($data){
|
||||
return \SYSTEM\LOG\JsonResult::status(
|
||||
\SQL\INSERT_PERSON::QI(array( $data['img'],
|
||||
$data['name'],
|
||||
$data['info'],
|
||||
$data['visibility']))
|
||||
);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_person_action_person_details($person){
|
||||
// $vars = array();
|
||||
$vars = \SQL\SELECT_PERSON::Q1(array($person));
|
||||
|
||||
$vars['selected_invisible'] = $vars['visible'] !== 1 ? 'selected' : '';
|
||||
$vars['selected_visible'] = $vars['visible'] == 1 ? 'selected' : '';
|
||||
|
||||
//images
|
||||
$images = \SYSTEM\FILES\files::get('persons');
|
||||
$vars['images'] = '';
|
||||
foreach($images as $image){
|
||||
$img = ['name' => $image, 'selected' => $vars['img'] == $image ? 'selected' : ''];
|
||||
$vars['images'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/saimod_person_image_file.tpl'))->SERVERPATH(),$img);
|
||||
}
|
||||
|
||||
// Abilities
|
||||
$vars['abilities'] = '';
|
||||
$abilities = \SQL\SELECT_BADGES::QQ(array(\SAI\saimod_project::BADGE_TYPE_PERSON_ABILITIES,$person));
|
||||
while($row = $abilities->next()){
|
||||
$row['selected_invisible'] = $row['visible'] !== 1 ? 'selected' : '';
|
||||
$row['selected_visible'] = $row['visible'] == 1 ? 'selected' : '';
|
||||
|
||||
$row['badge_colors'] = self::badge_color_options($row['color']);
|
||||
|
||||
$vars['abilities'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/saimod_person_badge_tr.tpl'))->SERVERPATH(),$row);
|
||||
}
|
||||
|
||||
$vars['badge_colors'] = self::badge_color_options();
|
||||
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/saimod_person_details.tpl'))->SERVERPATH(),$vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_person_action_person_update($data){
|
||||
return \SYSTEM\LOG\JsonResult::status(
|
||||
\SQL\UPDATE_PERSON::QI(array( $data['img'],
|
||||
$data['name'],
|
||||
$data['info'],
|
||||
$data['visibility'],
|
||||
$data['person']))
|
||||
);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_person_action_person_ability_new($data){
|
||||
return \SYSTEM\LOG\JsonResult::status(
|
||||
\SQL\INSERT_BADGE::QI(array(\SAI\saimod_project::BADGE_TYPE_PERSON_ABILITIES,
|
||||
$data['person'],
|
||||
$data['badge'],
|
||||
$data['color'],
|
||||
\SAI\saimod_project::BADGE_TYPE_PERSON_ABILITIES,
|
||||
$data['person'],
|
||||
$data['visibility']))
|
||||
);
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_person_action_badge_visibility($data){
|
||||
\SQL\UPDATE_BADGE_VISIBILITY::QI(array($data['visibility'],$data['badge']));
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_person_action_badge_order($data){
|
||||
$badge = $data['badge'];
|
||||
$type = $data['type'];
|
||||
$ref_id = $data['ref_id'];
|
||||
switch($data['action']){
|
||||
case 'up':
|
||||
$new_order = $data['order'] -1;
|
||||
$new_order = $new_order > 0 ? $new_order : 1;
|
||||
\SQL\UPDATE_BADGE_ORDER_DOWN_ORDER::QI(array($type,$ref_id,$new_order));
|
||||
\SQL\UPDATE_BADGE_ORDER_DOWN_ID::QI(array($badge));
|
||||
break;
|
||||
case 'down':
|
||||
$new_order = $data['order'] +1;
|
||||
\SQL\UPDATE_BADGE_ORDER_UP_ORDER::QI(array($type,$ref_id,$new_order));
|
||||
\SQL\UPDATE_BADGE_ORDER_UP_ID::QI(array($badge));
|
||||
break;
|
||||
default:
|
||||
throw new \SYSTEM\LOG\ERROR('Operration not supported');
|
||||
}
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_person_action_badge_delete($data){
|
||||
foreach($data as $id){
|
||||
\SQL\DELETE_BADGE::QI(array($id));
|
||||
}
|
||||
return \JsonResult::ok();
|
||||
}
|
||||
|
||||
private static function badge_color_options($selected = null){
|
||||
$colors = array(
|
||||
'badge-primary',
|
||||
'badge-secondary',
|
||||
'badge-success',
|
||||
'badge-danger',
|
||||
'badge-warning',
|
||||
'badge-info',
|
||||
'badge-light',
|
||||
'badge-dark'
|
||||
);
|
||||
$result = '';
|
||||
foreach($colors as $color){
|
||||
$vars = array('value' => $color, 'selected' => $color == $selected ? 'selected' : '');
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/badge_color_option.tpl'))->SERVERPATH(),$vars);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function menu(){
|
||||
return new \SYSTEM\SAI\sai_module_menu( 102,
|
||||
\SYSTEM\SAI\sai_module_menu::POISITION_LEFT,
|
||||
\SYSTEM\SAI\sai_module_menu::DIVIDER_NONE,
|
||||
\SYSTEM\PAGE\replace::replaceFile((new \SAI\PPERSON('tpl/menu.tpl'))->SERVERPATH()));}
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return \SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||
|
||||
public static function js(){
|
||||
return array(new \SAI\PPERSON('js/saimod_person.js'));}
|
||||
}
|
||||
13
wecker_manufaktur/sai/saimod_person/sql/COUNT_PERSONS.php
Normal file
13
wecker_manufaktur/sai/saimod_person/sql/COUNT_PERSONS.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class COUNT_PERSONS extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT COUNT(*) as `count`'.
|
||||
' FROM persons'.
|
||||
' WHERE ( persons.name LIKE ? OR
|
||||
persons.info LIKE ?
|
||||
);';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
class DATA_SAIMOD_PERSON extends \SYSTEM\DB\QI {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function files_mysql(){
|
||||
return array( (new \SAI\PPERSON('sql/mysql/system_page.sql'))->SERVERPATH(),
|
||||
(new \SAI\PPERSON('sql/mysql/system_api.sql'))->SERVERPATH());
|
||||
}
|
||||
}
|
||||
33
wecker_manufaktur/sai/saimod_person/sql/DELETE_PERSON.php
Normal file
33
wecker_manufaktur/sai/saimod_person/sql/DELETE_PERSON.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class DELETE_PERSON extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'DELETE FROM `persons` WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class DELETE_PERSON_PROJECTS_PERSON extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'DELETE FROM `person_projects` WHERE `person` = ?;';
|
||||
}
|
||||
}
|
||||
35
wecker_manufaktur/sai/saimod_person/sql/INSERT_PERSON.php
Normal file
35
wecker_manufaktur/sai/saimod_person/sql/INSERT_PERSON.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class INSERT_PERSON extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'INSERT INTO `persons` (`img`, `name`, `info`, `order`, `visible`)'.
|
||||
' VALUES(?, ?, ?, (IFNULL((SELECT MAX(`order`)+1 FROM `persons` as `p`),1)), ?);';
|
||||
|
||||
}
|
||||
}
|
||||
35
wecker_manufaktur/sai/saimod_person/sql/SELECT_PERSON.php
Normal file
35
wecker_manufaktur/sai/saimod_person/sql/SELECT_PERSON.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class SELECT_PERSON extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'SELECT *'.
|
||||
' FROM `persons`'.
|
||||
' WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
38
wecker_manufaktur/sai/saimod_person/sql/SELECT_PERSONS.php
Normal file
38
wecker_manufaktur/sai/saimod_person/sql/SELECT_PERSONS.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class SELECT_PERSONS extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'SELECT *'.
|
||||
' FROM `persons`'.
|
||||
' WHERE ( persons.name LIKE ? OR
|
||||
persons.info LIKE ?
|
||||
)'.
|
||||
' ORDER BY `order`;';
|
||||
}
|
||||
}
|
||||
36
wecker_manufaktur/sai/saimod_person/sql/UPDATE_PERSON.php
Normal file
36
wecker_manufaktur/sai/saimod_person/sql/UPDATE_PERSON.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* System - PHP Framework
|
||||
*
|
||||
* PHP Version 5.6
|
||||
*
|
||||
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link https://github.com/webcraftmedia/system
|
||||
* @package SYSTEM\SQL
|
||||
*/
|
||||
namespace SQL;
|
||||
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class UPDATE_PERSON extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
* @return string Returns classname
|
||||
*/
|
||||
public static function get_class(){return \get_class();}
|
||||
|
||||
/**
|
||||
* Get QQs MYSQL Query String
|
||||
*
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'UPDATE `persons`'.
|
||||
' SET `img` = ?, `name` = ?, `info` = ?, visible = ?'.
|
||||
' WHERE `id` = ?;';
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PERSON_ORDER_DOWN_ID extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `persons` SET `order`=`order` - 1 WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PERSON_ORDER_DOWN_ORDER extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `persons` SET `order`=`order` + 1 WHERE `order` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PERSON_ORDER_UP_ID extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `persons` SET `order`=`order` + 1 WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PERSON_ORDER_UP_ORDER extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `persons` SET `order`=`order` - 1 WHERE `order` = ?;';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UPDATE_PERSON_VISIBILITY extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE `persons` SET `visible` = ? WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
4
wecker_manufaktur/sai/saimod_person/sql/autoload.inc
Normal file
4
wecker_manufaktur/sai/saimod_person/sql/autoload.inc
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SQL');
|
||||
|
||||
\SYSTEM\SQL\setup::register(SQL\DATA_SAIMOD_PERSON::class);
|
||||
17
wecker_manufaktur/sai/saimod_person/sql/mysql/system_api.sql
Normal file
17
wecker_manufaktur/sai/saimod_person/sql/mysql/system_api.sql
Normal file
@ -0,0 +1,17 @@
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10000, 42, 0, 0, '_SAI_saimod_person', 'action', NULL);
|
||||
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10001, 42, 3, 0, '_SAI_saimod_person', 'search', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10002, 42, 3, 0, '_SAI_saimod_person', 'page', 'UINT0');
|
||||
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10010, 42, 2, 10000, 'person_delete', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10011, 42, 2, 10000, 'person_update', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10020, 42, 2, 10000, 'person_order', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10030, 42, 2, 10000, 'person_visibility', 'data', 'JSON');
|
||||
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10040, 42, 2, 10000, 'person_details', 'person', 'UINT0');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10041, 42, 2, 10000, 'person_ability_new', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10043, 42, 2, 10000, 'badge_visibility', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10044, 42, 2, 10000, 'badge_order', 'data', 'JSON');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10045, 42, 2, 10000, 'badge_delete', 'data', 'JSON');
|
||||
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10050, 42, 2, 10000, 'person_save', 'data', 'JSON');
|
||||
@ -0,0 +1,3 @@
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (1000, 42, 'person', 'person', -1, 0, 0, '#content', './sai.php?sai_mod=.SAI.saimod_person&search=${search}&page=${page}', 'init_saimod_person', '\\SAI\\saimod_person');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (1010, 42, 'new', 'person', 1000, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_person&action=person_new', 'init_saimod_person_new', '\\SAI\\saimod_person');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (1020, 42, 'details', 'person', 1000, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_person&action=person_details&person=${person}', 'init_saimod_person_details', '\\SAI\\saimod_person');
|
||||
@ -0,0 +1 @@
|
||||
<option value="${value}" ${selected}>${value}</option>
|
||||
@ -0,0 +1 @@
|
||||
<span class="badge ${color}">${badge}</span>
|
||||
7
wecker_manufaktur/sai/saimod_person/tpl/menu.tpl
Normal file
7
wecker_manufaktur/sai/saimod_person/tpl/menu.tpl
Normal file
@ -0,0 +1,7 @@
|
||||
<li class="nav-item">
|
||||
<a id="menu_person" class="nav-link" data-toggle="tooltip" data-placement="bottom" title="Person" href="#!person">
|
||||
<span class="d-lg-none" style="padding-left: 15px;"></span>
|
||||
<i class="fa fa-users" aria-hidden="true"></i>
|
||||
<span class="d-lg-none"> Person</span>
|
||||
</a>
|
||||
</li>
|
||||
39
wecker_manufaktur/sai/saimod_person/tpl/saimod_person.tpl
Normal file
39
wecker_manufaktur/sai/saimod_person/tpl/saimod_person.tpl
Normal file
@ -0,0 +1,39 @@
|
||||
<div class="row">
|
||||
<div class="table-responsive sai_padding_off">
|
||||
<table class="table table-striped table-condensed tablesorter sai_margin_off" id="table_persons">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7">
|
||||
Rows: ${count} Page: ${page}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="6">
|
||||
<input class="input-medium search-query action-control" id="input_search" type="text" placeholder="Search" size="40" style="width: 100%;" value="${search}"/>
|
||||
</th>
|
||||
<th>
|
||||
<button class="btn-sm btn btn-success" state="person;search." id="btn_search" type="submit" style="width: 100%;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>Search</button>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image</th>
|
||||
<th>Name</th>
|
||||
<th>Info</th>
|
||||
<th>Abilities</th>
|
||||
<th>Order</th>
|
||||
<th>Visible</th>
|
||||
<th>
|
||||
<button type="button" id="btn-person-del" class="btn btn-sm btn-danger pull-right"><i class="fa fa-trash"></i></button>
|
||||
<button type="button" id="btn-person-new" class="btn btn-sm btn-success pull-right" onclick="system.load('person(new)')" style="margin-right: 10px;"><i class="fa fa-plus"></i></button>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>${data}</tbody>
|
||||
</table>
|
||||
<ul class="pagination flex-wrap">
|
||||
<li class="page-item"><a class="page-link" href="#!person;search.${search};page.0">«</a></li>
|
||||
${pagination}
|
||||
<li class="page-item"><a class="page-link" href="#!person;search.${search};page.${page_last}">»</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,19 @@
|
||||
<tr>
|
||||
<td><span class="badge ${color}">${badge}</span></td>
|
||||
<td>${badge}</td>
|
||||
<td>${color}</td>
|
||||
<td style="font-size: 30px">
|
||||
<a href="#" class="badge-order-up" badge="${id}" type="${type}" ref_id="${ref_id}" order="${order}"><i class="fa fa-caret-up"></i></a>
|
||||
<a href="#" class="badge-order-down" badge="${id}" type="${type}" ref_id="${ref_id}" order="${order}" order="${order}"><i class="fa fa-caret-down"></i></a>
|
||||
${order}
|
||||
</td>
|
||||
<td>
|
||||
<select class="badge-visibility form-control" badge="${id}">
|
||||
<option value="0" ${selected_invisible}>Invisible</option>
|
||||
<option value="1" ${selected_visible}>Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" class="pull-right badge-check" badge="${id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
@ -0,0 +1,92 @@
|
||||
<div class="row">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed tablesorter sai_margin_off" id="table-person-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<img id="output-person-image" src="./files/persons/${img}" alt="Image Not Found" style="width: 150px; height: 150px;"/>
|
||||
</th>
|
||||
<td>
|
||||
<select id="input-person-image" class="form-control">
|
||||
${images}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td><input id="input-person-name" class="form-control" type="text" value="${name}" style="width: 100%"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Info</th>
|
||||
<td><textarea id="input-person-info" class="form-control" style="width: 100%; min-height: 100px;">${info}</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Visibility</th>
|
||||
<td>
|
||||
<select id="input-person-visibility" class="form-control" person="${id}">
|
||||
<option value="0" ${selected_invisible}>Invisible</option>
|
||||
<option value="1" ${selected_visible}>Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<button class="btn btn-sm btn-default btn-person-back" ><i class="fa fa-angle-left"></i> Back</button>
|
||||
<button id="btn-person-update" class="btn btn-sm btn-success pull-right" person="${id}"><i class="fa fa-edit"></i> Update</button>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">Abilities</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<table class="table table-striped table-condensed tablesorter sai_margin_off" id="table-person-abilities">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Preview</th>
|
||||
<th>Badge</th>
|
||||
<th>Color</th>
|
||||
<th>Order</th>
|
||||
<th>Visible</th>
|
||||
<th>
|
||||
<button type="button" id="btn-abilities-del" class="btn btn-sm btn-danger pull-right"><i class="fa fa-trash"></i></button>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${abilities}
|
||||
<tr>
|
||||
<td><span class="badge badge-primary"></span></td>
|
||||
<td><input id="input-ability-badge" class="form-control" type="text" style="width: 100%"/></td>
|
||||
<td>
|
||||
<select id="input-ability-color" class="form-control">
|
||||
${badge_colors}
|
||||
</select>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<select id="input-ability-visibility" class="form-control">
|
||||
<option value="0" >Invisible</option>
|
||||
<option value="1" selected>Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" id="btn-person-ability-new" class="btn btn-sm btn-success pull-right" person="${id}"><i class="fa fa-plus"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<button class="btn btn-sm btn-default btn-person-back" ><i class="fa fa-angle-left"></i> Back</button>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
<option value="${name}" ${selected}>${name}</option>
|
||||
@ -0,0 +1,41 @@
|
||||
<div class="row">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed tablesorter sai_margin_off" id="table-person-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<img id="output-person-image" src="./files/persons/" alt="Image Not Found" style="width: 150px; height: 150px;"/>
|
||||
</th>
|
||||
<td>
|
||||
<select id="input-person-image" class="form-control">
|
||||
${images}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td><input id="input-person-name" class="form-control" type="text" style="width: 100%"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Info</th>
|
||||
<td><textarea id="input-person-info" class="form-control" style="width: 100%; min-height: 100px;"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Visibility</th>
|
||||
<td>
|
||||
<select id="input-person-visibility" class="form-control">
|
||||
<option value="0">Invisible</option>
|
||||
<option value="1">Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<button class="btn btn-sm btn-default btn-person-back" ><i class="fa fa-angle-left"></i> Back</button>
|
||||
<button id="btn-person-save" class="btn btn-sm btn-success pull-right""><i class="fa fa-save"></i> Save</button>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
<li class="page-item ${active}"><a class="page-link" href="#!person;search.${search};page.${page}">${page}</a></li>
|
||||
20
wecker_manufaktur/sai/saimod_person/tpl/saimod_person_tr.tpl
Normal file
20
wecker_manufaktur/sai/saimod_person/tpl/saimod_person_tr.tpl
Normal file
@ -0,0 +1,20 @@
|
||||
<tr>
|
||||
<td><a href="#!person(details);person.${id}"><img src="./files/persons/${img}" style="width: 50px; height: 50px;"/></a></td>
|
||||
<td><a href="#!person(details);person.${id}">${name}</a></td>
|
||||
<td>${info}</td>
|
||||
<td>${abilities}</td>
|
||||
<td style="font-size: 30px">
|
||||
<a href="#" class="person-order-up" person="${id}" order="${order}"><i class="fa fa-caret-up"></i></a>
|
||||
<a href="#" class="person-order-down" person="${id}" order="${order}"><i class="fa fa-caret-down"></i></a>
|
||||
${order}
|
||||
</td>
|
||||
<td>
|
||||
<select class="person-visibility form-control" person="${id}">
|
||||
<option value="0" ${selected_invisible}>Invisible</option>
|
||||
<option value="1" ${selected_visible}>Visible</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" class="pull-right person-check" person="${id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
@ -35,7 +35,7 @@ class saimod_project extends \SYSTEM\SAI\sai_module{
|
||||
$row['selected_invisible'] = $row['visible'] !== 1 ? 'selected' : '';
|
||||
$row['selected_visible'] = $row['visible'] == 1 ? 'selected' : '';
|
||||
|
||||
$vars['data'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPROJECT('tpl/saimod_projects_tr.tpl'))->SERVERPATH(),$row);
|
||||
$vars['data'] .= \SYSTEM\PAGE\replace::replaceFile((new \SAI\PPROJECT('tpl/saimod_project_tr.tpl'))->SERVERPATH(),$row);
|
||||
$count_filtered++;
|
||||
}
|
||||
// Pagintation
|
||||
@ -123,7 +123,7 @@ class saimod_project extends \SYSTEM\SAI\sai_module{
|
||||
|
||||
// Focus
|
||||
$vars['focus'] = '';
|
||||
$focus = \SQL\SELECT_BADGES_PROJECT::QQ(array(self::BADGE_TYPE_PROJECT_FOCUS,$project));
|
||||
$focus = \SQL\SELECT_BADGES::QQ(array(self::BADGE_TYPE_PROJECT_FOCUS,$project));
|
||||
while($row = $focus->next()){
|
||||
$row['selected_invisible'] = $row['visible'] !== 1 ? 'selected' : '';
|
||||
$row['selected_visible'] = $row['visible'] == 1 ? 'selected' : '';
|
||||
@ -135,7 +135,7 @@ class saimod_project extends \SYSTEM\SAI\sai_module{
|
||||
|
||||
// Type
|
||||
$vars['type'] = '';
|
||||
$type = \SQL\SELECT_BADGES_PROJECT::QQ(array(self::BADGE_TYPE_PROJECT_TYPE,$project));
|
||||
$type = \SQL\SELECT_BADGES::QQ(array(self::BADGE_TYPE_PROJECT_TYPE,$project));
|
||||
while($row = $type->next()){
|
||||
$row['selected_invisible'] = $row['visible'] !== 1 ? 'selected' : '';
|
||||
$row['selected_visible'] = $row['visible'] == 1 ? 'selected' : '';
|
||||
|
||||
@ -14,7 +14,7 @@ namespace SQL;
|
||||
/**
|
||||
* QQ to get System Api Tree by group
|
||||
*/
|
||||
class SELECT_BADGES_PROJECT extends \SYSTEM\DB\QP {
|
||||
class SELECT_BADGES extends \SYSTEM\DB\QP {
|
||||
/**
|
||||
* Get Classname of the QQ
|
||||
*
|
||||
@ -1,20 +1,3 @@
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (900, 42, 'project', 'project', -1, 0, 0, '#content', './sai.php?sai_mod=.SAI.saimod_project&search=${search}&page=${page}', 'init_saimod_project', '\\SAI\\saimod_project');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (910, 42, 'new', 'project', 900, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_project&action=project_new', 'init_saimod_project_new', '\\SAI\\saimod_project');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (920, 42, 'details', 'project', 900, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_project&action=project_details&project=${project}', 'init_saimod_project_details', '\\SAI\\saimod_project');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (930, 42, 'new', 'project', 900, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_project&action=project_new', 'init_saimod_project_new', '\\SAI\\saimod_project');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (901, 42, 'overview', 'mail', 900, 0, 0, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=overview', 'init_saimod_mail_overview', '\\SAI\\saimod_mail');
|
||||
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (910, 42, 'contacts', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=contacts&search=${search}&page=${page}&list=${list}', 'init_saimod_mail_contacts', '\\SAI\\saimod_mail');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (915, 42, 'contact', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=contact&email=${email}', 'init_saimod_mail_contact', '\\SAI\\saimod_mail');
|
||||
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (920, 42, 'lists', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=lists', 'init_saimod_mail_lists', '\\SAI\\saimod_mail');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (925, 42, 'list', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=list&id=${id}', 'init_saimod_mail_list', '\\SAI\\saimod_mail');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (927, 42, 'list_new', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=list_new', 'init_saimod_mail_list_new', '\\SAI\\saimod_mail');
|
||||
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (930, 42, 'emails', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=emails', 'init_saimod_mail_emails', '\\SAI\\saimod_mail');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (935, 42, 'email', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=email&id=${id}', 'init_saimod_mail_email', '\\SAI\\saimod_mail');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (937, 42, 'email_new', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=email_new', 'init_saimod_mail_email_new', '\\SAI\\saimod_mail');
|
||||
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (940, 42, 'templates', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=templates&type=${type}', 'init_saimod_mail_templates', '\\SAI\\saimod_mail');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (945, 42, 'template', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=template&id=${id}', 'init_saimod_mail_template', '\\SAI\\saimod_mail');
|
||||
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (947, 42, 'template_new', 'mail', 900, 0, 1, '#content_mail', './sai.php?sai_mod=.SAI.saimod_mail&action=template_new', 'init_saimod_mail_template_new', '\\SAI\\saimod_mail');
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (920, 42, 'details', 'project', 900, 0, 1, '#content', './sai.php?sai_mod=.SAI.saimod_project&action=project_details&project=${project}', 'init_saimod_project_details', '\\SAI\\saimod_project');
|
||||
Loading…
x
Reference in New Issue
Block a user