Merge branch 'master' into permissions

This commit is contained in:
Paolo
2018-06-21 15:19:59 +02:00
30 changed files with 722 additions and 194 deletions
+3 -3
View File
@@ -7,8 +7,8 @@ $config['send_immediately'] = false;
$config['msg_delivery'] = true; // Default true
$config['system_person_id'] = 1; // Dummy sender, used for sending messages from the system
$config['redirect_view_message_url'] = 'index.ci.php/Redirect/redirectByToken/'; //
$config['message_html_view_url'] = 'index.ci.php/ViewMessage/toHTML/';
$config['redirect_view_message_url'] = site_url('Redirect/redirectByToken/'); //
$config['message_html_view_url'] = site_url('ViewMessage/toHTML/');
$config['message_server'] = 'http://www.fhcomplete.org/';
$config['assistent_function'] = 'ass';
@@ -65,4 +65,4 @@ define('MSG_ERR_INVALID_RECIPIENTS', 105);
define('MSG_ERR_INVALID_RECEIVER_ID', 106);
define('MSG_ERR_INVALID_OU', 107);
define('MSG_ERR_INVALID_TEMPLATE', 108);
define('MSG_ERR_INVALID_TOKEN', 109);
define('MSG_ERR_INVALID_TOKEN', 109);
+50 -23
View File
@@ -1,75 +1,102 @@
<?php
// --------------------------------------------------------------------------------------------------------------------
// Header menu
$config['navigation_header'] = array(
'*' => array(
'FH-Complete' => site_url(''),
'Vilesci' => base_url('/vilesci'),
'CIS' => CIS_ROOT
'fhcomplete' => array(
'link' => site_url(''),
'icon' => '',
'description' => 'FH-Complete',
'sort' => 1
),
'vilesci' => array(
'link' => base_url('vilesci'),
'icon' => '',
'description' => 'Vilesci',
'sort' => 2
),
'cis' => array(
'link' => CIS_ROOT,
'icon' => '',
'description' => 'CIS',
'sort' => 3
)
)
);
// --------------------------------------------------------------------------------------------------------------------
// Left side menu
$config['navigation_menu'] = array();
$config['navigation_menu']['Vilesci/index'] = array(
'Dashboard' => array(
'dashboard' => array(
'link' => '#',
'description' => 'Dashboard',
'icon' => 'dashboard'
'icon' => 'dashboard',
'sort' => 1
),
'Lehre' => array(
'lehre' => array(
'link' => '#',
'icon' => 'graduation-cap',
'description' => 'Lehre',
'expand' => true,
'sort' => 2,
'children'=> array(
'CIS' => array(
'cis' => array(
'link' => CIS_ROOT,
'icon' => '',
'description' => 'CIS',
'expand' => true
'expand' => true,
'sort' => 1
),
'Infocenter' => array(
'link' => site_url('/system/infocenter/InfoCenter'),
'infocenter' => array(
'link' => site_url('system/infocenter/InfoCenter'),
'icon' => 'info',
'description' => 'Infocenter',
'expand' => true
'expand' => true,
'sort' => 2
),
)
),
'Administration' => array(
'administration' => array(
'link' => '#',
'icon' => 'gear',
'description' => 'Administration',
'expand' => false,
'sort' => 3,
'children'=> array(
'Vilesci' => array(
'link' => base_url('vilesci/'),
'vilesci' => array(
'link' => base_url('vilesci'),
'icon' => '',
'description' => 'Vilesci',
'expand' => true
'expand' => true,
'sort' => 1
),
'Extensions' => array(
'link' => site_url('/system/extensions/Manager'),
'extensions' => array(
'link' => site_url('system/extensions/Manager'),
'icon' => 'cubes',
'description' => 'Extensions Manager',
'expand' => true
'expand' => true,
'sort' => 2
)
)
)
);
$config['navigation_menu']['system/infocenter/InfoCenter/index'] = array(
'Freigegeben' => array(
'link' => base_url('index.ci.php/system/infocenter/InfoCenter/freigegeben'),
'freigegeben' => array(
'link' => site_url('system/infocenter/InfoCenter/freigegeben'),
'description' => 'Freigegeben',
'icon' => 'thumbs-up'
)
);
$config['navigation_menu']['system/infocenter/InfoCenter/freigegeben'] = array(
'Zurück' => array(
'link' => base_url('index.ci.php/system/infocenter/InfoCenter/index'),
'back' => array(
'link' => site_url('system/infocenter/InfoCenter/index'),
'description' => 'Home',
'icon' => 'angle-left'
)
+214
View File
@@ -0,0 +1,214 @@
<?php
/**
* FH-Complete
*
* @package FHC-API
* @author FHC-Team
* @copyright Copyright (c) 2016, fhcomplete.org
* @license GPLv3
* @link http://fhcomplete.org
* @since Version 1.0
* @filesource
*/
if (! defined('BASEPATH'))
exit('No direct script access allowed');
class AmpelMail extends FHC_Controller
{
const CIS_AMPELVERWALTUNG_URL =
CIS_ROOT. "index.php?sprache=German&content_id=&menu=".
CIS_ROOT. "menu.php?content_id=&content=".
CIS_ROOT. "private/tools/ampelverwaltung.php";
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
// Allow script execution only from CLI
if ($this->input->is_cli_request())
{
$cli = true;
}
else
{
$this->output->set_status_header(403, 'Jobs must be run from the CLI');
echo "Jobs must be run from the CLI";
exit;
}
// Load models
$this->load->model('content/Ampel_model', 'AmpelModel');
$this->load->model('person/Person_model', 'PersonModel');
// Load helpers
$this->load->helper('sancho');
}
/**
* Main function index as help
*
* @return void
*/
public function index()
{
$result = "The following are the available command line interface commands\n\n";
$result .= "php index.ci.php jobs/AmpelMail generateAmpelMail";
echo $result. PHP_EOL;
}
/**
* Generates mail content for new and overdue Ampeln, which
* 1. are not confirmed by the user yet and
* 2. are marked to be sent by email
* Ampel is new when inserted within the last 7 days before the cronjob runs (as cronjob runs weekly)
* Ampel is overdue when the cronjob runs after the deadline date.
* @return void
*/
public function generateAmpelMail()
{
// Get all notifications, that are not expired, not before vorlaufzeit AND email is true
$result_active_ampeln = $this->AmpelModel->active(true);
// Stores users, description, deadline and system-link of notifications
$new_ampel_data_arr = array(); // data of new notifications that are not confirmed
$overdue_ampel_data_arr = array(); // data of overdue notifications that are not confirmed
if (hasData($result_active_ampeln))
{
$ampel_arr = $result_active_ampeln->retval;
// Loop through ampeln
foreach ($ampel_arr as $ampel)
{
$ampel_id = $ampel->ampel_id;
$now = date_create(date('Y-m-d'));
$deadline = date_create($ampel->deadline);
$insert_date = date_create($ampel->insertamum);
$qry_all_ampel_user = $ampel->benutzer_select; // sql select to get all user who get this ampel
$new = false;
$overdue = false;
// get all user, who get this ampel
$result_ampel_user = $this->AmpelModel->execBenutzerSelect($qry_all_ampel_user);
if (hasData($result_ampel_user))
{
$ampel_user_arr = $result_ampel_user->retval;
// loop through all user, who get this ampel
foreach ($ampel_user_arr as $ampel_user)
{
$uid = $ampel_user->uid;
// break if ampel was almost confirmed by the user
if($this->AmpelModel->isConfirmed($ampel_id, $uid)) break;
// check if ampel is new (inserted within last week, as cronjob will run every week)
if ($now->diff($insert_date)->days <= 7) $new = true;
//check if ampel is overdue
if ($now > $deadline) $overdue = true;
// if ampel is new
if ($new)
{
$html_text = '<p><strong>'. strtoupper($ampel->kurzbz). '</strong></p><br>';
// create template-specific data array of new notifications
// if uid already exists in the array, only the html text will be added to the existing html text
$new_ampel_data_arr =
$this->_getAmpelContentData($uid, $html_text, $new_ampel_data_arr);
}
// if ampel is overdue
if ($overdue)
{
$html_text = '
<p><strong>'. strtoupper($ampel->kurzbz). '</strong><br>
<small>
<i style="color: #65696E;">Die Deadline für die Bestätigung war am
<span style="color: #FF0000;">'. date_format($deadline, 'Y-m-d'). '</span>
</i>
</small></p><br>';
// create template-specific data array of overdue notifications
// if uid already exists in the array, only the html text will be added to the existing html text
$overdue_ampel_data_arr =
$this->_getAmpelContentData($uid, $html_text, $overdue_ampel_data_arr);
}
}
}
elseif (isError($result_ampel_user))
{
show_error($result_ampel_user->error);
}
}
}
elseif (isError($result_active_ampeln))
{
show_error($result_active_ampeln->error);
}
// Send mails for new ampeln merged by user
foreach ($new_ampel_data_arr as $new_ampel_data)
{
sendMail(
'Sancho_Content_AmpelNeu',
$new_ampel_data,
$new_ampel_data['uid']. '@'. DOMAIN,
'Du hast eine neue Ampel!',
'sancho_header_neue_nachrichten_in_ampelsystem.jpg'
);
};
// Send mails for overdue ampeln merged by user
foreach ($overdue_ampel_data_arr as $overdue_ampel_data)
{
sendMail(
'Sancho_Content_AmpelUeberfaellig',
$overdue_ampel_data,
$overdue_ampel_data['uid']. '@'. DOMAIN,
'Bestätige bitte Deine Ampel!',
'sancho_header_ampel_overdue.jpg'
);
};
}
// ------------------------------------------------------------------------
// Private methods
/**
* Returns associative array with data as needed in the ampel content templates.
* @param string $uid UID, needed to merge user.
* @param string $html_text Specific HTML Content to be set initially for a user or to add if user exists.
* @param array $ampel_data_arr Array with ampeln.
* @return array
*/
private function _getAmpelContentData($uid, $html_text, $ampel_data_arr)
{
$firstName = $this->PersonModel->getByUid($uid)->retval[0]->vorname;
// check if user already exists in the array
$key_position = array_search($uid, array_column($ampel_data_arr, 'uid'));
// If user already exists in the array, add only new ampel data to users ampel list
if ($key_position !== false)
{
$ampel_data_arr[$key_position]['ampel_list'] .= $html_text;
}
// If user does not exist, create new user and push all data needed
else
{
$ampel_data_arr[] = array(
'uid' => $uid,
'firstName' => $firstName,
'ampel_list' => $html_text,
'link' => self::CIS_AMPELVERWALTUNG_URL
);
}
return $ampel_data_arr;
}
}
@@ -40,7 +40,7 @@ class Prestudentstatus extends Auth_Controller
public function index()
{
$result = "The following are the available command line interface commands\n\n";
$result .= "php index.ci.php jobs/Prestudentstatus CorrectStudienplan";
$result .= "php ".$this->config->item('index_page')." jobs/Prestudentstatus CorrectStudienplan";
echo $result.PHP_EOL;
}
@@ -12,12 +12,18 @@ class InfoCenter extends Auth_Controller
const APP = 'infocenter';
const TAETIGKEIT = 'bewerbung';
const URL_PREFIX = '/system/infocenter/InfoCenter'; // URL prefix for this controller
const INFOCENTER_URI = 'system/infocenter/InfoCenter'; // URL prefix for this controller
const INDEX_PAGE = 'index';
const FREIGEGEBEN_PAGE = 'freigegeben';
const SHOW_DETAILS_PAGE = 'showDetails';
const NAVIGATION_PAGE = 'navigation_page';
const ORIGIN_PAGE = 'origin_page';
private $_uid; // contains the UID of the logged user
// Used to log with PersonLogLib
private $logparams = array(
private $_logparams = array(
'saveformalgep' => array(
'logtype' => 'Action',
'name' => 'Document formally checked',
@@ -119,29 +125,33 @@ class InfoCenter extends Auth_Controller
// Public methods
/**
* Default
* Main page of the InfoCenter tool
*/
public function index()
{
$this->setNavigationMenuIndex(); // define the navigation menu for this page
$this->_setNavigationMenuIndex(); // define the navigation menu for this page
$this->load->view('system/infocenter/infocenter.php');
}
/**
* Freigegeben page of the InfoCenter tool
*/
public function freigegeben()
{
$this->setNavigationMenuFreigegeben(); // define the navigation menu for this page
$this->_setNavigationMenuFreigegeben(); // define the navigation menu for this page
$this->load->view('system/infocenter/infocenterFreigegeben.php');
}
/**
* Personal details page of the InfoCenter tool
* Initialization function, gets person and prestudent data and loads the view with the data
* @param $person_id
*/
public function showDetails()
{
$this->setNavigationMenuShowDetails();
$this->_setNavigationMenuShowDetails();
$person_id = $this->input->get('person_id');
@@ -156,8 +166,8 @@ class InfoCenter extends Auth_Controller
if (empty($personexists->retval))
show_error('person does not exist!');
$origin_page = $this->input->get('origin_page');
if ($origin_page == 'index')
$origin_page = $this->input->get(self::ORIGIN_PAGE);
if ($origin_page == self::INDEX_PAGE)
{
// mark person as locked for editing
$result = $this->PersonLockModel->lockPerson($person_id, $this->_uid, self::APP);
@@ -174,8 +184,8 @@ class InfoCenter extends Auth_Controller
$prestudentdata
);
$data['fhc_controller_id'] = $this->getControllerId();
$data['origin_page'] = $origin_page;
$data[self::FHC_CONTROLLER_ID] = $this->getControllerId();
$data[self::ORIGIN_PAGE] = $origin_page;
$this->load->view('system/infocenter/infocenterDetails.php', $data);
}
@@ -191,7 +201,7 @@ class InfoCenter extends Auth_Controller
if (isError($result))
show_error($result->retval);
redirect(self::URL_PREFIX.'?fhc_controller_id='.$this->getControllerId());
redirect('/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId());
}
/**
@@ -230,9 +240,7 @@ class InfoCenter extends Auth_Controller
}
}
$this->output
->set_content_type('application/json')
->set_output(json_encode($json));
$this->output->set_content_type('application/json')->set_output(json_encode($json));
}
/**
@@ -243,9 +251,7 @@ class InfoCenter extends Auth_Controller
{
$prestudent = $this->PrestudentModel->getLastPrestudent($person_id, true);
$this->output
->set_content_type('application/json')
->set_output(json_encode($prestudent));
$this->output->set_content_type('application/json')->set_output(json_encode($prestudent));
}
/**
@@ -324,9 +330,7 @@ class InfoCenter extends Auth_Controller
$this->_log($logdata['person_id'], 'savezgv', array($logdata['studiengang_kurzbz'], $prestudent_id));
}
}
$this->output
->set_content_type('application/json')
->set_output(json_encode($result));
$this->output->set_content_type('application/json')->set_output(json_encode($result));
}
/**
@@ -479,9 +483,7 @@ class InfoCenter extends Auth_Controller
$this->_log($person_id, 'savenotiz', array($titel));
}
$this->output
->set_content_type('application/json')
->set_output(json_encode($result));
$this->output->set_content_type('application/json')->set_output(json_encode($result));
}
/**
@@ -512,9 +514,7 @@ class InfoCenter extends Auth_Controller
$this->_log($person_id, 'updatenotiz', array($titel));
}
$this->output
->set_content_type('application/json')
->set_output(json_encode($result));
$this->output->set_content_type('application/json')->set_output(json_encode($result));
}
/**
@@ -581,9 +581,7 @@ class InfoCenter extends Auth_Controller
{
$result = $this->personloglib->getParkedDate($person_id);
$this->output
->set_content_type('application/json')
->set_output(json_encode($result));
$this->output->set_content_type('application/json')->set_output(json_encode($result));
}
/**
@@ -596,9 +594,7 @@ class InfoCenter extends Auth_Controller
$result = $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
$this->output
->set_content_type('application/json')
->set_output(json_encode($result));
$this->output->set_content_type('application/json')->set_output(json_encode($result));
}
/**
@@ -610,9 +606,7 @@ class InfoCenter extends Auth_Controller
$result = $this->personloglib->unPark($person_id);
$this->output
->set_content_type('application/json')
->set_output(json_encode($result));
$this->output->set_content_type('application/json')->set_output(json_encode($result));
}
/**
@@ -631,9 +625,26 @@ class InfoCenter extends Auth_Controller
$json = $result->retval[0]->ende;
}
$this->output
->set_content_type('application/json')
->set_output(json_encode($json));
$this->output->set_content_type('application/json')->set_output(json_encode($json));
}
/**
* Wrapper for setNavigationMenu, returns JSON message
*/
public function setNavigationMenuArrayJson()
{
$navigation_page = $this->input->get(self::NAVIGATION_PAGE);
if (strpos($navigation_page, self::INDEX_PAGE) !== false)
{
$this->_setNavigationMenuIndex();
}
else
{
$this->_setNavigationMenuFreigegeben();
}
$this->outputJsonSuccess('success');
}
// -----------------------------------------------------------------------------------------------------------------
@@ -652,9 +663,9 @@ class InfoCenter extends Auth_Controller
/**
* Define the navigation menu for the index page
*/
public function setNavigationMenuIndex()
private function _setNavigationMenuIndex()
{
$this->load->library('NavigationLib', array('navigation_page' => 'system/infocenter/InfoCenter/index'));
$this->load->library('NavigationLib', array(self::NAVIGATION_PAGE => self::INFOCENTER_URI.'/'.self::INDEX_PAGE));
$listFiltersSent = array();
$listFiltersNotSent = array();
@@ -743,16 +754,16 @@ class InfoCenter extends Auth_Controller
/**
* Define the navigation menu for the showDetails page
*/
public function setNavigationMenuShowDetails()
private function _setNavigationMenuShowDetails()
{
$this->load->library('NavigationLib', array('navigation_page' => 'system/infocenter/InfoCenter/showDetails'));
$this->load->library('NavigationLib', array(self::NAVIGATION_PAGE => self::INFOCENTER_URI.'/'.self::SHOW_DETAILS_PAGE));
$origin_page = $this->input->get('origin_page');
$origin_page = $this->input->get(self::ORIGIN_PAGE);
$link = base_url('index.ci.php/system/infocenter/InfoCenter/index');
if ($origin_page == 'freigegeben')
$link = site_url(self::INFOCENTER_URI.'/'.self::INDEX_PAGE);
if ($origin_page == self::FREIGEGEBEN_PAGE)
{
$link = base_url('index.ci.php/system/infocenter/InfoCenter/freigegeben');
$link = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
}
$this->navigationlib->setSessionMenu(
@@ -771,9 +782,9 @@ class InfoCenter extends Auth_Controller
/**
* Define the navigation menu for the freigegeben page
*/
public function setNavigationMenuFreigegeben()
private function _setNavigationMenuFreigegeben()
{
$this->load->library('NavigationLib', array('navigation_page' => 'system/infocenter/InfoCenter/freigegeben'));
$this->load->library('NavigationLib', array(self::NAVIGATION_PAGE => self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE));
$listFilters = array();
$listCustomFilters = array();
@@ -832,24 +843,8 @@ class InfoCenter extends Auth_Controller
}
/**
* Wrapper for setNavigationMenu, returns JSON message
* Utility method used to fill elements of the InfoCenter left menu of the main InfoCenter page
*/
public function setNavigationMenuArrayJson()
{
$navigation_page = $this->input->get('navigation_page');
if (strpos($navigation_page, 'index') !== false)
{
$this->setNavigationMenuIndex();
}
else
{
$this->setNavigationMenuFreigegeben();
}
$this->outputJsonSuccess('success');
}
private function _fillFilters($filters, &$tofill)
{
$toPrint = "%s?%s=%s&%s=%s";
@@ -859,7 +854,7 @@ class InfoCenter extends Auth_Controller
$tofill['children'][] = array(
'link' => sprintf(
$toPrint,
site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId,
site_url(self::INFOCENTER_URI), 'filter_id', $filterId,
FHC_Controller::FHC_CONTROLLER_ID,
$this->getControllerId()
),
@@ -868,6 +863,9 @@ class InfoCenter extends Auth_Controller
}
}
/**
* Utility method used to fill elements of the InfoCenter left menu of the freigegeben InfoCenter page
*/
private function _fillFiltersFreigegeben($filters, &$tofill)
{
$toPrint = "%s?%s=%s&%s=%s";
@@ -877,7 +875,7 @@ class InfoCenter extends Auth_Controller
$tofill['children'][] = array(
'link' => sprintf(
$toPrint,
site_url('system/infocenter/InfoCenter/freigegeben'), 'filter_id', $filterId,
site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE), 'filter_id', $filterId,
FHC_Controller::FHC_CONTROLLER_ID,
$this->getControllerId()
),
@@ -886,6 +884,10 @@ class InfoCenter extends Auth_Controller
}
}
/**
* Utility method used to fill elements of the InfoCenter left menu
* with the list of the custom filter of the authenticated user
*/
private function _fillCustomFilters($filters, &$tofill)
{
$toPrint = "%s?%s=%s&%s=%s";
@@ -895,7 +897,7 @@ class InfoCenter extends Auth_Controller
$tofill['children'][] = array(
'link' => sprintf(
$toPrint,
site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId,
site_url(self::INFOCENTER_URI), 'filter_id', $filterId,
FHC_Controller::FHC_CONTROLLER_ID,
$this->getControllerId()
),
@@ -1089,7 +1091,18 @@ class InfoCenter extends Auth_Controller
$this->PrestudentModel->addSelect('person_id');
$person_id = $this->PrestudentModel->load($prestudent_id)->retval[0]->person_id;
redirect(self::URL_PREFIX.'/showDetails?person_id='.$person_id.'&fhc_controller_id='.$this->getControllerId().'#'.$section);
redirect(
sprintf(
'/%s/%s?%s=%s&%s=%s#%s',
self::INFOCENTER_URI,
self::SHOW_DETAILS_PAGE,
'person_id',
$person_id,
self::FHC_CONTROLLER_ID,
$this->getControllerId(),
$section
)
);
}
/**
@@ -1121,7 +1134,7 @@ class InfoCenter extends Auth_Controller
*/
private function _log($person_id, $logname, $messageparams)
{
$logdata = $this->logparams[$logname];
$logdata = $this->_logparams[$logname];
$datatolog = array(
'name' => $logdata['name']
+7 -6
View File
@@ -9,7 +9,7 @@
* @license GPLv3
* @since Version 1.0.0
*/
/**
* Message Helper
*
@@ -35,7 +35,7 @@ function success($retval, $code = null, $msg_indx_prefix = 'fhc_')
$success->fhcCode = $code;
if (!is_null($code)) $success->msg = lang($msg_indx_prefix . $code);
$success->retval = $retval;
return $success;
}
@@ -51,7 +51,7 @@ function error($retval = '', $code = null, $msg_indx_prefix = 'fhc_')
$error->fhcCode = $code;
if (!is_null($code)) $error->msg = lang($msg_indx_prefix . $code);
$error->retval = $retval;
return $error;
}
@@ -64,7 +64,7 @@ function isSuccess($result)
{
return true;
}
return false;
}
@@ -78,15 +78,16 @@ function hasData($result)
{
return true;
}
return false;
}
/**
* Checks if the result represents an error
* Wrapper function of isSuccess, more readable code
* Bob Dylan: ...there's no success like failure. And that failure's no success at all.
*/
function isError($result)
{
return !isSuccess($result);
}
}
+93
View File
@@ -0,0 +1,93 @@
<?php
/**
* FH-Complete
*
* @package FHC-Helper
* @author FHC-Team
* @copyright Copyright (c) 2016 fhcomplete.org
* @license GPLv3
* @since Version 1.0.0
*/
/**
* FHC Helper
*
* @subpackage Helpers
* @category Helpers
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
const DEFAULT_SANCHO_HEADER_IMG = 'sancho_header_du_hast_neue_nachrichten.jpg';
/**
* Send single Mail with Sancho Design and Layout.
* @param string $vorlage_kurzbz Name of the template for specific mail content.
* @param array $vorlage_data Associative array with specific mail content varibales
* to be replaced in the content template.
* @param string $to Email-adress.
* @param string $subject Subject of mail.
* @param string $headerImg Filename of the specific Sancho header image.
* @return void
*/
function sendMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DEFAULT_SANCHO_HEADER_IMG)
{
$ci =& get_instance();
$ci->load->library('email');
$ci->load->library('MailLib');
$sanchoHeader_img = 'skin/images/sancho/'. $headerImg;
$sanchoFooter_img = 'skin/images/sancho/sancho_footer.jpg';
// Embed sancho header and footer image
// reset important to ensure embedding of images when called in a loop
$ci->email->clear(true); // clear vars and attachments
$ci->email->attach($sanchoHeader_img);
$ci->email->attach($sanchoFooter_img);
$cid_header = $ci->email->attachment_cid($sanchoHeader_img); // sets unique content id for embedding
$cid_footer = $ci->email->attachment_cid($sanchoFooter_img); // sets unique content id for embedding
// Set specific mail content into specific content template
$content = _parseMailContent($vorlage_kurzbz, $vorlage_data);
// overall main content data array
$layout = array(
'CID_header' => $cid_header,
'CID_footer' => $cid_footer,
'content' => $content
);
// Set overall main content into the sancho mail template
$body = _parseMailContent('Sancho_Mail_Template', $layout);
// Send mail
$ci->maillib->send('sancho@'. DOMAIN, $to, $subject, $body);
}
/**
* Replace variables in the mail content template with specific mail content data.
* @param string $vorlage_kurzbz Name of the template for specific mail content.
* @param array $vorlage_data Associative array with specific mail content varibales
* to be replaced in the content template.
* @return string
*/
function _parseMailContent($vorlage_kurzbz, $vorlage_data)
{
$ci =& get_instance();
$ci->load->library('VorlageLib');
$result = $ci->vorlagelib->getVorlagetextByVorlage($vorlage_kurzbz);
if (isSuccess($result))
{
// If the text and the subject of the template are not empty
if (is_array($result->retval) && count($result->retval) > 0 &&
!empty($result->retval[0]->text))
{
// Parses template text
$parsedText = $ci->vorlagelib->parseVorlagetext($result->retval[0]->text, $vorlage_data);
return $parsedText;
}
}
}
+39 -2
View File
@@ -97,6 +97,8 @@ class NavigationLib
}
}
$this->_sortArray($menuArray);
return $menuArray;
}
@@ -150,6 +152,8 @@ class NavigationLib
}
}
$this->_sortArray($headerArray);
return $headerArray;
}
@@ -158,17 +162,20 @@ class NavigationLib
*/
public function oneLevel(
$description, $link = '#', $children = null, $icon = '', $expand = false,
$subscriptDescription = null, $subscriptLinkClass = null, $subscriptLinkValue = null)
$subscriptDescription = null, $subscriptLinkClass = null, $subscriptLinkValue = null, $target = '',
$sort = null)
{
return array(
'description' => $description,
'link' => $link,
'target' => $target,
'children'=> $children,
'icon' => $icon,
'expand' => $expand,
'subscriptDescription' => $subscriptDescription,
'subscriptLinkClass' => $subscriptLinkClass,
'subscriptLinkValue' => $subscriptLinkValue
'subscriptLinkValue' => $subscriptLinkValue,
'sort' => $sort
);
}
@@ -351,4 +358,34 @@ class NavigationLib
return $navigationPage;
}
/**
* Sorts using the sort element present in the array
*/
private function _sortArray(&$array)
{
uasort($array, function($a, $b) {
// If the element sort is not present then the default value is 999
$sortA = 999;
if (isset($a['sort'])) $sortA = $a['sort'];
// If the element sort is not present then the default value is 999
$sortB = 999;
if (isset($b['sort'])) $sortB = $b['sort'];
return $sortA - $sortB; // < 0 => lt, == 0 => equal, > 0 => gt
});
// Sort also the children
foreach ($array as $key => $value)
{
if (isset($value['children']) && is_array($value['children']) && count($value['children']) > 0)
{
// NOTE: keep this way to give the element by reference, $value has a different reference!
// otherwise the children will not be sorted
$this->_sortArray($array[$key]['children']); // recursive call
}
}
}
}
+80 -1
View File
@@ -1,7 +1,6 @@
<?php
class Ampel_model extends DB_Model
{
/**
* Constructor
*/
@@ -11,4 +10,84 @@ class Ampel_model extends DB_Model
$this->dbTable = 'public.tbl_ampel';
$this->pk = 'ampel_id';
}
/**
* Returns all active Ampeln, that are actually:
* 1. not after the deadline date
* 2. not before the vorlaufszeit
* @param bool $email If true, then only ampeln are retrieved that are marked to be sent by mail.
* @return array Returns array of objects.
*/
public function active($email = false)
{
$parametersArray = null;
$query = '
SELECT *
FROM public.tbl_ampel
WHERE';
if ($email === true)
{
$parametersArray['email'] = $email;
$query .= ' email = ? AND';
}
$query .= '
(NOW()<(deadline+(verfallszeit || \' days\')::interval)::date)
OR (verfallszeit IS NULL AND NOW() < deadline)
AND (NOW()>(deadline-(vorlaufzeit || \' days\')::interval)::date)
OR (vorlaufzeit IS NULL AND NOW() > deadline)';
$query .= ' ORDER BY deadline DESC';
return $this->execQuery($query, $parametersArray);
}
/**
* Returns all Ampel-receiver of a specific Ampel.
* @param string $benutzer_select SQL Statement which defines the Ampel-receiver.
* @return array Returns array of objects with property 'uid'.
*/
public function execBenutzerSelect($benutzer_select)
{
if (isset($benutzer_select) && !empty(trim($benutzer_select)))
{
return $this->execQuery($benutzer_select);
}
}
/**
* Checks if Ampel was confirmed by the user.
* @param int $ampel_id Ampel-ID
* @param string $uid UID
* @return bool
*/
public function isConfirmed($ampel_id, $uid)
{
$result = null;
$query = '
SELECT 1
FROM public.tbl_ampel_benutzer_bestaetigt
WHERE ampel_id = ?
AND uid = ?';
if (isset($ampel_id, $uid))
{
$result = $this->execQuery($query, array($ampel_id, $uid));
}
if ($result)
{
if (count($result->retval) > 0)
{
return true;
}
else
{
return false;
}
}
else
return $result; //will contain the error-msg from execQuery
}
}
+2 -2
View File
@@ -7,7 +7,7 @@
<div class="row">
<div class="span4">
<h2>Statusgrund: <?php echo $sg->status_kurzbz; ?></h2>
<form method="post" action="<?php echo APP_ROOT . "index.ci.php/crm/Statusgrund/saveGrund";?>">
<form method="post" action="<?php echo site_url("crm/Statusgrund/saveGrund"); ?>">
<table>
<tr>
<td colspan="2">
@@ -104,4 +104,4 @@
}
?>
</html>
</html>
+1 -1
View File
@@ -5,7 +5,7 @@
<div class="row">
<div class="span4">
<h2>Neuer Statusgrund</h2>
<form method="post" action="<?php echo APP_ROOT . "index.ci.php/crm/Statusgrund/insGrund";?>">
<form method="post" action="<?php echo site_url("crm/Statusgrund/insGrund"); ?>">
<table>
<tr>
<td colspan="2">
@@ -7,7 +7,7 @@ $this->load->view('templates/header', array('title' => 'StudienjahrEdit', 'jquer
<div class="row">
<div class="span4">
<h2>Studienjahr bearbeiten: <?php echo $jahr->studienjahr_kurzbz; ?></h2>
<form method="post" action="<?php echo APP_ROOT."index.ci.php/organisation/studienjahr/saveStudienjahr" ?>">
<form method="post" action="<?php echo site_url("organisation/studienjahr/saveStudienjahr"); ?>">
<table>
<?php include('studienjahrForm.php'); ?>
@@ -17,4 +17,4 @@ $this->load->view('templates/header', array('title' => 'StudienjahrEdit', 'jquer
</div>
</div>
</body>
</html>
</html>
@@ -8,7 +8,7 @@ $this->load->view('templates/header', array('title' => 'StudienjahrNew', 'jquery
<div class="span4">
<h2>Neues Studienjahr anlegen</h2>
<form method="post"
action="<?php echo APP_ROOT."index.ci.php/organisation/studienjahr/insStudienjahr"; ?>"
action="<?php echo site_url("organisation/studienjahr/insStudienjahr"); ?>"
id="newStudienjahrForm">
<table>
<tr>
@@ -8,7 +8,7 @@ $this->load->view('templates/header', array('title' => 'StudiensemesterEdit', 'd
<div class="span4">
<h2>Studiensemester bearbeiten: <?php echo $sem->studiensemester_kurzbz; ?></h2>
<form method="post"
action="<?php echo APP_ROOT."index.ci.php/organisation/studiensemester/saveStudiensemester" ?>">
action="<?php echo site_url("organisation/studiensemester/saveStudiensemester") ?>">
<table>
<?php include('studiensemesterForm.php'); ?>
<input type="hidden" name="semkurzbz" value="<?php echo $sem->studiensemester_kurzbz; ?>"/>
@@ -7,9 +7,7 @@ $this->load->view('templates/header', array('title' => 'StudiensemesterNew', 'jq
<div class="row">
<div class="span4">
<h2>Neues Studiensemester anlegen</h2>
<form method="post"
action="<?php echo APP_ROOT."index.ci.php/organisation/studiensemester/insStudiensemester"; ?>"
id="newSemesterForm">
<form method="post" action="<?php echo site_url("organisation/studiensemester/insStudiensemester"); ?>" id="newSemesterForm">
<table>
<tr>
<td colspan="2">
+2 -2
View File
@@ -84,7 +84,7 @@ $widthColumn = $msgExists === true ? 8 : 12;
$.ajax(
{
dataType: "json",
url: "<?php echo base_url("/index.ci.php/system/Messages/getMessageFromIds/") ?>" + msgid + "/" + recid,
url: "<?php echo site_url("system/Messages/getMessageFromIds/") ?>" + msgid + "/" + recid,
success: function (data, textStatus, jqXHR)
{
$("#msgsubject").text(data[0].subject);
@@ -97,4 +97,4 @@ $widthColumn = $msgExists === true ? 8 : 12;
}
)
}
</script>
</script>
+1 -1
View File
@@ -47,7 +47,7 @@
}
}
?>
<form action="<?php echo APP_ROOT; ?>index.ci.php/system/UDF/saveUDF" method="POST">
<form action="<?php echo site_url('system/UDF/saveUDF'); ?>" method="POST">
<div class="div-table">
<div class="div-row">
+5 -4
View File
@@ -2,8 +2,9 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
// Retrives the URL path of the called controller + called controller method
// Retrives the name of the index page, the URL path of the called controller and the called controller
// NOTE: placed here because it doesn't work inside functions
$indexPage = $this->config->item('index_page');
$calledPath = $this->router->directory.$this->router->class;
$calledMethod = $this->router->method;
@@ -67,14 +68,14 @@ function _generateCSSsInclude($CSSs)
/**
* Generates global JS-Object to pass parms to other javascripts
*/
function _generateJSDataStorageObject($calledPath, $calledMethod)
function _generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
{
$toPrint = "\n";
$toPrint .= '<script type="text/javascript">';
$toPrint .= '
var FHC_JS_DATA_STORAGE_OBJECT = {
app_root: "'.APP_ROOT.'",
ci_router: "index.ci.php",
ci_router: "'.$indexPage.'",
called_path: "'.$calledPath.'",
called_method: "'.$calledMethod.'"
};';
@@ -202,7 +203,7 @@ function _generateAddonsJSsInclude($calledFrom)
// Generates the global object to pass useful parameters to other javascripts
// NOTE: must be called before any other JS include
_generateJSDataStorageObject($calledPath, $calledMethod);
_generateJSDataStorageObject($indexPage, $calledPath, $calledMethod);
// Generates the global object to pass phrases to javascripts
// NOTE: must be called before including the PhrasesLib.js
+19
View File
@@ -33,3 +33,22 @@
font-weight: bold;
text-decoration: underline;
}
.navbar-brand {
float: left;
height: 50px;
padding-top: 15px;
padding-right: 20px;
padding-left: 7px;
font-size: 18px;
line-height: 20px;
}
.navbar-brand-icon {
float: left;
height: 50px;
padding-top: 15px;
padding-right: 12px;
padding-left: 7px;
font-size: 16px;
}
+18 -2
View File
@@ -31,7 +31,20 @@ var FHC_NavigationWidget = {
if (FHC_AjaxClient.hasData(data))
{
jQuery.each(FHC_AjaxClient.getData(data), function(i, e) {
$(".menu-header-items").append('<a class="navbar-brand" href="' + e + '">' + i + '</a>');
var headerEntry = '';
if (e['icon'] != 'undefined' && e['icon'] != '')
{
headerEntry += '<i class="navbar-brand-icon fa fa-' + e['icon'] + ' fa-fw"></i>';
}
var target = '';
if (e['target'] != null) target = e['target'];
headerEntry += '<a class="navbar-brand" href="' + e['link'] + '" target=' + target + '>' + e['description'] + '</a>';
$(".menu-header-items").append(headerEntry);
});
}
}
@@ -116,7 +129,10 @@ var FHC_NavigationWidget = {
strMenu += '<span>';
}
strMenu += '<a href="' + item['link'] + '"' + expanded + '>';
var target = '';
if (item['target'] != null) target = item['target'];
strMenu += '<a href="' + item['link'] + '"' + expanded + ' target="' + target + '">';
if (item['icon'] != 'undefined')
{
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 640 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 KiB

+29
View File
@@ -2192,6 +2192,35 @@ if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants
}
}
// Add missing Foreign Key to public.tbl_rt_person.person_id
if ($result = @$db->db_query("SELECT conname FROM pg_constraint WHERE conname = 'fk_tbl_rt_person_person_id'"))
{
if ($db->db_num_rows($result) == 0)
{
$qry = "SELECT person_id FROM public.tbl_rt_person WHERE NOT EXISTS(SELECT 1 FROM public.tbl_person WHERE person_id=tbl_rt_person.person_id)";
if($result = $db->db_query($qry))
{
if($db->db_num_rows($result)==0)
{
$qry = "ALTER TABLE public.tbl_rt_person ADD CONSTRAINT fk_tbl_rt_person_person_id FOREIGN KEY (person_id) REFERENCES public.tbl_person ON DELETE RESTRICT ON UPDATE CASCADE;";
if (!$db->db_query($qry))
echo '<strong>public.tbl_rt_person '.$db->db_last_error().'</strong><br>';
else
echo '<br>public.tbl_rt_person: added foreign key on column person_id';
}
else
{
echo '<strong>public.tbl_rt_person:
Fehlender Foreign Key auf person_id kann nicht erstellt werden!
In der Tabelle public.tbl_rt_person wird auf Personen verlinkt die nicht mehr in der Tabelle
public.tbl_person vorhanden sind. Bitte bereinigen Sie die Datensätze manuell und starten Sie dieses Script erneut.
</strong>';
}
}
}
}
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
+69 -69
View File
@@ -34,7 +34,7 @@ $p = new phrasen($sprache);
//get all notifications
$ampel_obj = new ampel();
$ampel_obj->getAll();
$ampel_obj->getAll();
$ampel_arr = $ampel_obj->result;
//filter only notifications that are not expired, not before vorlaufzeit AND email is true
@@ -56,9 +56,9 @@ foreach($ampel_arr as $ampel)
$overdue_user_arr = array();
if($result = $db->db_query($qry_all_ampel_user))
{
{
while($row = $db->db_fetch_object($result))
{
{
$user = $row->uid;
//break if almost confirmed
@@ -66,7 +66,7 @@ foreach($ampel_arr as $ampel)
break;
//check if notification is new (within last week, as cronjob will run every week)
if ($datum->DateDiff (date('Y-m-d'), $insert_date) >= -7)
if($datum->DateDiff(date('Y-m-d'), $insert_date) >= -7)
{
$new = true;
$new_user_arr[] = $user;
@@ -77,28 +77,32 @@ foreach($ampel_arr as $ampel)
{
$overdue = true;
$overdue_user_arr[] = $user;
}
}
}
}
};
};
if ($new)
{
$new_ampel_user_arr[] = array(
'ampel_id' => $ampel->ampel_id,
'ampel_bezeichnung' => $kurzbz,
'user' => $new_user_arr,
'deadline' => date('d.m.Y', $deadline));
}
$new_ampel_user_arr[] =
array(
'ampel_id' => $ampel->ampel_id,
'ampel_bezeichnung' => $kurzbz,
'user' => $new_user_arr,
'deadline' => date('d.m.Y', $deadline)
);
}
if ($overdue)
{
$overdue_ampel_user_arr[] = array(
'ampel_id' => $ampel->ampel_id,
'ampel_bezeichnung' => $kurzbz,
'user' => $overdue_user_arr,
'deadline' => date('d.m.Y', $deadline));
$overdue_ampel_user_arr[] =
array(
'ampel_id' => $ampel->ampel_id,
'ampel_bezeichnung' => $kurzbz,
'user' => $overdue_user_arr,
'deadline' => date('d.m.Y', $deadline)
);
}
}
};
//rearrange arrays as needed to send in eMails
$new_ampel_user_arr = organizeAmpelnForMail($new_ampel_user_arr);
@@ -113,29 +117,31 @@ foreach ($new_ampel_user_arr as $receiver)
$firstName = $person->vorname;
//link to notifications system site
$link = APP_ROOT . "cis/index.php?sprache=German&content_id=&menu=" . APP_ROOT . "cis/menu.php?content_id=&content=" . APP_ROOT . "cis/private/tools/ampelverwaltung.php";
$link = APP_ROOT. "cis/index.php?sprache=German&content_id=&menu=".
APP_ROOT. "cis/menu.php?content_id=&content=".
APP_ROOT. "cis/private/tools/ampelverwaltung.php";
//eMail data
$to = $receiver['user'] . '@' . DOMAIN;
$from = 'noreply@'.DOMAIN;
$to = $receiver['user']. '@'. DOMAIN;
$from = 'noreply@'. DOMAIN;
$subject = 'Sie haben eine neue Ampel!';
$title = "Sie haben neue Nachrichten in Ihrem Ampelsystem!";
$content = "<p>Hallo " . $firstName . ",</p>";
$headerImg = "sancho_header_neue_nachrichten_in_ampelsystem.jpg";
$content = "<p align=\"center\">Hallo ". $firstName. ",</p><br>";
$content .= "<p>es gibt neue Ampeln für Sie:</p><br>";
for ($i = 0; $i < count($receiver) - 1; $i++)
{
$receiver[$i]['ampel_id'];
$content .= "<p><i>NEU:</i>&nbsp&nbsp<strong>" . $receiver[$i]['ampel_bezeichnung'] . "</strong></p>";
$content .= "<p><strong>". strtoupper($receiver[$i]['ampel_bezeichnung']). "</strong></p></br>";
}
$content .= "<br><p>Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:</p>";
$content .= "<br><a style=\"color: #74ba24;\" href=" . $link . ">Zu meinem Ampelsystem</a></br>";
$content .= "<p><br>Schönen Tag noch,</p>";
$content .= "<p>Sancho</p>";
$content .= "<p>Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:</p>";
$content .= "<a style=\"color: #bfc130;\" href=". $link. ">Zu meinem Ampelsystem</a></br>";
$content .= "<p align=\"center\"><br>Schönen Tag noch,</br>";
$content .= "Sancho</p><br>";
//send eMail
sendMail($to, $from, $subject, $content, $title);
sendMail($to, $from, $subject, $content, $headerImg);
}
//send eMail for overdue notifications
@@ -147,30 +153,32 @@ foreach ($overdue_ampel_user_arr as $receiver)
$firstName = $person->vorname;
//link to notifications system site
$link = APP_ROOT . "cis/index.php?sprache=German&content_id=&menu=" . APP_ROOT . "cis/menu.php?content_id=&content=" . APP_ROOT . "cis/private/tools/ampelverwaltung.php";
$link = APP_ROOT. "cis/index.php?sprache=German&content_id=&menu=".
APP_ROOT. "cis/menu.php?content_id=&content=".
APP_ROOT. "cis/private/tools/ampelverwaltung.php";
//eMail data
$to = $receiver['user'] . '@' . DOMAIN;
$from = 'noreply@'.DOMAIN;
$subject = 'Bestätigen Sie bitte Ihre Ampel!';
$title = "Die Deadline für Ihre Ampel ist überschritten!";
$content = "<p>Hallo " . $firstName . ",</p>";
$content .= "<p>es gibt Ampeln, die von Ihnen noch bestätigt werden müssen:</p><br>";
$headerImg = "sancho_header_deadline_ampel_overdue.jpg";
$content = "<p align=\"center\">Hallo " . $firstName . ",</p><br>";
$content .= "<p>diese Ampeln müssen von Ihnen noch bestätigt werden:</p><br>";
for ($i = 0; $i < count($receiver) - 1; $i++)
{
$receiver[$i]['ampel_id'];
$content .= "<p><i>BESTÄTIGUNG FEHLT:</i>&nbsp&nbsp<strong>" . $receiver[$i]['ampel_bezeichnung'] . "</strong></p>";
$content .= "<p><small><i style=\"color: #65696E;\">Die Deadline für die Bestätigung war am <span style=\"color: #FF0000;\">" . $receiver[$i]['deadline'] . "</span></i></small></p><br>";
$content .= "<p><strong>" . strtoupper($receiver[$i]['ampel_bezeichnung']) . "</strong><br>";
$content .= "<small><i style=\"color: #65696E;\">Die Deadline für die Bestätigung war am <span style=\"color: #FF0000;\">" . $receiver[$i]['deadline'] . "</span></i></small></p><br>";
}
$content .= "<br><p>Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:</p>";
$content .= "<br><a style=\"color: #74ba24;\" href=" . $link . ">Zu meinem Ampelsystem</a></br>";
$content .= "<p><br>Schönen Tag noch,</p>";
$content .= "<p>Sancho</p>";
$content .= "<p>Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:</p>";
$content .= "<a style=\"color: #bfc130;\" href=\"$link\">Zu meinem Ampelsystem</a><br>";
$content .= "<p align=\"center\"><br>Schönen Tag noch!<br>";
$content .= "Sancho</p><br>";
//send eMail
sendMail($to, $from, $subject, $content, $title);
sendMail($to, $from, $subject, $content, $headerImg);
}
@@ -234,10 +242,10 @@ function organizeAmpelnForMail ($ampel_user_arr)
}
return $unique_user_arr;
}
function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue Nachrichten für Sie!')
function sendMail($to, $from, $subject, $html_content, $headerImg = 'sancho_header_sie_haben_neue_nachrichten.jpg')
{
$sancho_img = APP_ROOT . "skin/images/sancho_round_right_blue.png";
$logo_img = APP_ROOT . "skin/images/fh_logo.png";
$sanchoHeader_img = APP_ROOT . "skin/images/sancho/" . $headerImg;
$sanchoFooter_img = APP_ROOT . "skin/images/sancho/sancho_footer.jpg";
//mail content as plain text (fallback if html not activated)
$plain_text = "Hallo,\n\n";
@@ -249,6 +257,7 @@ function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue
/*
* no css styles in html-head (email clients picky about that)
* tables inside tables for correct styles in different email clients
* border-collapse and mso-table: this corrects strange behavior of outlook 2013 adding unwished extra space
*/
$html_text = '
<html>
@@ -256,26 +265,24 @@ function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue
<title>Sancho Ampelmail</title>
</head>
<body><center>
<table width="650px" cellpadding="0" cellspacing="0" style="border: 2px solid #65696e; border-spacing: 0px; margin-top: 40px;">
<table cellpadding="0" cellspacing="0" style="border: 2px solid #000000; padding: 0px; max-width: 850px;
border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td align="left">
<table cellpadding="0" width="100%" cellspacing="0" style="padding:0; border-bottom: 2px solid #A0A0A0; margin: 0; font-family: arial, verdana, sans-serif; font-size: 0.8em; border-spacing: 0px;">
<td align="center">
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td width="25%" style="padding: 25px;">
<img src="cid:SanchoFace" align="left" alt="sancho_face" width="105" height="105">
</td>
<td width="75%" style="padding: 25px;">
<h4 align="center" style="padding-top: 20">' . $title . '</h4>
<td>
<img src="cid:SanchoHeader" alt="sancho_header" width="100%">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left">
<table cellpadding="0" width="100%" cellspacing="0" style="padding:0; border-bottom: 2px solid #A0A0A0; margin: 0; font-family: arial, verdana, sans-serif; font-size: 0.8em; border-spacing: 0px;">
<td align="center">
<table cellpadding="0" cellspacing="0" width="100%" style="font-family: courier, verdana, sans-serif; font-size: 0.95em; border-bottom: 2px solid #000000;">
<tr>
<td style="padding: 25px;">
<td style="padding-left: 8%; padding-right: 8%; padding-top: 5%; padding-bottom: 5%;">
<br>' . $html_content . '</br>
</td>
</tr>
@@ -283,14 +290,11 @@ function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue
</td>
</tr>
<tr>
<td align="left">
<table cellpadding="0" width="100%" cellspacing="0" style="padding:0; margin: 0; font-family: arial, verdana, sans-serif; font-size: 0.8em; border-spacing: 0px;">
<td align="center">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="75%" style="padding: 25px;">
<span style="color: #0a629c; padding: 20 0 0 20;">So spannend kann Technik sein!</span>
</td>
<td width="25%" style="padding: 25px;">
<a href="https://www.technikum-wien.at"><img src="cid:Logo" align="right" alt="logo" width="120" height="70">
<td>
<img src="cid:SanchoFooter" alt="sancho_footer" width="100%">
</td>
</tr>
</table>
@@ -302,14 +306,10 @@ function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue
$mail = new mail($to, $from, $subject, $plain_text);
$mail->setHtmlContent($html_text);
$mail->addEmbeddedImage($sancho_img, "image/png", "", "SanchoFace");
$mail->addEmbeddedImage($logo_img, "image/png", "", "Logo");
$mail->addEmbeddedImage($sanchoFooter_img, "image/jpg", "", "SanchoFooter");
$mail->addEmbeddedImage($sanchoHeader_img, "image/jpg", "", "SanchoHeader");
if(!$mail->send())
echo $p->t('global/emailNichtVersendet') . ' an ' . $to . "<br>";
}
+1
View File
@@ -125,6 +125,7 @@ if(isset($radio_1) && isset($radio_2) && $radio_1>=0 && $radio_2>=0)
$sql_query_upd1.="UPDATE public.tbl_msg_status SET person_id=".$db->db_add_param($radio_2, FHC_INTEGER)." WHERE person_id=".$db->db_add_param($radio_1, FHC_INTEGER).";";
$sql_query_upd1.="UPDATE system.tbl_person_lock SET person_id=".$db->db_add_param($radio_2, FHC_INTEGER)." WHERE person_id=".$db->db_add_param($radio_1, FHC_INTEGER).";";
$sql_query_upd1.="UPDATE system.tbl_log SET person_id=".$db->db_add_param($radio_2, FHC_INTEGER)." WHERE person_id=".$db->db_add_param($radio_1, FHC_INTEGER).";";
$sql_query_upd1.="UPDATE public.tbl_rt_person SET person_id=".$db->db_add_param($radio_2, FHC_INTEGER)." WHERE person_id=".$db->db_add_param($radio_1, FHC_INTEGER).";";
$sql_query_upd1.="DELETE FROM public.tbl_person WHERE person_id=".$db->db_add_param($radio_1, FHC_INTEGER).";";
if($db->db_query($sql_query_upd1))