mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge branch 'master' of https://github.com/FH-Complete/FHC-Core
This commit is contained in:
@@ -13,9 +13,11 @@
|
||||
- **[FAS]** Bei Statuswechsel von Studierenden können Gründe für den Statuswechsel angegeben werden
|
||||
- **[ADDONS]** Addons können Menüpunkte im Vilesci anpassen
|
||||
- **[ADDONS]** Addons können Noten für die Gesamtnote vorschlagen
|
||||
- **[CORE]** UserDefinedFields
|
||||
|
||||
### CHANGED
|
||||
- **[CORE]** Berechtigungsprüfung wurde angepasst damit deaktivierte Benutzer keine Berechtigungen mehr haben
|
||||
- **[FAS]** Mitarbeiterexport exportiert jetzt nur noch die markierten Personen
|
||||
|
||||
### Updateinfo
|
||||
- **[CORE]** Infoscreen wurde umbenannt (informationsbildschirm.php)
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
//require_once APPPATH . '/libraries/REST_Controller.php';
|
||||
|
||||
/**
|
||||
* Testing class for REST calls and authentication
|
||||
*/
|
||||
@@ -16,37 +14,17 @@ class Test extends APIv1_Controller
|
||||
|
||||
/**
|
||||
* Test HTTP GET method
|
||||
* It responses whith the HTTP status 200 and prints this JSON string
|
||||
* {"success":true,"message":"API HTTP GET call test succeed"}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getTest()
|
||||
{
|
||||
$payload = [
|
||||
'success' => TRUE,
|
||||
'message' => 'API HTTP GET call test succeed',
|
||||
'error' => 0
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$this->response($payload, $httpstatus);
|
||||
$this->response(success('API HTTP GET call test succeed'), REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test HTTP POST method
|
||||
* * It responses whith the HTTP status 200 and prints this JSON string
|
||||
* {"success":true,"message":"API HTTP POST call test succeed"}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function postTest()
|
||||
{
|
||||
$payload = [
|
||||
'success' => TRUE,
|
||||
'message' => 'API HTTP POST call test succeed',
|
||||
'error' => 0
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$this->response($payload, $httpstatus);
|
||||
$this->response(success('API HTTP POST call test succeed'), REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<?php
|
||||
|
||||
require_once APPPATH . '/libraries/REST_Controller.php';
|
||||
require_once APPPATH.'/libraries/REST_Controller.php';
|
||||
|
||||
class APIv1_Controller extends REST_Controller
|
||||
{
|
||||
function __construct()
|
||||
/**
|
||||
* Standard constructor for all the RESTful resources
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -13,4 +16,4 @@ class APIv1_Controller extends REST_Controller
|
||||
|
||||
log_message('debug', 'Called API: '.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+151
-192
@@ -26,7 +26,7 @@ class DB_Model extends FHC_Model
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function __construct($dbTable = null, $pk = null, $hasSequence = true)
|
||||
public function __construct($dbTable = null, $pk = null, $hasSequence = true)
|
||||
{
|
||||
// Call parent constructor
|
||||
parent::__construct();
|
||||
@@ -54,15 +54,14 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function insert($data)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->dbTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
// Check class properties
|
||||
if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
|
||||
// Checks rights
|
||||
if ($isEntitled = $this->_isEntitled(PermissionLib::INSERT_RIGHT)) return $isEntitled;
|
||||
if (isError($ent = $this->_isEntitled(PermissionLib::INSERT_RIGHT))) return $ent;
|
||||
|
||||
// If this table has UDF and the validation of them is ok
|
||||
if ($this->hasUDF() && isError($validate = $this->udflib->manageUDFs($data, $this->dbTable))) return $validate;
|
||||
if (isError($validate = $this->_manageUDFs($data, $this->dbTable))) return $validate;
|
||||
|
||||
// DB-INSERT
|
||||
if ($this->db->insert($this->dbTable, $data))
|
||||
@@ -90,32 +89,9 @@ class DB_Model extends FHC_Model
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace Data in DB-Table
|
||||
*
|
||||
* @param array $data DataArray for Replacement
|
||||
* @return array
|
||||
*
|
||||
* DEPRECATED: to be updated, not maintained
|
||||
*
|
||||
*/
|
||||
public function replace($data)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->dbTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
|
||||
// Checks rights
|
||||
if ($isEntitled = $this->_isEntitled(PermissionLib::REPLACE_RIGHT)) return $isEntitled;
|
||||
|
||||
// DB-REPLACE
|
||||
if ($this->db->replace($this->dbTable, $data))
|
||||
return success($this->db->insert_id());
|
||||
else
|
||||
return error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,36 +103,42 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function update($id, $data)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->dbTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
if (is_null($this->pk))
|
||||
return error(FHC_MODEL_ERROR, FHC_NOPK);
|
||||
// Check class properties
|
||||
if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK);
|
||||
if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
|
||||
// Checks rights
|
||||
if ($isEntitled = $this->_isEntitled(PermissionLib::UPDATE_RIGHT)) return $isEntitled;
|
||||
if (isError($ent = $this->_isEntitled(PermissionLib::UPDATE_RIGHT))) return $ent;
|
||||
|
||||
// If this table has UDF and the validation of them is ok
|
||||
if ($this->hasUDF() && isError($validate = $this->udflib->manageUDFs($data, $this->dbTable, $this->getUDFs($id))))
|
||||
{
|
||||
return $validate;
|
||||
}
|
||||
if (isError($validate = $this->_manageUDFs($data, $this->dbTable, $id))) return $validate;
|
||||
|
||||
// DB-UPDATE
|
||||
// Check for composite Primary Key
|
||||
$tmpId = $id;
|
||||
|
||||
// Check for composite Primary Key, prepare the where clause
|
||||
if (is_array($id))
|
||||
{
|
||||
if (isset($id[0]))
|
||||
$this->db->where($this->arrayMergeIndex($this->pk, $id));
|
||||
else
|
||||
$this->db->where($id);
|
||||
{
|
||||
$tmpId = $this->_arrayCombine($this->pk, $id);
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->db->where($this->pk, $id);
|
||||
{
|
||||
$tmpId = array($this->pk => $id);
|
||||
}
|
||||
|
||||
$this->db->where($tmpId);
|
||||
|
||||
// DB-UPDATE
|
||||
if ($this->db->update($this->dbTable, $data))
|
||||
{
|
||||
return success($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,30 +149,37 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->dbTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
if (is_null($this->pk))
|
||||
return error(FHC_MODEL_ERROR, FHC_NOPK);
|
||||
// Check class properties
|
||||
if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK);
|
||||
|
||||
// Checks rights
|
||||
if ($isEntitled = $this->_isEntitled(PermissionLib::DELETE_RIGHT)) return $isEntitled;
|
||||
|
||||
// DB-DELETE
|
||||
if (isError($ent = $this->_isEntitled(PermissionLib::DELETE_RIGHT))) return $ent;
|
||||
|
||||
$tmpId = $id;
|
||||
|
||||
// Check for composite Primary Key
|
||||
if (is_array($id))
|
||||
{
|
||||
if (isset($id[0]))
|
||||
$result = $this->db->delete($this->dbTable, $this->arrayMergeIndex($this->pk, $id));
|
||||
else
|
||||
$result = $this->db->delete($this->dbTable, $id);
|
||||
{
|
||||
$tmpId = $this->_arrayCombine($this->pk, $id);
|
||||
}
|
||||
}
|
||||
else
|
||||
$result = $this->db->delete($this->dbTable, array($this->pk => $id));
|
||||
if ($result)
|
||||
{
|
||||
$tmpId = array($this->pk => $id);
|
||||
}
|
||||
|
||||
// DB-DELETE
|
||||
if ($this->db->delete($this->dbTable, $tmpId))
|
||||
{
|
||||
return success($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -201,33 +190,37 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function load($id = null)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->dbTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
if (is_null($this->pk))
|
||||
return error(FHC_MODEL_ERROR, FHC_NOPK);
|
||||
// Check class properties
|
||||
if (is_null($this->pk)) return error(FHC_MODEL_ERROR, FHC_NOPK);
|
||||
if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
|
||||
// Checks rights
|
||||
if ($isEntitled = $this->_isEntitled(PermissionLib::SELECT_RIGHT)) return $isEntitled;
|
||||
if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent;
|
||||
|
||||
$tmpId = $id;
|
||||
|
||||
// DB-SELECT
|
||||
// Check for composite Primary Key
|
||||
if (is_array($id))
|
||||
{
|
||||
if (isset($id[0]))
|
||||
$result = $this->db->get_where($this->dbTable, $this->arrayMergeIndex($this->pk, $id));
|
||||
else
|
||||
$result = $this->db->get_where($this->dbTable, $id);
|
||||
{
|
||||
$tmpId = $this->_arrayCombine($this->pk, $id);
|
||||
}
|
||||
}
|
||||
elseif ($id != null)
|
||||
{
|
||||
$tmpId = array($this->pk => $id);
|
||||
}
|
||||
elseif (empty($id))
|
||||
$result = $this->db->get($this->dbTable);
|
||||
else
|
||||
$result = $this->db->get_where($this->dbTable, array($this->pk => $id));
|
||||
|
||||
if ($result)
|
||||
// DB-SELECT
|
||||
if ($result = $this->db->get_where($this->dbTable, $tmpId))
|
||||
{
|
||||
return success($this->_toPhp($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,20 +230,21 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function loadWhere($where = null)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->dbTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
// Check class properties
|
||||
if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
|
||||
// Checks rights
|
||||
if ($isEntitled = $this->_isEntitled(PermissionLib::SELECT_RIGHT)) return $isEntitled;
|
||||
if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent;
|
||||
|
||||
// Execute query
|
||||
$result = $this->db->get_where($this->dbTable, $where);
|
||||
|
||||
if ($result)
|
||||
if ($result = $this->db->get_where($this->dbTable, $where))
|
||||
{
|
||||
return success($this->_toPhp($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,12 +261,11 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function loadTree($mainTable, $sideTables, $where = null, $sideTablesAliases = null)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->dbTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
// Check class properties
|
||||
if (is_null($this->dbTable)) return error(FHC_MODEL_ERROR, FHC_NODBTABLE);
|
||||
|
||||
// Checks rights
|
||||
if ($isEntitled = $this->_isEntitled(PermissionLib::SELECT_RIGHT)) return $isEntitled;
|
||||
if (isError($ent = $this->_isEntitled(PermissionLib::SELECT_RIGHT))) return $ent;
|
||||
|
||||
// List of tables on which it will work
|
||||
$tables = array_merge(array($mainTable), $sideTables);
|
||||
@@ -302,7 +295,7 @@ class DB_Model extends FHC_Model
|
||||
// To avoid overwriting of the properties within the object returned by CI
|
||||
// will be given an alias to every column, that will be composed with the following schema
|
||||
// <table name>.<column name> AS <table_name>_<column name>
|
||||
$select .= $tables[$t] . '.' . $fields[$f]->column_name . ' AS ' . $tables[$t] . '_' . $fields[$f]->column_name;
|
||||
$select .= $tables[$t].'.'.$fields[$f]->column_name.' AS '.$tables[$t].'_'.$fields[$f]->column_name;
|
||||
if ($f < count($fields) - 1) $select .= ', ';
|
||||
}
|
||||
|
||||
@@ -343,7 +336,7 @@ class DB_Model extends FHC_Model
|
||||
|
||||
foreach (array_slice($objectVars, $tableColumnsCountArrayOffset, $tableColumnsCountArray[$f]) as $key => $value)
|
||||
{
|
||||
$objTmpArray[$f]->{str_replace($tables[$f] . '_', '', $key)} = $value;
|
||||
$objTmpArray[$f]->{str_replace($tables[$f].'_', '', $key)} = $value;
|
||||
}
|
||||
|
||||
$tableColumnsCountArrayOffset += $tableColumnsCountArray[$f]; // Increasing the offset
|
||||
@@ -378,7 +371,7 @@ class DB_Model extends FHC_Model
|
||||
{
|
||||
$returnArray[$k]->{$sideTableProperty} = array($sideTableObj);
|
||||
}
|
||||
else if (array_search($sideTableObj, $returnArray[$k]->{$sideTableProperty}) === false)
|
||||
elseif (array_search($sideTableObj, $returnArray[$k]->{$sideTableProperty}) === false)
|
||||
{
|
||||
array_push($returnArray[$k]->{$sideTableProperty}, $sideTableObj);
|
||||
}
|
||||
@@ -425,9 +418,8 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function addOrder($field = null, $type = 'ASC')
|
||||
{
|
||||
// Check Class-Attributes and parameters
|
||||
if (is_null($field) || !in_array($type, array('ASC', 'DESC')))
|
||||
return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
// Check class properties and parameters
|
||||
if (is_null($field) || !in_array($type, array('ASC', 'DESC'))) return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
|
||||
$this->db->order_by($field, $type);
|
||||
|
||||
@@ -441,9 +433,8 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function addSelect($select, $escape = true)
|
||||
{
|
||||
// Check Class-Attributes and parameters
|
||||
if (is_null($select) || $select == '')
|
||||
return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
// Check class properties and parameters
|
||||
if (is_null($select) || $select == '') return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
|
||||
$this->db->select($select, $escape);
|
||||
|
||||
@@ -467,9 +458,8 @@ class DB_Model extends FHC_Model
|
||||
*/
|
||||
public function addLimit($start = null, $end = null)
|
||||
{
|
||||
// Check Class-Attributes and parameters
|
||||
if (!is_numeric($start) || (is_numeric($start) && $start <= 0))
|
||||
return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
// Check class properties and parameters
|
||||
if (!is_numeric($start) || (is_numeric($start) && $start <= 0)) return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
|
||||
if (is_numeric($end) && $end > $start)
|
||||
{
|
||||
@@ -493,12 +483,11 @@ class DB_Model extends FHC_Model
|
||||
$tmpTable = trim($table);
|
||||
|
||||
// Check parameters
|
||||
if (empty($tmpTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
if (empty($tmpTable)) return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
|
||||
if (!empty($alias))
|
||||
{
|
||||
$tmpTable .= ' AS ' . $alias;
|
||||
$tmpTable .= ' AS '.$alias;
|
||||
}
|
||||
|
||||
$this->db->from($tmpTable);
|
||||
@@ -562,7 +551,7 @@ class DB_Model extends FHC_Model
|
||||
return true;
|
||||
}
|
||||
// If false
|
||||
else if ($val == DB_Model::PGSQL_BOOLEAN_FALSE)
|
||||
elseif ($val == DB_Model::PGSQL_BOOLEAN_FALSE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -570,65 +559,11 @@ class DB_Model extends FHC_Model
|
||||
// If it is null, let it be null
|
||||
return $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert PG-Array to PHP-Array
|
||||
*
|
||||
* @param string $s PG-String to convert
|
||||
* @param string $start start-point for recursive iterations
|
||||
* @param string $end end-point for recursive iterations
|
||||
* @return array
|
||||
*/
|
||||
public function pgArrayPhp($s, $start=0, &$end=NULL)
|
||||
{
|
||||
if (empty($s) || $s[0]!='{') return NULL;
|
||||
$return = array();
|
||||
$br = 0;
|
||||
$string = false;
|
||||
$quote='';
|
||||
$len = strlen($s);
|
||||
$v = '';
|
||||
for ($i=$start+1; $i<$len;$i++)
|
||||
{
|
||||
$ch = $s[$i];
|
||||
if (!$string && $ch=='}')
|
||||
{
|
||||
if ($v!=='' || !empty($return))
|
||||
$return[] = $v;
|
||||
$end = $i;
|
||||
break;
|
||||
}
|
||||
else
|
||||
if (!$string && $ch=='{')
|
||||
$v = $this->pgArrayPhp($s,$i,$i);
|
||||
else
|
||||
if (!$string && $ch==',')
|
||||
{
|
||||
$return[] = $v;
|
||||
$v = '';
|
||||
}
|
||||
else
|
||||
if (!$string && ($ch=='\'' || $ch=='\''))
|
||||
{
|
||||
$string = true;
|
||||
$quote = $ch;
|
||||
}
|
||||
else
|
||||
if ($string && $ch==$quote && $s[$i-1]=='\\')
|
||||
$v = substr($v,0,-1).$ch;
|
||||
else
|
||||
if ($string && $ch==$quote && $s[$i-1]!='\\')
|
||||
$string = FALSE;
|
||||
else
|
||||
$v .= $ch;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts from PostgreSQL array to php array
|
||||
* It also takes care about array of booleans
|
||||
*/
|
||||
* Converts from PostgreSQL array to php array
|
||||
* It also takes care about array of booleans
|
||||
*/
|
||||
public function pgsqlArrayToPhpArray($string, $booleans = false)
|
||||
{
|
||||
// At least returns an empty array
|
||||
@@ -696,13 +631,14 @@ class DB_Model extends FHC_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Returns all the UDF contained in this table ($dbTable)
|
||||
* If no UDF are present, an empty array will be returned
|
||||
*/
|
||||
public function getUDFs($id, $udfName = null)
|
||||
{
|
||||
$udfs = array();
|
||||
|
||||
$this->addSelect(UDFLib::COLUMN_NAME);
|
||||
$this->addSelect(UDFLib::COLUMN_NAME); // select only the column with UDF
|
||||
|
||||
$result = $this->load($id);
|
||||
if (hasData($result))
|
||||
@@ -713,12 +649,12 @@ class DB_Model extends FHC_Model
|
||||
{
|
||||
if ($udfName != null && $udfName == $key)
|
||||
{
|
||||
$udfs[$key] = $value; //
|
||||
$udfs[$key] = $value;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$udfs[$key] = $value; //
|
||||
$udfs[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -737,22 +673,6 @@ class DB_Model extends FHC_Model
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Protected methods
|
||||
|
||||
/**
|
||||
* Invalid ID
|
||||
*
|
||||
* @param array $i Array with indexes.
|
||||
* @param array $v Array with values.
|
||||
* @return array
|
||||
*/
|
||||
protected function arrayMergeIndex($idexes, $values)
|
||||
{
|
||||
if (count($idexes) != count($values))
|
||||
return false;
|
||||
for ($j = 0; $j < count($idexes); $j++)
|
||||
$a[$idexes[$j]] = $values[$j];
|
||||
return $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a query and converts array and boolean data types from PgSql to php
|
||||
* @return: boolean false on failure
|
||||
@@ -803,8 +723,8 @@ class DB_Model extends FHC_Model
|
||||
protected function getSchemaAndTable($schemaAndTable)
|
||||
{
|
||||
$result = new stdClass();
|
||||
$result->schema = DB_Model::DEFAULT_SCHEMA;
|
||||
$result->table = $schemaAndTable;
|
||||
$result->schema = DB_Model::DEFAULT_SCHEMA;
|
||||
|
||||
// If a schema is specified
|
||||
if (($pos = strpos($schemaAndTable, '.')) !== false)
|
||||
@@ -819,27 +739,66 @@ class DB_Model extends FHC_Model
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Invalid ID
|
||||
*
|
||||
* @param array $i Array with indexes.
|
||||
* @param array $v Array with values.
|
||||
* @return array
|
||||
*/
|
||||
private function _arrayCombine($idexes, $values)
|
||||
{
|
||||
if (count($idexes) != count($values)) return null;
|
||||
|
||||
return array_combine($idexes, $values);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the caller is entitled to perform this operation with this right
|
||||
*/
|
||||
private function _isEntitled($permission)
|
||||
{
|
||||
$ent = success(true);
|
||||
|
||||
// If the caller is _not_ a model _and_ tries to read data, then avoids to check permissions
|
||||
// Otherwise checks always the permissions
|
||||
if (($permission == PermissionLib::SELECT_RIGHT &&
|
||||
substr(get_called_class(), -6) == DB_Model::MODEL_POSTFIX) ||
|
||||
$permission != PermissionLib::SELECT_RIGHT)
|
||||
if (($permission == PermissionLib::SELECT_RIGHT
|
||||
&& substr(get_called_class(), -6) == DB_Model::MODEL_POSTFIX)
|
||||
|| $permission != PermissionLib::SELECT_RIGHT)
|
||||
{
|
||||
$ent = $this->isEntitled($this->dbTable, $permission, FHC_NORIGHT, FHC_MODEL_ERROR);
|
||||
// If true is not returned, then an error has occurred
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, $permission, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
if (isError($ent))
|
||||
{
|
||||
// Before returning the object containing the error, reset the build query
|
||||
// This is for preventing that other parts of the query will be built before of the next execution
|
||||
$this->resetQuery();
|
||||
|
||||
return $isEntitled;
|
||||
}
|
||||
}
|
||||
|
||||
return $ent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method for UDFLib->manageUDFs
|
||||
*/
|
||||
private function _manageUDFs(&$data, $schemaAndTable, $id = null)
|
||||
{
|
||||
$manageUDFs = success(true);
|
||||
|
||||
if ($this->hasUDF())
|
||||
{
|
||||
if ($id != null)
|
||||
{
|
||||
$manageUDFs = $this->udflib->manageUDFs($data, $this->dbTable, $this->getUDFs($id));
|
||||
}
|
||||
else
|
||||
{
|
||||
$manageUDFs = $this->udflib->manageUDFs($data, $this->dbTable);
|
||||
}
|
||||
}
|
||||
|
||||
return $manageUDFs;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -858,7 +817,7 @@ class DB_Model extends FHC_Model
|
||||
{
|
||||
$toBeConverterdArray = array(); // Fields to be converted
|
||||
$metaDataArray = $result->field_data(); // Fields information
|
||||
for($i = 0; $i < count($metaDataArray); $i++) // Looking for booleans and arrays
|
||||
for ($i = 0; $i < count($metaDataArray); $i++) // Looking for booleans and arrays
|
||||
{
|
||||
// If array type, boolean type OR a UDF
|
||||
if (strpos($metaDataArray[$i]->type, DB_Model::PGSQL_ARRAY_TYPE) !== false
|
||||
@@ -882,12 +841,12 @@ class DB_Model extends FHC_Model
|
||||
// Returns the array of objects, each of them represents a DB record
|
||||
$resultsArray = $result->result();
|
||||
// Looping on results
|
||||
for($i = 0; $i < count($resultsArray); $i++)
|
||||
for ($i = 0; $i < count($resultsArray); $i++)
|
||||
{
|
||||
// Single element
|
||||
$resultElement = $resultsArray[$i];
|
||||
// Looping on fields to be converted
|
||||
for($j = 0; $j < count($toBeConverterdArray); $j++)
|
||||
for ($j = 0; $j < count($toBeConverterdArray); $j++)
|
||||
{
|
||||
// Single element
|
||||
$toBeConverted = $toBeConverterdArray[$j];
|
||||
@@ -901,12 +860,12 @@ class DB_Model extends FHC_Model
|
||||
);
|
||||
}
|
||||
// Boolean type
|
||||
else if ($toBeConverted->type == DB_Model::PGSQL_BOOLEAN_TYPE)
|
||||
elseif ($toBeConverted->type == DB_Model::PGSQL_BOOLEAN_TYPE)
|
||||
{
|
||||
$resultElement->{$toBeConverted->name} = $this->pgBoolPhp($resultElement->{$toBeConverted->name});
|
||||
}
|
||||
// UDF
|
||||
else if ($this->udflib->isUDFColumn($toBeConverted->name, $toBeConverted->type))
|
||||
elseif ($this->udflib->isUDFColumn($toBeConverted->name, $toBeConverted->type))
|
||||
{
|
||||
$jsonValues = json_decode($resultElement->{$toBeConverted->name}); // decode UDFs values
|
||||
if ($jsonValues != null) // if decode is ok
|
||||
@@ -964,4 +923,4 @@ class DB_Model extends FHC_Model
|
||||
|
||||
return $this->execQuery($query, array(strtolower($schema), strtolower($table)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,13 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FHC_Controller extends CI_Controller
|
||||
{
|
||||
/**
|
||||
* Standard construct for all the controllers, loads the authentication system
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->helper('fhcauth');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,12 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FHC_Model extends CI_Model
|
||||
{
|
||||
function __construct()
|
||||
/**
|
||||
* Standard constructor for all the models
|
||||
* It loads the helper message to manage the values returned by methods
|
||||
* It loads the permission library
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -25,19 +30,20 @@ class FHC_Model extends CI_Model
|
||||
*/
|
||||
public function isEntitled($sourceName, $accessType, $languageMessageCode, $msgErrorCode)
|
||||
{
|
||||
$isEntitled = success(true);
|
||||
|
||||
if ($this->permissionlib->isEntitled($sourceName, $accessType) === false)
|
||||
{
|
||||
$retval = sprintf(
|
||||
'%s -> %s:%s',
|
||||
lang('fhc_' . $languageMessageCode),
|
||||
lang('fhc_'.$languageMessageCode),
|
||||
$this->permissionlib->getBerechtigungKurzbz($sourceName),
|
||||
$accessType
|
||||
);
|
||||
return error($retval, $msgErrorCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
|
||||
$isEntitled = error($retval, $msgErrorCode);
|
||||
}
|
||||
|
||||
return $isEntitled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
class FS_Model extends FHC_Model
|
||||
{
|
||||
protected $filepath; // Path of the file
|
||||
protected $acl; // Name of the permissions array index for FS writing, reading...
|
||||
|
||||
function __construct($filepath = null)
|
||||
|
||||
/**
|
||||
* Loads FilesystemLib and set properties
|
||||
*/
|
||||
public function __construct($filepath = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -26,16 +28,13 @@ class FS_Model extends FHC_Model
|
||||
public function read($filename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (($chkRights = $this->isEntitled($this->filepath, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $chkRights;
|
||||
if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
if (!is_null($data = $this->filesystemlib->read($this->filepath, $filename)))
|
||||
{
|
||||
@@ -56,18 +55,14 @@ class FS_Model extends FHC_Model
|
||||
public function write($filename, $content)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($content))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (($chkRights = $this->isEntitled($this->filepath, PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $chkRights;
|
||||
if (isError(($ent = $this->isEntitled($this->filepath, PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))) return $ent;
|
||||
|
||||
if ($this->filesystemlib->write($this->filepath, $filename, base64_decode($content)) === true)
|
||||
{
|
||||
@@ -88,18 +83,14 @@ class FS_Model extends FHC_Model
|
||||
public function append($filename, $content)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($content))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (($chkRights = $this->isEntitled($this->filepath, PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $chkRights;
|
||||
if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
if ($this->filesystemlib->append($this->filepath, $filename, base64_decode($content)) === true)
|
||||
{
|
||||
@@ -120,16 +111,13 @@ class FS_Model extends FHC_Model
|
||||
public function remove($filename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (($chkRights = $this->isEntitled($this->filepath, PermissionLib::DELETE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $chkRights;
|
||||
if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::DELETE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
if ($this->filesystemlib->remove($this->filepath, $filename) === true)
|
||||
{
|
||||
@@ -150,18 +138,14 @@ class FS_Model extends FHC_Model
|
||||
public function rename($filename, $newFilename)
|
||||
{
|
||||
// Check Class-Attributes
|
||||
if (is_null($this->filepath))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check method parameters
|
||||
if (is_null($filename))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($newFilename))
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
if (is_null($newFilename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
|
||||
// Check rights
|
||||
if (($chkRights = $this->isEntitled($this->filepath, PermissionLib::UPDATE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $chkRights;
|
||||
if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::UPDATE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
if ($this->filesystemlib->rename($this->filepath, $filename, $this->filepath, $newFilename) === true)
|
||||
{
|
||||
@@ -172,4 +156,4 @@ class FS_Model extends FHC_Model
|
||||
return error(FHC_MODEL_ERROR, FHC_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class VileSci_Controller extends FHC_Controller
|
||||
{
|
||||
function __construct()
|
||||
/**
|
||||
* Standard construct for all the controllers used in VileSci
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class CallerLib
|
||||
}
|
||||
}
|
||||
// If the given resource is a library
|
||||
else if (strpos($parameters->resourceName, CallerLib::LIB_PREFIX) !== false)
|
||||
elseif (strpos($parameters->resourceName, CallerLib::LIB_PREFIX) !== false)
|
||||
{
|
||||
// Check if the resource is already loaded, it works only with libraries and drivers
|
||||
$isLoaded = $this->ci->load->is_loaded($parameters->resourceName);
|
||||
@@ -89,10 +89,10 @@ class CallerLib
|
||||
// Checks if the operation is permitted by the API caller
|
||||
// Only for libraries, permissions are automatically handled by models
|
||||
$result = $this->checkLibraryPermission(
|
||||
$parameters->resourcePath,
|
||||
$parameters->resourceName,
|
||||
$parameters->function,
|
||||
$permissionType
|
||||
$parameters->resourcePath,
|
||||
$parameters->resourceName,
|
||||
$parameters->function,
|
||||
$permissionType
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
@@ -117,7 +117,7 @@ class CallerLib
|
||||
// Wrong selection!
|
||||
else
|
||||
{
|
||||
$result = error('Neither a lib nor model: ' . $parameters->resourcePath . $parameters->resourceName);
|
||||
$result = error('Neither a lib nor model: '.$parameters->resourcePath.$parameters->resourceName);
|
||||
}
|
||||
|
||||
// If the resource was found and loaded
|
||||
@@ -166,7 +166,7 @@ class CallerLib
|
||||
$parameters->resourcePath = str_replace($parameters->resourceName, '', $parameterValue);
|
||||
}
|
||||
// The name of the function
|
||||
else if ($parameterName == CallerLib::FUNCTION_PARAMETER)
|
||||
elseif ($parameterName == CallerLib::FUNCTION_PARAMETER)
|
||||
{
|
||||
$parameters->function = $parameterValue;
|
||||
}
|
||||
@@ -217,7 +217,7 @@ class CallerLib
|
||||
|
||||
/**
|
||||
* Loads a model using the given path and name
|
||||
*
|
||||
*
|
||||
* NOTE: the models automatically handle the permissions
|
||||
*/
|
||||
private function _loadModel($resourcePath, $resourceName)
|
||||
@@ -227,12 +227,12 @@ class CallerLib
|
||||
|
||||
try
|
||||
{
|
||||
$loaded = $this->ci->load->model($resourcePath . $resourceName);
|
||||
$loaded = $this->ci->load->model($resourcePath.$resourceName);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// Errors while loading the model
|
||||
$result = error('Errors while loading the model: ' . $e->getMessage());
|
||||
$result = error('Errors while loading the model: '.$e->getMessage());
|
||||
}
|
||||
|
||||
if (!is_null($loaded))
|
||||
@@ -257,7 +257,7 @@ class CallerLib
|
||||
$permissionPath = $resourcePath;
|
||||
}
|
||||
|
||||
$permissionPath .= $resourceName . '.' . $function;
|
||||
$permissionPath .= $resourceName.'.'.$function;
|
||||
|
||||
if ($this->ci->permissionlib->isEntitled($permissionPath, $permissionType) === false)
|
||||
{
|
||||
@@ -273,14 +273,14 @@ class CallerLib
|
||||
|
||||
/**
|
||||
* Loads a library using the given path and name
|
||||
*
|
||||
*
|
||||
* The method 'library' of the class CI_Loader provided by CI has some limitations,
|
||||
* so to be able to check errors was used a workaround.
|
||||
* It consists in:
|
||||
* - Checking if the file (identified by parameters $resourcePath and $resourceName) exists
|
||||
* - If exists it will be loaded using the method 'file' from CI_Loader
|
||||
* - Checks if the loaded file contains a class identified by parameter $resourceName
|
||||
*
|
||||
*
|
||||
* If one of the previous tests fails, it will be returned a null value
|
||||
*/
|
||||
private function _loadLibrary($resourcePath, $resourceName)
|
||||
@@ -295,8 +295,8 @@ class CallerLib
|
||||
$found = null;
|
||||
for ($i = 0; $i < count($packagePaths) && is_null($found); $i++)
|
||||
{
|
||||
$file = $packagePaths[$i] . CallerLib::LIBS_PATH . DIRECTORY_SEPARATOR .
|
||||
$resourcePath . $resourceName . CallerLib::LIB_FILE_EXTENSION;
|
||||
$file = $packagePaths[$i].CallerLib::LIBS_PATH.DIRECTORY_SEPARATOR.
|
||||
$resourcePath.$resourceName.CallerLib::LIB_FILE_EXTENSION;
|
||||
if (file_exists($file))
|
||||
{
|
||||
$found = $file;
|
||||
@@ -313,20 +313,20 @@ class CallerLib
|
||||
{
|
||||
$loaded = null;
|
||||
// Same phrase error as load->model() provided by CI
|
||||
$result = error($found . ' exists, but doesn\'t declare class ' . $resourceName);
|
||||
$result = error($found.' exists, but doesn\'t declare class '.$resourceName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$loaded = null;
|
||||
// Same phrase error as load->model() provided by CI
|
||||
$result = error('Unable to load the requested class: ' . $resourceName);
|
||||
$result = error('Unable to load the requested class: '.$resourceName);
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// Errors while loading the library
|
||||
$result = error('Errors while loading the library: ' . $e->getMessage());
|
||||
$result = error('Errors while loading the library: '.$e->getMessage());
|
||||
}
|
||||
|
||||
if (!is_null($loaded))
|
||||
@@ -339,7 +339,7 @@ class CallerLib
|
||||
|
||||
/**
|
||||
* Calls a method of a class with the given parameters and returns its result
|
||||
*
|
||||
*
|
||||
* @param string $resourceName identifies the class name
|
||||
* @param string $function identifies the method name
|
||||
* @param array $parameters contains the parameters to be passed to the method
|
||||
@@ -359,7 +359,7 @@ class CallerLib
|
||||
// If the function is static
|
||||
if ($reflectionMethod->isStatic() === true)
|
||||
{
|
||||
$classMethod = $resourceName . '::' . $function;
|
||||
$classMethod = $resourceName.'::'.$function;
|
||||
}
|
||||
// If the function is not static
|
||||
else
|
||||
@@ -370,7 +370,6 @@ class CallerLib
|
||||
// If the resource's function is callable
|
||||
if (is_callable($classMethod))
|
||||
{
|
||||
|
||||
// Call resource->function()
|
||||
// @ was applied to prevent really ugly and unmanageable errors
|
||||
$resultCall = @call_user_func_array($classMethod, $parameters);
|
||||
@@ -379,7 +378,7 @@ class CallerLib
|
||||
// it will be recognized like a running error. A little bit tricky ;)
|
||||
if ($resultCall === false)
|
||||
{
|
||||
$result = error('Error running ' . $resourceName . '->' . $function . '()');
|
||||
$result = error('Error running '.$resourceName.'->'.$function.'()');
|
||||
}
|
||||
// Returns the result of resource->function()
|
||||
else
|
||||
@@ -389,14 +388,13 @@ class CallerLib
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = error($resourceName . '->' . $function . '() is not callable!');
|
||||
$result = error($resourceName.'->'.$function.'() is not callable!');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = error(
|
||||
'Number of required parameters: ' . $reflectionMethod->getNumberOfRequiredParameters() .
|
||||
'. Given: ' . count($parameters)
|
||||
'Number of required parameters: '.$reflectionMethod->getNumberOfRequiredParameters().'. Given: '.count($parameters)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -407,4 +405,4 @@ class CallerLib
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,8 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DmsLib
|
||||
{
|
||||
//
|
||||
const FILE_CONTENT_PROPERTY = 'file_content';
|
||||
|
||||
/**
|
||||
@@ -27,7 +23,7 @@ class DmsLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* read
|
||||
*/
|
||||
public function read($dms_id, $version = null)
|
||||
{
|
||||
@@ -66,7 +62,7 @@ class DmsLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getAktenAcceptedDms
|
||||
*/
|
||||
public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null, $no_file = null)
|
||||
{
|
||||
@@ -92,13 +88,13 @@ class DmsLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* save
|
||||
*/
|
||||
public function save($dms)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if(isset($dms['new']) && $dms['new'] == true)
|
||||
if (isset($dms['new']) && $dms['new'] == true)
|
||||
{
|
||||
// Remove new parameter to avoid DB insert errors
|
||||
unset($dms['new']);
|
||||
@@ -107,7 +103,7 @@ class DmsLib
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$filename = $result->retval;
|
||||
if(isset($dms['dms_id']) && $dms['dms_id'] != '')
|
||||
if (isset($dms['dms_id']) && $dms['dms_id'] != '')
|
||||
{
|
||||
$result = $this->ci->DmsVersionModel->insert(
|
||||
$this->ci->DmsVersionModel->filterFields($dms, $dms['dms_id'], $filename)
|
||||
@@ -148,7 +144,7 @@ class DmsLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* delete
|
||||
*/
|
||||
public function delete($person_id, $dms_id)
|
||||
{
|
||||
@@ -218,11 +214,11 @@ class DmsLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* _saveFileOnInsert
|
||||
*/
|
||||
private function _saveFileOnInsert($dms)
|
||||
{
|
||||
$filename = uniqid() . '.' . pathinfo($dms['name'], PATHINFO_EXTENSION);
|
||||
$filename = uniqid().'.'.pathinfo($dms['name'], PATHINFO_EXTENSION);
|
||||
|
||||
$result = $this->ci->DmsFSModel->write($filename, $dms['file_content']);
|
||||
if (isSuccess($result))
|
||||
@@ -234,13 +230,13 @@ class DmsLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* _saveFileOnUpdate
|
||||
*/
|
||||
private function _saveFileOnUpdate($dms)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if(isset($dms['version']))
|
||||
if (isset($dms['version']))
|
||||
{
|
||||
$result = $this->read($dms['dms_id'], $dms['version']);
|
||||
|
||||
@@ -252,4 +248,4 @@ class DmsLib
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
*/
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once FHCPATH.'include/authentication.class.php';
|
||||
require_once FHCPATH.'include/AddonAuthentication.php';
|
||||
|
||||
/**
|
||||
* FHC-Auth Helpers
|
||||
@@ -25,7 +21,10 @@ require_once FHCPATH.'include/AddonAuthentication.php';
|
||||
* @link http://fhcomplete.org/user_guide/helpers/fhcauth_helper.html
|
||||
*/
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once FHCPATH.'include/authentication.class.php';
|
||||
require_once FHCPATH.'include/AddonAuthentication.php';
|
||||
|
||||
class FHC_Auth extends authentication
|
||||
{
|
||||
@@ -39,10 +38,6 @@ class FHC_Auth extends authentication
|
||||
|
||||
/**
|
||||
* Auth Username, Password over FH-Complete
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @return bool
|
||||
*/
|
||||
public function basicAuthentication($username, $password)
|
||||
{
|
||||
@@ -57,9 +52,9 @@ class FHC_Auth extends authentication
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* TO BE UPDATED
|
||||
*
|
||||
*
|
||||
* Get the md5 hashed password by the addon username
|
||||
*
|
||||
* @param string $username addon username
|
||||
@@ -71,4 +66,4 @@ class FHC_Auth extends authentication
|
||||
|
||||
return md5($aam->getPasswordByUsername($username));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
/***
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
@@ -10,19 +10,13 @@
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FilesystemLib
|
||||
{
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function __construct() {}
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* checkParameters
|
||||
*/
|
||||
private function checkParameters($filepath, $filename)
|
||||
{
|
||||
@@ -37,8 +31,8 @@ class FilesystemLib
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* read
|
||||
*/
|
||||
public function read($filepath, $filename)
|
||||
{
|
||||
@@ -46,7 +40,7 @@ class FilesystemLib
|
||||
|
||||
if ($this->checkParameters($filepath, $filename))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
if (file_exists($resource) && $fileHandle = fopen($resource, 'r'))
|
||||
{
|
||||
$result = '';
|
||||
@@ -61,8 +55,8 @@ class FilesystemLib
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* write
|
||||
*/
|
||||
public function write($filepath, $filename, $content)
|
||||
{
|
||||
@@ -70,7 +64,7 @@ class FilesystemLib
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && isset($content))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
if (is_writable($filepath) && $fileHandle = fopen($resource, 'w'))
|
||||
{
|
||||
if (fwrite($fileHandle, $content) !== false)
|
||||
@@ -84,8 +78,8 @@ class FilesystemLib
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* append
|
||||
*/
|
||||
public function append($filepath, $filename, $content)
|
||||
{
|
||||
@@ -93,7 +87,7 @@ class FilesystemLib
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && isset($content))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
if (is_writable($resource) && $fileHandle = fopen($resource, 'a'))
|
||||
{
|
||||
if (fwrite($fileHandle, $content) !== false)
|
||||
@@ -107,8 +101,8 @@ class FilesystemLib
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* remove
|
||||
*/
|
||||
public function remove($filepath, $filename)
|
||||
{
|
||||
@@ -118,7 +112,7 @@ class FilesystemLib
|
||||
{
|
||||
if (is_writable($filepath))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
$result = unlink($resource);
|
||||
}
|
||||
}
|
||||
@@ -126,8 +120,8 @@ class FilesystemLib
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* rename
|
||||
*/
|
||||
public function rename($filepath, $filename, $newFilepath, $newFilename)
|
||||
{
|
||||
@@ -135,14 +129,14 @@ class FilesystemLib
|
||||
|
||||
if ($this->checkParameters($filepath, $filename) && $this->checkParameters($newFilepath, $newFilename))
|
||||
{
|
||||
$resource = $filepath . DIRECTORY_SEPARATOR . $filename;
|
||||
$resource = $filepath.DIRECTORY_SEPARATOR.$filename;
|
||||
if (is_writable($filepath) && is_writable($newFilepath) && file_exists($resource))
|
||||
{
|
||||
$destination = $newFilepath . DIRECTORY_SEPARATOR . $newFilename;
|
||||
$destination = $newFilepath.DIRECTORY_SEPARATOR.$newFilename;
|
||||
$result = rename($resource, $destination);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,24 +17,25 @@ class LogLib
|
||||
const LINE_SEPARATOR = ':';
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
* format
|
||||
*/
|
||||
public function __construct() {}
|
||||
|
||||
private function format($class, $function, $line)
|
||||
{
|
||||
$formatted = LogLib::CALLER_PREFIX;
|
||||
|
||||
if (!is_null($class) && $class != '')
|
||||
{
|
||||
$formatted .= $class . LogLib::CLASS_POSTFIX;
|
||||
$formatted .= $class.LogLib::CLASS_POSTFIX;
|
||||
}
|
||||
|
||||
$formatted .= $function . LogLib::LINE_SEPARATOR . $line . LogLib::CALLER_POSTFIX . ' ';
|
||||
$formatted .= $function.LogLib::LINE_SEPARATOR.$line.LogLib::CALLER_POSTFIX.' ';
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
/**
|
||||
* getCaller
|
||||
*/
|
||||
private function getCaller()
|
||||
{
|
||||
$classIndex = 3;
|
||||
@@ -62,13 +63,16 @@ class LogLib
|
||||
return $this->format($class, $function, $line);
|
||||
}
|
||||
|
||||
/**
|
||||
* log
|
||||
*/
|
||||
private function log($level, $message)
|
||||
{
|
||||
log_message($level, $this->getCaller() . $message);
|
||||
log_message($level, $this->getCaller().$message);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* logDebug
|
||||
*/
|
||||
public function logDebug($message)
|
||||
{
|
||||
@@ -76,7 +80,7 @@ class LogLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* logInfo
|
||||
*/
|
||||
public function logInfo($message)
|
||||
{
|
||||
@@ -84,10 +88,10 @@ class LogLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* logError
|
||||
*/
|
||||
public function logError($message)
|
||||
{
|
||||
$this->log(LogLib::ERROR, $message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Library to manage the sending of the email
|
||||
@@ -27,33 +27,33 @@ class MailLib
|
||||
$this->ci =& get_instance();
|
||||
|
||||
// The second parameter is used to avoiding name collisions in the config array
|
||||
$this->ci->config->load("mail", true);
|
||||
$this->ci->config->load('mail', true);
|
||||
|
||||
// CI Email library
|
||||
$this->ci->load->library("email");
|
||||
$this->ci->load->library('email');
|
||||
|
||||
// Initializing email library with the loaded configurations
|
||||
$this->ci->email->initialize($this->ci->config->config["mail"]);
|
||||
$this->ci->email->initialize($this->ci->config->config['mail']);
|
||||
|
||||
// Set the configuration properties with the standard configuration values
|
||||
$this->email_number_to_sent = $this->getEmailCfgItem("email_number_to_sent");
|
||||
$this->email_number_per_time_range = $this->getEmailCfgItem("email_number_per_time_range");
|
||||
$this->email_time_range = $this->getEmailCfgItem("email_time_range");
|
||||
$this->email_from_system = $this->getEmailCfgItem("email_from_system");
|
||||
$this->alias_from_system = $this->getEmailCfgItem("alias_from_system");
|
||||
$this->email_number_to_sent = $this->getEmailCfgItem('email_number_to_sent');
|
||||
$this->email_number_per_time_range = $this->getEmailCfgItem('email_number_per_time_range');
|
||||
$this->email_time_range = $this->getEmailCfgItem('email_time_range');
|
||||
$this->email_from_system = $this->getEmailCfgItem('email_from_system');
|
||||
$this->alias_from_system = $this->getEmailCfgItem('alias_from_system');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a single email
|
||||
*/
|
||||
public function send($from, $to, $subject, $message, $alias = "", $cc = null, $bcc = null, $altMessage = '')
|
||||
public function send($from, $to, $subject, $message, $alias = '', $cc = null, $bcc = null, $altMessage = '')
|
||||
{
|
||||
// If from is not specified then use the standard one
|
||||
if (is_null($from) || $from == "")
|
||||
if (is_null($from) || $from == '')
|
||||
{
|
||||
$from = $this->email_from_system;
|
||||
// If alias is not specified then use the standard one
|
||||
if (is_null($alias) || $alias == "")
|
||||
if (is_null($alias) || $alias == '')
|
||||
{
|
||||
$alias = $this->alias_from_system;
|
||||
}
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Messaging Library for FH-Complete
|
||||
*/
|
||||
* Messaging Library for FH-Complete
|
||||
*/
|
||||
class MessageLib
|
||||
{
|
||||
const MSG_INDX_PREFIX = 'message_';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Get code igniter instance
|
||||
@@ -43,10 +46,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* getMessage() - returns the spicified received message for a specified person
|
||||
*
|
||||
* @param string $msg_id REQUIRED
|
||||
* @param string $person_id REQUIRED
|
||||
* @return object
|
||||
*/
|
||||
public function getMessage($msg_id, $person_id)
|
||||
{
|
||||
@@ -62,9 +61,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* getMessagesByUID() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*
|
||||
* @param string $uid REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getMessagesByUID($uid, $all = false)
|
||||
{
|
||||
@@ -78,9 +74,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* getMessagesByPerson() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*
|
||||
* @param bigint $person_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getMessagesByPerson($person_id, $all = false)
|
||||
{
|
||||
@@ -94,9 +87,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* getSentMessagesByPerson() - Get all sent messages from a person identified by person_id
|
||||
*
|
||||
* @param bigint $person_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getSentMessagesByPerson($person_id, $all = false)
|
||||
{
|
||||
@@ -110,9 +100,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* getMessageByToken
|
||||
*
|
||||
* @param token string
|
||||
* @return array
|
||||
*/
|
||||
public function getMessageByToken($token)
|
||||
{
|
||||
@@ -156,9 +143,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* getCountUnreadMessages
|
||||
*
|
||||
* @param bigint $person_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getCountUnreadMessages($person_id)
|
||||
{
|
||||
@@ -172,11 +156,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* updateMessageStatus() - will change status on message for particular user
|
||||
*
|
||||
* @param integer $msg_id REQUIRED
|
||||
* @param integer $user_id REQUIRED
|
||||
* @param integer $status_id REQUIRED - should come from config/message.php list of constants
|
||||
* @return array
|
||||
*/
|
||||
public function updateMessageStatus($message_id, $person_id, $status)
|
||||
{
|
||||
@@ -219,7 +198,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* sendMessage() - sends new internal message. This function will create a new thread
|
||||
*
|
||||
*/
|
||||
public function sendMessage($sender_id, $receiver_id, $subject, $body, $priority = PRIORITY_NORMAL, $relationmessage_id = null, $oe_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
@@ -270,7 +248,7 @@ class MessageLib
|
||||
$result = $this->_error('', MSG_ERR_SUBJECT_EMPTY);
|
||||
break;
|
||||
}
|
||||
else if (empty($body))
|
||||
elseif (empty($body))
|
||||
{
|
||||
$result = $this->_error('', MSG_ERR_BODY_EMPTY);
|
||||
break;
|
||||
@@ -295,13 +273,6 @@ class MessageLib
|
||||
|
||||
/**
|
||||
* sendMessageVorlage() - sends new internal message using a template
|
||||
*
|
||||
* @param integer $sender_id REQUIRED
|
||||
* @param mixed $recipients REQUIRED - a single integer or an array of integers, representing user_ids
|
||||
* @param string $subject
|
||||
* @param string $body
|
||||
* @param integer $priority
|
||||
* @return array
|
||||
*/
|
||||
public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
@@ -375,19 +346,19 @@ class MessageLib
|
||||
$result = $this->_error('', MSG_ERR_TEMPLATE_NOT_FOUND);
|
||||
break;
|
||||
}
|
||||
else if (is_array($result->retval) && count($result->retval) > 0)
|
||||
elseif (is_array($result->retval) && count($result->retval) > 0)
|
||||
{
|
||||
if (is_null($result->retval[0]->oe_kurzbz))
|
||||
{
|
||||
$result = $this->_error('', MSG_ERR_TEMPLATE_NOT_FOUND);
|
||||
break;
|
||||
}
|
||||
else if (empty($result->retval[0]->text))
|
||||
elseif (empty($result->retval[0]->text))
|
||||
{
|
||||
$result = $this->_error('', MSG_ERR_INVALID_TEMPLATE);
|
||||
break;
|
||||
}
|
||||
else if (empty($result->retval[0]->subject))
|
||||
elseif (empty($result->retval[0]->subject))
|
||||
{
|
||||
$result = $this->_error('', MSG_ERR_INVALID_TEMPLATE);
|
||||
break;
|
||||
@@ -451,9 +422,10 @@ class MessageLib
|
||||
for ($i = 0; $i < count($result->retval) && $sent; $i++)
|
||||
{
|
||||
// If the person has an email account
|
||||
if (!is_null($result->retval[$i]->receiver) && $result->retval[$i]->receiver != '')
|
||||
if ((!is_null($result->retval[$i]->receiver) && $result->retval[$i]->receiver != '')
|
||||
|| (!is_null($result->retval[$i]->employeecontact) && $result->retval[$i]->employeecontact != ''))
|
||||
{
|
||||
$href = $this->ci->config->item('message_server') . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token;
|
||||
$href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[0]->token;
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
@@ -490,10 +462,17 @@ class MessageLib
|
||||
{
|
||||
$sender = $result->retval[0]->sender;
|
||||
}
|
||||
|
||||
$receiverContanct = $result->retval[$i]->receiver;
|
||||
if (!is_null($result->retval[$i]->employeecontact) && $result->retval[$i]->employeecontact != '')
|
||||
{
|
||||
$receiverContanct = $result->retval[$i]->employeecontact.'@'.DOMAIN;
|
||||
}
|
||||
|
||||
// Sending email
|
||||
$sent = $this->ci->maillib->send(
|
||||
$sender,
|
||||
$result->retval[$i]->receiver,
|
||||
$receiverContanct,
|
||||
$result->retval[$i]->subject,
|
||||
$body,
|
||||
null,
|
||||
@@ -533,10 +512,10 @@ class MessageLib
|
||||
$this->ci->loglib->logError('This person does not have an email account');
|
||||
// Writing errors in tbl_message_recipient
|
||||
$sme = $this->setMessageError(
|
||||
$result->retval[$i]->message_id,
|
||||
$result->retval[$i]->receiver_id,
|
||||
'This person does not have an email account',
|
||||
$result->retval[$i]->sentinfo
|
||||
$result->retval[$i]->message_id,
|
||||
$result->retval[$i]->receiver_id,
|
||||
'This person does not have an email account',
|
||||
$result->retval[$i]->sentinfo
|
||||
);
|
||||
if (!$sme)
|
||||
{
|
||||
@@ -570,11 +549,12 @@ class MessageLib
|
||||
|
||||
// Get a specific message from DB having EMAIL_KONTAKT_TYPE as relative contact type
|
||||
$result = $this->ci->RecipientModel->getMessages(
|
||||
EMAIL_KONTAKT_TYPE,
|
||||
null,
|
||||
null,
|
||||
$message_id
|
||||
EMAIL_KONTAKT_TYPE,
|
||||
null,
|
||||
null,
|
||||
$message_id
|
||||
);
|
||||
|
||||
// Checks if errors were occurred
|
||||
if (isSuccess($result))
|
||||
{
|
||||
@@ -582,13 +562,14 @@ class MessageLib
|
||||
if (is_array($result->retval) && count($result->retval) > 0)
|
||||
{
|
||||
// If the person has an email account
|
||||
if (!is_null($result->retval[0]->receiver) && $result->retval[0]->receiver != '')
|
||||
if ((!is_null($result->retval[0]->receiver) && $result->retval[0]->receiver != '')
|
||||
|| (!is_null($result->retval[0]->employeecontact) && $result->retval[0]->employeecontact != ''))
|
||||
{
|
||||
// If it is required use a multi-part message in MIME format
|
||||
if ($multiPartMime === true)
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$href = $this->ci->config->item('message_server') . $this->ci->config->item('message_html_view_url') . $result->retval[0]->token;
|
||||
$href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[0]->token;
|
||||
$bodyMsg = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
@@ -631,10 +612,16 @@ class MessageLib
|
||||
$sender = $result->retval[0]->sender;
|
||||
}
|
||||
|
||||
$receiverContanct = $result->retval[0]->receiver;
|
||||
if (!is_null($result->retval[0]->employeecontact) && $result->retval[0]->employeecontact != '')
|
||||
{
|
||||
$receiverContanct = $result->retval[0]->employeecontact.'@'.DOMAIN;
|
||||
}
|
||||
|
||||
// Sending email
|
||||
$sent = $this->ci->maillib->send(
|
||||
$sender,
|
||||
$result->retval[0]->receiver,
|
||||
$receiverContanct,
|
||||
is_null($subject) ? $result->retval[0]->subject : $subject, // if parameter subject is not null, use it!
|
||||
$bodyMsg,
|
||||
null,
|
||||
@@ -648,10 +635,10 @@ class MessageLib
|
||||
$this->ci->loglib->logError('Error while sending an email');
|
||||
// Writing errors in tbl_message_status
|
||||
$sme = $this->setMessageError(
|
||||
$result->retval[0]->message_id,
|
||||
$result->retval[0]->receiver_id,
|
||||
'Error while sending an email',
|
||||
$result->retval[0]->sentinfo
|
||||
$result->retval[0]->message_id,
|
||||
$result->retval[0]->receiver_id,
|
||||
'Error while sending an email',
|
||||
$result->retval[0]->sentinfo
|
||||
);
|
||||
if (!$sme)
|
||||
{
|
||||
@@ -674,10 +661,10 @@ class MessageLib
|
||||
$this->ci->loglib->logError('This person does not have an email account');
|
||||
// Writing errors in tbl_message_status
|
||||
$sme = $this->setMessageError(
|
||||
$result->retval[0]->message_id,
|
||||
$result->retval[0]->receiver_id,
|
||||
'This person does not have an email account',
|
||||
$result->retval[0]->sentinfo
|
||||
$result->retval[0]->message_id,
|
||||
$result->retval[0]->receiver_id,
|
||||
'This person does not have an email account',
|
||||
$result->retval[0]->sentinfo
|
||||
);
|
||||
if (!$sme)
|
||||
{
|
||||
@@ -702,8 +689,7 @@ class MessageLib
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Private Functions from here out!
|
||||
// ------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Update the table tbl_message_recipient
|
||||
@@ -740,7 +726,7 @@ class MessageLib
|
||||
{
|
||||
if (!is_null($prevSentInfo) && $prevSentInfo != '')
|
||||
{
|
||||
$sentInfo = $prevSentInfo . SENT_INFO_NEWLINE . $sentInfo;
|
||||
$sentInfo = $prevSentInfo.SENT_INFO_NEWLINE.$sentInfo;
|
||||
}
|
||||
|
||||
$parameters = array('sent' => null, 'sentinfo' => $sentInfo);
|
||||
@@ -759,8 +745,8 @@ class MessageLib
|
||||
$this->ci->BenutzerfunktionModel->addJoin('public.tbl_benutzer', 'uid');
|
||||
// Get all the valid receivers id using the oe_kurzbz
|
||||
$receivers = $this->ci->BenutzerfunktionModel->loadWhere(
|
||||
'oe_kurzbz = \'' . $oe_kurzbz . '\''.
|
||||
' AND funktion_kurzbz = \'' . $this->ci->config->item('assistent_function') . '\'' .
|
||||
'oe_kurzbz = \''.$oe_kurzbz.'\''.
|
||||
' AND funktion_kurzbz = \''.$this->ci->config->item('assistent_function').'\''.
|
||||
' AND (NOW() BETWEEN COALESCE(datum_von, NOW()) AND COALESCE(datum_bis, NOW()))'
|
||||
);
|
||||
|
||||
|
||||
@@ -76,11 +76,11 @@ class MigrationLib extends CI_Migration
|
||||
{
|
||||
if ($this->cli === true)
|
||||
{
|
||||
$colored = "\033[" . $color . "m%s\033[37m";
|
||||
$colored = "\033[".$color."m%s\033[37m";
|
||||
}
|
||||
else
|
||||
{
|
||||
$colored = "<font color=\"" . $this->HTML_COLORS[$color] . "\">%s</font>";
|
||||
$colored = "<font color=\"".$this->HTML_COLORS[$color]."\">%s</font>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
private function _print($prefix, $text, $color = null)
|
||||
{
|
||||
printf($this->getColored($color), sprintf("%s %s" . $this->getEOL(), $prefix, $text));
|
||||
printf($this->getColored($color), sprintf("%s %s".$this->getEOL(), $prefix, $text));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,8 +139,8 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
protected function startUP()
|
||||
{
|
||||
$this->printInfo(sprintf("%s Start method up of class %s %s",
|
||||
MigrationLib::SEPARATOR, get_called_class(), MigrationLib::SEPARATOR)
|
||||
$this->printInfo(
|
||||
sprintf("%s Start method up of class %s %s", MigrationLib::SEPARATOR, get_called_class(), MigrationLib::SEPARATOR)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -149,8 +149,8 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
protected function endUP()
|
||||
{
|
||||
$this->printInfo(sprintf("%s End method up of class %s %s",
|
||||
MigrationLib::SEPARATOR, get_called_class(), MigrationLib::SEPARATOR)
|
||||
$this->printInfo(
|
||||
sprintf("%s End method up of class %s %s", MigrationLib::SEPARATOR, get_called_class(), MigrationLib::SEPARATOR)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -159,8 +159,8 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
protected function startDown()
|
||||
{
|
||||
$this->printInfo(sprintf("%s Start method down of class %s %s",
|
||||
MigrationLib::SEPARATOR, get_called_class(), MigrationLib::SEPARATOR)
|
||||
$this->printInfo(
|
||||
sprintf("%s Start method down of class %s %s", MigrationLib::SEPARATOR, get_called_class(), MigrationLib::SEPARATOR)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -169,8 +169,8 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
protected function endDown()
|
||||
{
|
||||
$this->printInfo(sprintf("%s End method down of class %s %s",
|
||||
MigrationLib::SEPARATOR, get_called_class(), MigrationLib::SEPARATOR)
|
||||
$this->printInfo(
|
||||
sprintf("%s End method down of class %s %s", MigrationLib::SEPARATOR, get_called_class(), MigrationLib::SEPARATOR)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -179,11 +179,11 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
protected function addColumn($schema, $table, $fields)
|
||||
{
|
||||
foreach($fields as $name => $definition)
|
||||
foreach ($fields as $name => $definition)
|
||||
{
|
||||
if (!$this->columnExists($name, $schema, $table))
|
||||
{
|
||||
if ($this->dbforge->add_column($schema . '.' . $table, array($name => $definition)))
|
||||
if ($this->dbforge->add_column($schema.'.'.$table, array($name => $definition)))
|
||||
{
|
||||
$this->printMessage(sprintf("Column %s.%s.%s of type %s added", $schema, $table, $name, $definition["type"]));
|
||||
}
|
||||
@@ -204,11 +204,11 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
protected function modifyColumn($schema, $table, $fields)
|
||||
{
|
||||
foreach($fields as $name => $definition)
|
||||
foreach ($fields as $name => $definition)
|
||||
{
|
||||
if ($this->columnExists($name, $schema, $table))
|
||||
{
|
||||
if ($this->dbforge->modify_column($schema . '.' . $table, array($name => $definition)))
|
||||
if ($this->dbforge->modify_column($schema.'.'.$table, array($name => $definition)))
|
||||
{
|
||||
$this->printMessage(sprintf("Column %s.%s.%s has been modified", $schema, $table, $name));
|
||||
}
|
||||
@@ -231,7 +231,7 @@ class MigrationLib extends CI_Migration
|
||||
{
|
||||
if ($this->columnExists($field, $schema, $table))
|
||||
{
|
||||
if ($this->dbforge->drop_column($schema . '.' . $table, $field))
|
||||
if ($this->dbforge->drop_column($schema.'.'.$table, $field))
|
||||
{
|
||||
$this->printMessage(sprintf("Column %s.%s.%s has been dropped", $schema, $table, $field));
|
||||
}
|
||||
@@ -289,8 +289,17 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
protected function addForeingKey($schema, $table, $name, $field, $schemaDest, $tableDest, $fieldDest, $attributes)
|
||||
{
|
||||
$query = sprintf("ALTER TABLE %s.%s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s.%s (%s) %s",
|
||||
$schema, $table, $name, $field, $schemaDest, $tableDest, $fieldDest, $attributes);
|
||||
$query = sprintf(
|
||||
"ALTER TABLE %s.%s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s.%s (%s) %s",
|
||||
$schema,
|
||||
$table,
|
||||
$name,
|
||||
$field,
|
||||
$schemaDest,
|
||||
$tableDest,
|
||||
$fieldDest,
|
||||
$attributes
|
||||
);
|
||||
|
||||
if (@$this->db->simple_query($query))
|
||||
{
|
||||
@@ -371,22 +380,26 @@ class MigrationLib extends CI_Migration
|
||||
if (@$this->db->simple_query($query))
|
||||
{
|
||||
$this->printMessage(
|
||||
sprintf("Granted permissions %s on table %s.%s to user %s",
|
||||
is_null($stringPermission) ? $permissions : $stringPermission,
|
||||
$schema,
|
||||
$table,
|
||||
$user
|
||||
));
|
||||
sprintf(
|
||||
"Granted permissions %s on table %s.%s to user %s",
|
||||
is_null($stringPermission) ? $permissions : $stringPermission,
|
||||
$schema,
|
||||
$table,
|
||||
$user
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->printError(
|
||||
sprintf("Granting permissions %s on table %s.%s to user %s",
|
||||
is_null($stringPermission) ? $permissions : $stringPermission,
|
||||
$schema,
|
||||
$table,
|
||||
$user
|
||||
));
|
||||
sprintf(
|
||||
"Granting permissions %s on table %s.%s to user %s",
|
||||
is_null($stringPermission) ? $permissions : $stringPermission,
|
||||
$schema,
|
||||
$table,
|
||||
$user
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,7 +410,7 @@ class MigrationLib extends CI_Migration
|
||||
{
|
||||
$this->dbforge->add_field($fields);
|
||||
|
||||
if ($this->dbforge->create_table($schema . '.' . $table, true))
|
||||
if ($this->dbforge->create_table($schema.'.'.$table, true))
|
||||
{
|
||||
$this->printMessage(sprintf("Table %s.%s created or existing", $schema, $table));
|
||||
}
|
||||
@@ -412,7 +425,7 @@ class MigrationLib extends CI_Migration
|
||||
*/
|
||||
protected function dropTable($schema, $table)
|
||||
{
|
||||
if ($this->dbforge->drop_table($schema . "." . $table))
|
||||
if ($this->dbforge->drop_table($schema.".".$table))
|
||||
{
|
||||
$this->printMessage(sprintf("Table %s.%s has been dropped", $schema, $table));
|
||||
}
|
||||
@@ -503,22 +516,26 @@ class MigrationLib extends CI_Migration
|
||||
if (@$this->db->simple_query($query))
|
||||
{
|
||||
$this->printMessage(
|
||||
sprintf("Granted permissions %s on sequence %s.%s to user %s",
|
||||
is_null($stringPermission) ? $permissions : $stringPermission,
|
||||
$schema,
|
||||
$sequence,
|
||||
$user
|
||||
));
|
||||
sprintf(
|
||||
"Granted permissions %s on sequence %s.%s to user %s",
|
||||
is_null($stringPermission) ? $permissions : $stringPermission,
|
||||
$schema,
|
||||
$sequence,
|
||||
$user
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->printError(
|
||||
sprintf("Granting permissions %s on sequence %s.%s to user %s",
|
||||
is_null($stringPermission) ? $permissions : $stringPermission,
|
||||
$schema,
|
||||
$sequence,
|
||||
$user
|
||||
));
|
||||
sprintf(
|
||||
"Granting permissions %s on sequence %s.%s to user %s",
|
||||
is_null($stringPermission) ? $permissions : $stringPermission,
|
||||
$schema,
|
||||
$sequence,
|
||||
$user
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,9 +559,9 @@ class MigrationLib extends CI_Migration
|
||||
}
|
||||
|
||||
$this->printInfo(
|
||||
"Query correctly executed: " .
|
||||
substr(preg_replace("/\s+/", " ", trim($query)), 0, MigrationLib::PRINT_QUERY_LEN) .
|
||||
"Query correctly executed: ".
|
||||
substr(preg_replace("/\s+/", " ", trim($query)), 0, MigrationLib::PRINT_QUERY_LEN).
|
||||
(strlen($query) > MigrationLib::PRINT_QUERY_LEN ? "..." : "")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class OrganisationseinheitLib
|
||||
{
|
||||
/**
|
||||
* Loads model OrganisationseinheitModel
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
@@ -22,7 +25,7 @@ class OrganisationseinheitLib
|
||||
* to the top, starting from the given oe_kurzbz. It stops when it finds a
|
||||
* match with the other table, which attributes are passed as parameters:
|
||||
* schema name, table name, fields to be selected, where conditions, orderby clause
|
||||
*
|
||||
*
|
||||
* @param string $schema REQUIRED
|
||||
* @param string $table REQUIRED
|
||||
* @param mixed $fields REQUIRED
|
||||
@@ -63,6 +66,9 @@ class OrganisationseinheitLib
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* treeSearchEntire
|
||||
*/
|
||||
public function treeSearchEntire($table, $alias, $fields, $where, $orderby, $oe_kurzbz)
|
||||
{
|
||||
$select = "";
|
||||
@@ -90,12 +96,15 @@ class OrganisationseinheitLib
|
||||
{
|
||||
$tmpResult = $this->treeSearchEntire($table, $alias, $select, $where, $orderby, $result->retval[0]->_ppk);
|
||||
|
||||
if (hasData($tmpResult) && $tmpResult->retval[0]->_pk != null && $tmpResult->retval[0]->_ppk != null && $tmpResult->retval[0]->_jtpk != null)
|
||||
if (hasData($tmpResult)
|
||||
&& $tmpResult->retval[0]->_pk != null
|
||||
&& $tmpResult->retval[0]->_ppk != null
|
||||
&& $tmpResult->retval[0]->_jtpk != null)
|
||||
{
|
||||
$result->retval = array_merge($result->retval, $tmpResult->retval);
|
||||
}
|
||||
}
|
||||
else if ($result->retval[0]->_ppk != null)
|
||||
elseif ($result->retval[0]->_ppk != null)
|
||||
{
|
||||
$result = $this->treeSearchEntire($table, $alias, $select, $where, $orderby, $result->retval[0]->_ppk);
|
||||
}
|
||||
@@ -103,4 +112,4 @@ class OrganisationseinheitLib
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class PermissionLib
|
||||
* PermissionLib's constructor
|
||||
* Here is initialized the static property bb with all the rights of the user (API caller)
|
||||
*/
|
||||
function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
// Loads CI instance
|
||||
$this->ci =& get_instance();
|
||||
@@ -64,17 +64,16 @@ class PermissionLib
|
||||
*/
|
||||
public function isEntitled($sourceName, $permissionType)
|
||||
{
|
||||
$isEntitled = false;
|
||||
|
||||
// If the resource exists
|
||||
if (isset($this->acl[$sourceName]))
|
||||
{
|
||||
// Checks permission
|
||||
return $this->_isBerechtigt($this->acl[$sourceName], $permissionType);
|
||||
}
|
||||
// if the resource does not exist, do not lose useful clock cycles
|
||||
else
|
||||
{
|
||||
return false;
|
||||
$isEntitled = $this->_isBerechtigt($this->acl[$sourceName], $permissionType);
|
||||
}
|
||||
|
||||
return $isEntitled;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,26 +81,26 @@ class PermissionLib
|
||||
*/
|
||||
public function getBerechtigungKurzbz($sourceName)
|
||||
{
|
||||
$returnValue = null;
|
||||
|
||||
if (isset($this->acl[$sourceName]))
|
||||
{
|
||||
return $this->acl[$sourceName];
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
$returnValue = $this->acl[$sourceName];
|
||||
}
|
||||
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks user's (API caller) rights
|
||||
*/
|
||||
private function _isBerechtigt($berechtigung_kurzbz, $art = null, $oe_kurzbz = null, $kostenstelle_id = null)
|
||||
private function _isBerechtigt($berechtigung_kurzbz, $art = null, $oe_kurzbz = null, $kostenstelle_id = null)
|
||||
{
|
||||
$isBerechtigt = false;
|
||||
|
||||
if (!is_null($berechtigung_kurzbz))
|
||||
{
|
||||
if(self::$bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz, $art, $kostenstelle_id))
|
||||
if (self::$bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz, $art, $kostenstelle_id))
|
||||
{
|
||||
$isBerechtigt = true;
|
||||
}
|
||||
@@ -109,4 +108,4 @@ class PermissionLib
|
||||
|
||||
return $isBerechtigt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
/**
|
||||
* Name: Messaging Library for FH-Complete
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class PhrasesLib
|
||||
{
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* Loads parser library
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -28,17 +24,12 @@ class PhrasesLib
|
||||
$this->ci->load->helper('language');
|
||||
// Loads helper message to manage returning messages
|
||||
$this->ci->load->helper('message');
|
||||
|
||||
//$this->ci->lang->load('fhcomplete');
|
||||
}
|
||||
|
||||
/**
|
||||
* getPhrase() - will load a spezific Phrase
|
||||
*
|
||||
* @param integer $vorlage_kurzbz REQUIRED
|
||||
* @return struct
|
||||
*/
|
||||
function getPhrase($phrase_id)
|
||||
public function getPhrase($phrase_id)
|
||||
{
|
||||
if (empty($phrase_id))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
@@ -49,17 +40,17 @@ class PhrasesLib
|
||||
|
||||
/**
|
||||
* getSubMessages() - will return all Messages subordinated from a specified message.
|
||||
*
|
||||
* @param integer $msg_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getPhraseByApp($app = null)
|
||||
public function getPhraseByApp($app = null)
|
||||
{
|
||||
$phrases = $this->ci->PhraseModel->loadWhere(array('app' => $app));
|
||||
return $phrases;
|
||||
}
|
||||
|
||||
function getPhraseInhalt($phrase_id)
|
||||
/**
|
||||
* getPhraseInhalt
|
||||
*/
|
||||
public function getPhraseInhalt($phrase_id)
|
||||
{
|
||||
if (empty($phrase_id))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
@@ -68,7 +59,10 @@ class PhrasesLib
|
||||
return $phrasentext;
|
||||
}
|
||||
|
||||
function delPhrasentext($phrasentext_id)
|
||||
/**
|
||||
* delPhrasentext
|
||||
*/
|
||||
public function delPhrasentext($phrasentext_id)
|
||||
{
|
||||
if (empty($phrasentext_id))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
@@ -79,11 +73,8 @@ class PhrasesLib
|
||||
|
||||
/**
|
||||
* savePhrase() - will save a spezific Phrase.
|
||||
*
|
||||
* @param array $data REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function savePhrase($phrase_id, $data)
|
||||
public function savePhrase($phrase_id, $data)
|
||||
{
|
||||
if (empty($data))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
@@ -95,11 +86,8 @@ class PhrasesLib
|
||||
|
||||
/**
|
||||
* getVorlagetextByVorlage() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getPhrasentextById($phrasentext_id)
|
||||
public function getPhrasentextById($phrasentext_id)
|
||||
{
|
||||
if (empty($phrasentext_id))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
@@ -109,11 +97,9 @@ class PhrasesLib
|
||||
}
|
||||
|
||||
/**
|
||||
* getPhrases() -
|
||||
*
|
||||
* @return struct
|
||||
* getPhrases()
|
||||
*/
|
||||
function getPhrases($app, $sprache, $phrase = null, $orgeinheit_kurzbz = null, $orgform_kurzbz = null, $blockTags = null)
|
||||
public function getPhrases($app, $sprache, $phrase = null, $orgeinheit_kurzbz = null, $orgform_kurzbz = null, $blockTags = null)
|
||||
{
|
||||
if (isset($app) && isset($sprache))
|
||||
{
|
||||
@@ -163,11 +149,8 @@ class PhrasesLib
|
||||
|
||||
/**
|
||||
* insertPhraseinhalt() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function insertPhraseinhalt($data)
|
||||
public function insertPhraseinhalt($data)
|
||||
{
|
||||
$phrasentext = $this->ci->PhrasentextModel->insert($data);
|
||||
return $phrasentext;
|
||||
@@ -175,11 +158,8 @@ class PhrasesLib
|
||||
|
||||
/**
|
||||
* getVorlagetextById() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getVorlagetextById($vorlagestudiengang_id)
|
||||
public function getVorlagetextById($vorlagestudiengang_id)
|
||||
{
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->load($vorlagestudiengang_id);
|
||||
return $vorlagetext;
|
||||
@@ -187,11 +167,8 @@ class PhrasesLib
|
||||
|
||||
/**
|
||||
* saveVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function updatePhraseInhalt($phrasentext_id, $data)
|
||||
public function updatePhraseInhalt($phrasentext_id, $data)
|
||||
{
|
||||
$phrasentext = $this->ci->PhrasentextModel->update($phrasentext_id, $data);
|
||||
return $phrasentext;
|
||||
@@ -199,16 +176,12 @@ class PhrasesLib
|
||||
|
||||
/**
|
||||
* parseVorlagetext() - will parse a Vorlagetext.
|
||||
*
|
||||
* @param string $text REQUIRED
|
||||
* @param array $data REQUIRED
|
||||
* @return string
|
||||
*/
|
||||
function parseVorlagetext($text, $data = array())
|
||||
public function parseVorlagetext($text, $data = array())
|
||||
{
|
||||
if (empty($text))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
$text = $this->ci->parser->parse_string($text, $data, TRUE);
|
||||
$text = $this->ci->parser->parse_string($text, $data, true);
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ReihungstestLib
|
||||
{
|
||||
/**
|
||||
@@ -84,4 +81,4 @@ class ReihungstestLib
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+125
-132
@@ -12,7 +12,7 @@ class UDFLib
|
||||
const TABLE_ARG_NAME = 'table';
|
||||
const FIELD_ARG_NAME = 'field';
|
||||
const UDFS_ARG_NAME = 'udfs';
|
||||
|
||||
|
||||
// UDF json schema attributes
|
||||
const NAME = 'name'; // UDF name attribute
|
||||
const TYPE = 'type'; // UDF type attribute
|
||||
@@ -21,12 +21,12 @@ class UDFLib
|
||||
const LIST_VALUES = 'listValues'; // UDF listValues attribute
|
||||
const FE_REGEX_LANGUAGE = 'js'; // UDF javascript regex language attribute (front end)
|
||||
const BE_REGEX_LANGUAGE = 'php'; // UDF php regex language attribute (back end)
|
||||
|
||||
|
||||
// HTML components
|
||||
const LABEL = 'title';
|
||||
const TITLE = 'description';
|
||||
const PLACEHOLDER = 'placeholder';
|
||||
|
||||
|
||||
// Validation attributes
|
||||
const REGEX = 'regex';
|
||||
const REQUIRED = 'required';
|
||||
@@ -34,34 +34,34 @@ class UDFLib
|
||||
const MIN_VALUE = 'min-value';
|
||||
const MAX_LENGTH = 'max-length';
|
||||
const MIN_LENGTH = 'min-length';
|
||||
|
||||
|
||||
// UDF DB constants
|
||||
const COLUMN_TYPE = 'jsonb';
|
||||
const COLUMN_NAME = 'udf_values';
|
||||
const COLUMN_PREFIX = 'udf_';
|
||||
const COLUMN_JSON_DESCRIPTION = 'jsons';
|
||||
|
||||
|
||||
const CHKBOX_TYPE = 'checkbox'; // UDF checkbox type
|
||||
|
||||
|
||||
const PHRASES_APP_NAME = 'core'; // Name of the app parameter used to retrive phrases
|
||||
|
||||
|
||||
private $_ci; // Code igniter instance
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Loads fhc helper
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
|
||||
$this->_ci->load->helper('fhc');
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* UDFWidget
|
||||
*/
|
||||
public function UDFWidget($args, $htmlArgs = array())
|
||||
{
|
||||
@@ -69,16 +69,16 @@ class UDFLib
|
||||
{
|
||||
// Loads the widget library
|
||||
$this->_ci->load->library('WidgetLib');
|
||||
|
||||
|
||||
// Loads widgets to render HTML for UDF
|
||||
loadResource(APPPATH.'widgets/udf');
|
||||
|
||||
|
||||
// Default external block is true
|
||||
if (empty($args[UDFLib::FIELD_ARG_NAME]) && !isset($htmlArgs[HTMLWidget::EXTERNAL_BLOCK]))
|
||||
{
|
||||
$htmlArgs[HTMLWidget::EXTERNAL_BLOCK] = true;
|
||||
}
|
||||
|
||||
|
||||
return $this->_ci->widgetlib->widget(
|
||||
UDFLib::WIDGET_NAME,
|
||||
$args,
|
||||
@@ -97,9 +97,10 @@ class UDFLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* It renders the HTML of the UDF
|
||||
*
|
||||
* NOTE: When this method is called $widgetData contains different data from
|
||||
* parameter $args in the constructor
|
||||
*/
|
||||
@@ -107,12 +108,12 @@ class UDFLib
|
||||
{
|
||||
$schema = $widgetData[UDFLib::SCHEMA_ARG_NAME]; // schema attribute
|
||||
$table = $widgetData[UDFLib::TABLE_ARG_NAME]; // table attribute
|
||||
|
||||
|
||||
if (isset($widgetData[UDFLib::FIELD_ARG_NAME]))
|
||||
{
|
||||
$field = $widgetData[UDFLib::FIELD_ARG_NAME]; // UDF name
|
||||
}
|
||||
|
||||
|
||||
$udfResults = $this->_loadUDF($schema, $table); // loads UDF definition
|
||||
if (hasData($udfResults))
|
||||
{
|
||||
@@ -131,13 +132,13 @@ class UDFLib
|
||||
{
|
||||
$jsonSchemasArray = $jsonSchemas;
|
||||
}
|
||||
|
||||
|
||||
$found = false; // used to check if the field is found or not in the json schema
|
||||
|
||||
|
||||
$this->_sortJsonSchemas($jsonSchemasArray); // Sort the list of UDF by sort property
|
||||
|
||||
|
||||
// Loops through json schemas
|
||||
foreach($jsonSchemasArray as $jsonSchema)
|
||||
foreach ($jsonSchemasArray as $jsonSchema)
|
||||
{
|
||||
// If the type property is not present then show an error
|
||||
if (!isset($jsonSchema->{UDFLib::TYPE}))
|
||||
@@ -149,22 +150,22 @@ class UDFLib
|
||||
{
|
||||
show_error(sprintf('%s.%s: Attribute "name" not present in the json schema', $schema, $table));
|
||||
}
|
||||
|
||||
|
||||
// If a UDF is specified and is present in the json schemas list or no UDF is specified
|
||||
if ((isset($field) && $field == $jsonSchema->{UDFLib::NAME}) || !isset($field))
|
||||
{
|
||||
// Set attributes using phrases
|
||||
$this->_setAttributesWithPhrases($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]);
|
||||
|
||||
|
||||
// Set validation attributes
|
||||
$this->_setValidationAttributes($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]);
|
||||
|
||||
|
||||
// Set name and id attributes
|
||||
$this->_setNameAndId($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]);
|
||||
|
||||
|
||||
// Render the HTML for this UDF
|
||||
$this->_render($jsonSchema, $widgetData);
|
||||
|
||||
|
||||
// If a UDf is specified and it was found then stop looking through this list
|
||||
if (isset($field) && $field == $jsonSchema->{UDFLib::NAME})
|
||||
{
|
||||
@@ -173,7 +174,7 @@ class UDFLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If a UDf is specified and it was not found then show an error
|
||||
if (isset($field) && !$found)
|
||||
{
|
||||
@@ -191,7 +192,7 @@ class UDFLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Manage UDFs
|
||||
*/
|
||||
@@ -200,9 +201,9 @@ class UDFLib
|
||||
$validate = success(true); // returned value
|
||||
// Contains a list of validation errors for the UDFs that have not passed the validation
|
||||
$notValidUDFsArray = array();
|
||||
|
||||
|
||||
$this->_ci->load->model('system/UDF_model', 'UDFModel');
|
||||
|
||||
|
||||
// Retrieves UDFs definitions for this table
|
||||
$resultUDFsDefinitions = $this->_ci->UDFModel->getUDFsDefinitions($schemaAndTable);
|
||||
if (hasData($resultUDFsDefinitions)) // standard check if everything is ok and data are present
|
||||
@@ -210,27 +211,27 @@ class UDFLib
|
||||
// Get udf values from $data & clean udf values from $data
|
||||
// NOTE: Must be performed here because the load method populates the property UDFs too
|
||||
$this->_popUDFParameters($data);
|
||||
|
||||
|
||||
$requiredUDFsArray = array(); // contains a list of required UDFs
|
||||
// Contains the UDFs values to be stored
|
||||
// NOTE: the UDFs supplied that are not present in the UDF definition of this table, will be discarded
|
||||
$toBeStoredUDFsArray = array();
|
||||
|
||||
|
||||
// Decodes json that define the UDFs for this table
|
||||
$decodedUDFDefinitions = json_decode(
|
||||
$resultUDFsDefinitions->retval[0]->{UDFLib::COLUMN_JSON_DESCRIPTION}
|
||||
);
|
||||
|
||||
|
||||
// Loops through the UDFs definitions
|
||||
for ($i = 0; $i < count($decodedUDFDefinitions); $i++)
|
||||
{
|
||||
$decodedUDFDefinition = $decodedUDFDefinitions[$i]; // Definition of a single UDF
|
||||
|
||||
|
||||
// Loops through the UDFs values that should be stored
|
||||
foreach ($this->UDFs as $key => $val)
|
||||
{
|
||||
$tmpValidate = success(true); // temporary variable used to store the returned value from _validateUDFs
|
||||
|
||||
|
||||
// If this is the definition of this UDF
|
||||
if ($decodedUDFDefinition->{UDFLib::NAME} == $key)
|
||||
{
|
||||
@@ -258,7 +259,7 @@ class UDFLib
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If the previous required check has failed then the validation is not performed
|
||||
if ($chkRequiredPassed === true)
|
||||
{
|
||||
@@ -266,7 +267,7 @@ class UDFLib
|
||||
// If $toBeValidated == true => validation is performed
|
||||
// If $toBeValidated == false => validation is NOT performed
|
||||
$toBeValidated = false;
|
||||
// If this UDF is NOT a checkbox
|
||||
// If this UDF is NOT a checkbox
|
||||
if ($decodedUDFDefinition->{UDFLib::TYPE} != UDFLib::CHKBOX_TYPE)
|
||||
{
|
||||
// If required property is NOT present in the UDF description
|
||||
@@ -288,18 +289,18 @@ class UDFLib
|
||||
$toBeValidated = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($toBeValidated === true) // Checks if validation should be performed
|
||||
{
|
||||
$tmpValidate = $this->_validateUDFs(
|
||||
$decodedUDFDefinition->{UDFLib::VALIDATION}, //
|
||||
$decodedUDFDefinition->{UDFLib::NAME}, //
|
||||
$val //
|
||||
$decodedUDFDefinition->{UDFLib::VALIDATION},
|
||||
$decodedUDFDefinition->{UDFLib::NAME},
|
||||
$val
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If validation is ok copy the value that is to be stored into $toBeStoredUDFsArray
|
||||
if (isSuccess($tmpValidate))
|
||||
{
|
||||
@@ -312,14 +313,14 @@ class UDFLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Copies the remaining required UDFs into $notValidUDFsArray
|
||||
// because they were not supplied, therefore must be notified as error
|
||||
foreach($requiredUDFsArray as $key => $val)
|
||||
foreach ($requiredUDFsArray as $key => $val)
|
||||
{
|
||||
$notValidUDFsArray[] = array($val);
|
||||
}
|
||||
|
||||
|
||||
// If the validation of all the supplied UDFs is ok
|
||||
if (count($notValidUDFsArray) == 0)
|
||||
{
|
||||
@@ -327,7 +328,7 @@ class UDFLib
|
||||
// of the UDF that are not updated
|
||||
if (is_array($udfValues) && count($udfValues) > 0)
|
||||
{
|
||||
foreach($udfValues as $fieldName => $fieldValue)
|
||||
foreach ($udfValues as $fieldName => $fieldValue)
|
||||
{
|
||||
// If this field is not present in the given parameters
|
||||
// then copy it from the DB without changes
|
||||
@@ -349,35 +350,35 @@ class UDFLib
|
||||
$validate = error($notValidUDFsArray, EXIT_VALIDATION_UDF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $validate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* isUDFColumn
|
||||
*/
|
||||
public function isUDFColumn($columnName, $columnType)
|
||||
{
|
||||
$isUDFColumn = false;
|
||||
|
||||
|
||||
if (substr($columnName, 0, strlen(UDFLib::COLUMN_PREFIX)) == UDFLib::COLUMN_PREFIX
|
||||
&& $columnType == UDFLib::COLUMN_TYPE)
|
||||
{
|
||||
$isUDFColumn = true;
|
||||
}
|
||||
|
||||
|
||||
return $isUDFColumn;
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
/**
|
||||
* Move UDFs from $data to $UDFs
|
||||
*/
|
||||
private function _popUDFParameters(&$data)
|
||||
{
|
||||
foreach($data as $key => $val)
|
||||
foreach ($data as $key => $val)
|
||||
{
|
||||
if (substr($key, 0, 4) == UDFLib::COLUMN_PREFIX)
|
||||
{
|
||||
@@ -386,23 +387,23 @@ class UDFLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validates UDF value
|
||||
*/
|
||||
private function _validateUDFs($decodedUDFValidation, $udfName, $udfValue)
|
||||
{
|
||||
$returnArrayValidation = array(); // returned value
|
||||
|
||||
|
||||
// If $udfValue is not an array, then store it inside a new array
|
||||
$tmpUdfValues = $udfValue;
|
||||
if (!is_array($udfValue))
|
||||
{
|
||||
$tmpUdfValues = array($udfValue);
|
||||
}
|
||||
|
||||
|
||||
// Loops through all the supplied UDFs values
|
||||
foreach($tmpUdfValues as $udfValIndx => $udfVal)
|
||||
foreach ($tmpUdfValues as $udfValIndx => $udfVal)
|
||||
{
|
||||
// If the single UDF value is not an array or an object
|
||||
if (!is_array($udfVal) && !is_object($udfVal))
|
||||
@@ -418,7 +419,7 @@ class UDFLib
|
||||
// validation is failed and the error is stored in $returnArrayValidation
|
||||
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_MIN_VALUE);
|
||||
}
|
||||
|
||||
|
||||
// If max value attribute is present in the validation for this UDF,
|
||||
// then checks if the value of this UDF is compliant to this attribute
|
||||
if (isset($decodedUDFValidation->{UDFLib::MAX_VALUE})
|
||||
@@ -428,7 +429,7 @@ class UDFLib
|
||||
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_MAX_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$strUdfVal = strval($udfVal); // store in $strUdfVal the string conversion of $udfVal
|
||||
// If min length attribute is present in the validation for this UDF,
|
||||
// then checks if the value of this UDF is compliant to this attribute
|
||||
@@ -438,7 +439,7 @@ class UDFLib
|
||||
// validation is failed and the error is stored in $returnArrayValidation
|
||||
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_MIN_LENGTH);
|
||||
}
|
||||
|
||||
|
||||
// If max length attribute is present in the validation for this UDF,
|
||||
// then checks if the value of this UDF is compliant to this attribute
|
||||
if (isset($decodedUDFValidation->{UDFLib::MAX_LENGTH}) && isset($strUdfVal)
|
||||
@@ -447,7 +448,7 @@ class UDFLib
|
||||
// validation is failed and the error is stored in $returnArrayValidation
|
||||
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_MAX_LENGTH);
|
||||
}
|
||||
|
||||
|
||||
// If $udfVal is a string
|
||||
if (is_string($udfVal))
|
||||
{
|
||||
@@ -456,7 +457,7 @@ class UDFLib
|
||||
if (isset($decodedUDFValidation->{UDFLib::REGEX})
|
||||
&& is_array($decodedUDFValidation->{UDFLib::REGEX}))
|
||||
{
|
||||
foreach($decodedUDFValidation->{UDFLib::REGEX} as $regexIndx => $regex)
|
||||
foreach ($decodedUDFValidation->{UDFLib::REGEX} as $regexIndx => $regex)
|
||||
{
|
||||
if ($regex->language == UDFLib::BE_REGEX_LANGUAGE)
|
||||
{
|
||||
@@ -475,16 +476,16 @@ class UDFLib
|
||||
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_NOT_VALID_VAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If no UDF validation errors were raised, it's a success!!
|
||||
if (count($returnArrayValidation) == 0)
|
||||
{
|
||||
$returnArrayValidation = success(true);
|
||||
}
|
||||
|
||||
|
||||
return $returnArrayValidation;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the name and id attribute of the HTML element
|
||||
*/
|
||||
@@ -493,15 +494,13 @@ class UDFLib
|
||||
$htmlParameters[HTMLWidget::HTML_ID] = $jsonSchema->{UDFLib::NAME};
|
||||
$htmlParameters[HTMLWidget::HTML_NAME] = $jsonSchema->{UDFLib::NAME};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort the list of UDF by sort property
|
||||
*/
|
||||
private function _sortJsonSchemas(&$jsonSchemasArray)
|
||||
{
|
||||
//
|
||||
usort($jsonSchemasArray, function ($a, $b) {
|
||||
//
|
||||
if (!isset($a->{UDFLib::SORT}))
|
||||
{
|
||||
$a->{UDFLib::SORT} = 9999;
|
||||
@@ -510,16 +509,15 @@ class UDFLib
|
||||
{
|
||||
$b->{UDFLib::SORT} = 9999;
|
||||
}
|
||||
|
||||
if ($a->{UDFLib::SORT} == $b->{UDFLib::SORT})
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return ($a->{UDFLib::SORT} < $b->{UDFLib::SORT}) ? -1 : 1;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads the UDF description by the given schema and table
|
||||
*/
|
||||
@@ -527,21 +525,21 @@ class UDFLib
|
||||
{
|
||||
// Loads UDF model
|
||||
$this->_ci->load->model('system/UDF_model', 'UDFModel');
|
||||
|
||||
|
||||
$udfResults = $this->_ci->UDFModel->loadWhere(
|
||||
array(
|
||||
'schema' => $schema,
|
||||
'table' => $table
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
if (isError($udfResults))
|
||||
{
|
||||
if (is_object($udfResults) && isset($udfResults->retval))
|
||||
{
|
||||
show_error($udfResults->retval);
|
||||
}
|
||||
else if (is_string($udfResults))
|
||||
elseif (is_string($udfResults))
|
||||
{
|
||||
show_error($udfResults);
|
||||
}
|
||||
@@ -550,14 +548,14 @@ class UDFLib
|
||||
show_error('UDFWidget: generic error occurred');
|
||||
}
|
||||
}
|
||||
else if (!hasData($udfResults))
|
||||
elseif (!hasData($udfResults))
|
||||
{
|
||||
show_error(sprintf('%s.%s does not contain UDF', $schema, $table));
|
||||
}
|
||||
|
||||
|
||||
return $udfResults;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render the HTML for the UDF
|
||||
*/
|
||||
@@ -569,32 +567,32 @@ class UDFLib
|
||||
$this->_renderCheckbox($jsonSchema, $widgetData);
|
||||
}
|
||||
// Textfield
|
||||
else if ($jsonSchema->{UDFLib::TYPE} == 'textfield')
|
||||
elseif ($jsonSchema->{UDFLib::TYPE} == 'textfield')
|
||||
{
|
||||
$this->_renderTextfield($jsonSchema, $widgetData);
|
||||
}
|
||||
// Textarea
|
||||
else if ($jsonSchema->{UDFLib::TYPE} == 'textarea')
|
||||
elseif ($jsonSchema->{UDFLib::TYPE} == 'textarea')
|
||||
{
|
||||
$this->_renderTextarea($jsonSchema, $widgetData);
|
||||
}
|
||||
// Date
|
||||
else if ($jsonSchema->{UDFLib::TYPE} == 'date')
|
||||
elseif ($jsonSchema->{UDFLib::TYPE} == 'date')
|
||||
{
|
||||
|
||||
// To be done
|
||||
}
|
||||
// Dropdown
|
||||
else if ($jsonSchema->{UDFLib::TYPE} == 'dropdown')
|
||||
elseif ($jsonSchema->{UDFLib::TYPE} == 'dropdown')
|
||||
{
|
||||
$this->_renderDropdown($jsonSchema, $widgetData);
|
||||
}
|
||||
// Multiple dropdown
|
||||
else if ($jsonSchema->{UDFLib::TYPE} == 'multipledropdown')
|
||||
elseif ($jsonSchema->{UDFLib::TYPE} == 'multipledropdown')
|
||||
{
|
||||
$this->_renderDropdown($jsonSchema, $widgetData, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders a dropdown element
|
||||
*/
|
||||
@@ -610,34 +608,34 @@ class UDFLib
|
||||
{
|
||||
$widgetData[DropdownWidget::SELECTED_ELEMENT] = null;
|
||||
}
|
||||
|
||||
|
||||
$dropdownWidgetUDF = new DropdownWidgetUDF(UDFLib::WIDGET_NAME, $widgetData);
|
||||
$parameters = array();
|
||||
|
||||
|
||||
// If the list of values to show is an array
|
||||
if (isset($jsonSchema->{UDFLib::LIST_VALUES}->enum))
|
||||
{
|
||||
$parameters = $jsonSchema->{UDFLib::LIST_VALUES}->enum;
|
||||
}
|
||||
// If the list of values to show should be retrived with a SQL statement
|
||||
else if (isset($jsonSchema->{UDFLib::LIST_VALUES}->sql))
|
||||
elseif (isset($jsonSchema->{UDFLib::LIST_VALUES}->sql))
|
||||
{
|
||||
// UDFModel is loaded in method _loadUDF that is called before the current method
|
||||
$queryResult = $this->_ci->UDFModel->execQuery($jsonSchema->{UDFLib::LIST_VALUES}->sql);
|
||||
if (hasData($queryResult))
|
||||
{
|
||||
{
|
||||
$parameters = $queryResult->retval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($multiple) // multiple dropdown
|
||||
{
|
||||
$dropdownWidgetUDF->setMultiple();
|
||||
}
|
||||
|
||||
|
||||
$dropdownWidgetUDF->render($parameters);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders a textarea element
|
||||
*/
|
||||
@@ -645,17 +643,17 @@ class UDFLib
|
||||
{
|
||||
$text = null; // text value
|
||||
$textareaUDF = new TextareaWidgetUDF(UDFLib::WIDGET_NAME, $widgetData);
|
||||
|
||||
|
||||
// Set text value if present in the DB
|
||||
if (isset($widgetData[UDFLib::UDFS_ARG_NAME])
|
||||
&& isset($widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}]))
|
||||
{
|
||||
$text = $widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}];
|
||||
}
|
||||
|
||||
|
||||
$textareaUDF->render($text);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders an input text element
|
||||
*/
|
||||
@@ -663,17 +661,17 @@ class UDFLib
|
||||
{
|
||||
$text = null; // text value
|
||||
$textareaUDF = new TextfieldWidgetUDF(UDFLib::WIDGET_NAME, $widgetData);
|
||||
|
||||
|
||||
// Set text value if present in the DB
|
||||
if (isset($widgetData[UDFLib::UDFS_ARG_NAME])
|
||||
&& isset($widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}]))
|
||||
{
|
||||
$text = $widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}];
|
||||
}
|
||||
|
||||
|
||||
$textareaUDF->render($text);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders a checkbox element
|
||||
*/
|
||||
@@ -689,17 +687,22 @@ class UDFLib
|
||||
{
|
||||
$widgetData[CheckboxWidget::VALUE_FIELD] = CheckboxWidget::HTML_DEFAULT_VALUE;
|
||||
}
|
||||
|
||||
|
||||
$checkboxWidgetUDF = new CheckboxWidgetUDF(UDFLib::WIDGET_NAME, $widgetData);
|
||||
|
||||
|
||||
$checkboxWidgetUDF->render();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the attributes of the HTML element using the phrases system
|
||||
*/
|
||||
private function _setAttributesWithPhrases($jsonSchema, &$htmlParameters)
|
||||
{
|
||||
// By default set to null all the attributes
|
||||
$htmlParameters[HTMLWidget::LABEL] = null;
|
||||
$htmlParameters[HTMLWidget::TITLE] = null;
|
||||
$htmlParameters[HTMLWidget::PLACEHOLDER] = null;
|
||||
|
||||
// Description, title and placeholder
|
||||
if (isset($jsonSchema->{UDFLib::LABEL})
|
||||
|| isset($jsonSchema->{UDFLib::TITLE})
|
||||
@@ -707,14 +710,14 @@ class UDFLib
|
||||
{
|
||||
// Loads PhrasesLib
|
||||
$this->_ci->load->library('PhrasesLib');
|
||||
|
||||
|
||||
// If is set the label property in the json schema
|
||||
if (isset($jsonSchema->{UDFLib::LABEL}))
|
||||
{
|
||||
// Load the related phrase
|
||||
$tmpResult = $this->_ci->phraseslib->getPhrases(
|
||||
UDFLib::PHRASES_APP_NAME,
|
||||
DEFAULT_LEHREINHEIT_SPRACHE,
|
||||
DEFAULT_LANGUAGE,
|
||||
$jsonSchema->{UDFLib::LABEL},
|
||||
null,
|
||||
null,
|
||||
@@ -724,19 +727,15 @@ class UDFLib
|
||||
{
|
||||
$htmlParameters[HTMLWidget::LABEL] = $tmpResult->retval[0]->text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmlParameters[HTMLWidget::LABEL] = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If is set the title property in the json schema
|
||||
if (isset($jsonSchema->{UDFLib::TITLE}))
|
||||
{
|
||||
// Load the related phrase
|
||||
$tmpResult = $this->_ci->phraseslib->getPhrases(
|
||||
UDFLib::PHRASES_APP_NAME,
|
||||
DEFAULT_LEHREINHEIT_SPRACHE,
|
||||
DEFAULT_LANGUAGE,
|
||||
$jsonSchema->{UDFLib::TITLE},
|
||||
null,
|
||||
null,
|
||||
@@ -746,19 +745,15 @@ class UDFLib
|
||||
{
|
||||
$htmlParameters[HTMLWidget::TITLE] = $tmpResult->retval[0]->text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmlParameters[HTMLWidget::TITLE] = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If is set the placeholder property in the json schema
|
||||
if (isset($jsonSchema->{UDFLib::PLACEHOLDER}))
|
||||
{
|
||||
// Load the related phrase
|
||||
$tmpResult = $this->_ci->phraseslib->getPhrases(
|
||||
UDFLib::PHRASES_APP_NAME,
|
||||
DEFAULT_LEHREINHEIT_SPRACHE,
|
||||
DEFAULT_LANGUAGE,
|
||||
$jsonSchema->{UDFLib::PLACEHOLDER},
|
||||
null,
|
||||
null,
|
||||
@@ -768,14 +763,10 @@ class UDFLib
|
||||
{
|
||||
$htmlParameters[HTMLWidget::PLACEHOLDER] = $tmpResult->retval[0]->text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmlParameters[HTMLWidget::PLACEHOLDER] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the validation attributes of the HTML element using the configuration inside the json schema
|
||||
*/
|
||||
@@ -786,17 +777,19 @@ class UDFLib
|
||||
$htmlParameters[HTMLWidget::REQUIRED] = null;
|
||||
$htmlParameters[HTMLWidget::MIN_VALUE] = null;
|
||||
$htmlParameters[HTMLWidget::MAX_VALUE] = null;
|
||||
|
||||
$htmlParameters[HTMLWidget::MIN_LENGTH] = null;
|
||||
$htmlParameters[HTMLWidget::MAX_LENGTH] = null;
|
||||
|
||||
// If validation property is present in the json schema
|
||||
if (isset($jsonSchema->{UDFLib::VALIDATION}))
|
||||
{
|
||||
$jsonSchemaValidation =& $jsonSchema->{UDFLib::VALIDATION}; // Reference for a better code readability
|
||||
|
||||
// Front end regex
|
||||
|
||||
// Front-end regex
|
||||
if (isset($jsonSchemaValidation->{UDFLib::REGEX})
|
||||
&& is_array($jsonSchemaValidation->{UDFLib::REGEX}))
|
||||
{
|
||||
foreach($jsonSchemaValidation->{UDFLib::REGEX} as $regex)
|
||||
foreach ($jsonSchemaValidation->{UDFLib::REGEX} as $regex)
|
||||
{
|
||||
if ($regex->language === UDFLib::FE_REGEX_LANGUAGE)
|
||||
{
|
||||
@@ -804,31 +797,31 @@ class UDFLib
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Required
|
||||
if (isset($jsonSchemaValidation->{UDFLib::REQUIRED}))
|
||||
{
|
||||
$htmlParameters[HTMLWidget::REQUIRED] = $jsonSchemaValidation->{UDFLib::REQUIRED};
|
||||
}
|
||||
|
||||
|
||||
// Min value
|
||||
if (isset($jsonSchemaValidation->{UDFLib::MIN_VALUE}))
|
||||
{
|
||||
$htmlParameters[HTMLWidget::MIN_VALUE] = $jsonSchemaValidation->{UDFLib::MIN_VALUE};
|
||||
}
|
||||
|
||||
|
||||
// Max value
|
||||
if (isset($jsonSchemaValidation->{UDFLib::MAX_VALUE}))
|
||||
{
|
||||
$htmlParameters[HTMLWidget::MAX_VALUE] = $jsonSchemaValidation->{UDFLib::MAX_VALUE};
|
||||
}
|
||||
|
||||
|
||||
// Min length
|
||||
if (isset($jsonSchemaValidation->{UDFLib::MIN_LENGTH}))
|
||||
{
|
||||
$htmlParameters[HTMLWidget::MIN_LENGTH] = $jsonSchemaValidation->{UDFLib::MIN_LENGTH};
|
||||
}
|
||||
|
||||
|
||||
// Max length
|
||||
if (isset($jsonSchemaValidation->{UDFLib::MAX_LENGTH}))
|
||||
{
|
||||
@@ -836,4 +829,4 @@ class UDFLib
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
/**
|
||||
* Name: Messaging Library for FH-Complete
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class VorlageLib
|
||||
{
|
||||
private $recipients = array();
|
||||
|
||||
/**
|
||||
* Loads parser library and OrganisationseinheitLib library
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
require_once APPPATH.'config/message.php';
|
||||
@@ -32,10 +30,10 @@ class VorlageLib
|
||||
/**
|
||||
* getVorlage() - will load a spezific Template
|
||||
*
|
||||
* @param integer $vorlage_kurzbz REQUIRED
|
||||
* @param int $vorlage_kurzbz REQUIRED
|
||||
* @return struct
|
||||
*/
|
||||
function getVorlage($vorlage_kurzbz)
|
||||
public function getVorlage($vorlage_kurzbz)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
@@ -47,23 +45,22 @@ class VorlageLib
|
||||
/**
|
||||
* getSubMessages() - will return all Messages subordinated from a specified message.
|
||||
*
|
||||
* @param integer $msg_id REQUIRED
|
||||
* @param int $msg_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getVorlageByMimetype($mimetype = null)
|
||||
public function getVorlageByMimetype($mimetype = null)
|
||||
{
|
||||
$vorlage = $this->ci->VorlageModel->loadWhere(array('mimetype' => $mimetype));
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* saveVorlage() - will save a spezific Template.
|
||||
*
|
||||
* @param array $data REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function saveVorlage($vorlage_kurzbz, $data)
|
||||
public function saveVorlage($vorlage_kurzbz, $data)
|
||||
{
|
||||
if (empty($data))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
@@ -72,19 +69,18 @@ class VorlageLib
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getVorlagetextByVorlage() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getVorlagetextByVorlage($vorlage_kurzbz)
|
||||
public function getVorlagetextByVorlage($vorlage_kurzbz)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
|
||||
$vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array('vorlage_kurzbz' =>$vorlage_kurzbz));
|
||||
$vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz));
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
@@ -97,7 +93,7 @@ class VorlageLib
|
||||
* @param string $sprache OPTIONAL
|
||||
* @return array
|
||||
*/
|
||||
function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null)
|
||||
public function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
@@ -126,40 +122,35 @@ class VorlageLib
|
||||
$where = $this->_where($vorlage_kurzbz, $orgform_kurzbz, $sprache);
|
||||
|
||||
$vorlage = $this->ci->organisationseinheitlib->treeSearch(
|
||||
'public',
|
||||
'tbl_vorlagestudiengang',
|
||||
array("vorlage_kurzbz", "studiengang_kz", "version", "text", "oe_kurzbz",
|
||||
"vorlagestudiengang_id", "style", "berechtigung", "anmerkung_vorlagestudiengang",
|
||||
"aktiv", "sprache", "subject", "orgform_kurzbz"),
|
||||
$where,
|
||||
"version DESC",
|
||||
$oe_kurzbz
|
||||
'public',
|
||||
'tbl_vorlagestudiengang',
|
||||
array("vorlage_kurzbz", "studiengang_kz", "version", "text", "oe_kurzbz",
|
||||
"vorlagestudiengang_id", "style", "berechtigung", "anmerkung_vorlagestudiengang",
|
||||
"aktiv", "sprache", "subject", "orgform_kurzbz"),
|
||||
$where,
|
||||
"version DESC",
|
||||
$oe_kurzbz
|
||||
);
|
||||
}
|
||||
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _where
|
||||
*/
|
||||
private function _where($vorlage_kurzbz, $orgform_kurzbz, $sprache)
|
||||
{
|
||||
// Builds where clause
|
||||
$where = "vorlage_kurzbz = ".$this->ci->VorlageModel->escape($vorlage_kurzbz);
|
||||
// if (is_null($orgform_kurzbz))
|
||||
// {
|
||||
// $where .= " AND orgform_kurzbz IS NULL";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $where .= " AND orgform_kurzbz = " . $this->ci->VorlageModel->escape($orgform_kurzbz);
|
||||
// }
|
||||
|
||||
|
||||
if (is_null($sprache))
|
||||
{
|
||||
$where .= " AND sprache IS NULL";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where .= " AND sprache = " . $this->ci->VorlageModel->escape($sprache);
|
||||
$where .= " AND sprache = ".$this->ci->VorlageModel->escape($sprache);
|
||||
}
|
||||
|
||||
$where .= " AND aktiv = true";
|
||||
@@ -173,7 +164,7 @@ class VorlageLib
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function insertVorlagetext($data)
|
||||
public function insertVorlagetext($data)
|
||||
{
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->insert($data);
|
||||
return $vorlagetext;
|
||||
@@ -185,7 +176,7 @@ class VorlageLib
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function getVorlagetextById($vorlagestudiengang_id)
|
||||
public function getVorlagetextById($vorlagestudiengang_id)
|
||||
{
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->load($vorlagestudiengang_id);
|
||||
return $vorlagetext;
|
||||
@@ -197,7 +188,7 @@ class VorlageLib
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
function updateVorlagetext($vorlagestudiengang_id, $data)
|
||||
public function updateVorlagetext($vorlagestudiengang_id, $data)
|
||||
{
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->update($vorlagestudiengang_id, $data);
|
||||
return $vorlagetext;
|
||||
@@ -210,11 +201,11 @@ class VorlageLib
|
||||
* @param array $data REQUIRED
|
||||
* @return string
|
||||
*/
|
||||
function parseVorlagetext($text, $data = array())
|
||||
public function parseVorlagetext($text, $data = array())
|
||||
{
|
||||
if (empty($text))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
$text = $this->ci->parser->parse_string($text, $data, TRUE);
|
||||
$text = $this->ci->parser->parse_string($text, $data, true);
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,13 @@ class Orgform_model extends DB_Model
|
||||
$this->pk = 'orgform_kurzbz';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the orgform except VBB and ZGS
|
||||
*/
|
||||
public function getOrgformLV()
|
||||
{
|
||||
// Checks rights
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$query = "SELECT *
|
||||
FROM bis.tbl_orgform
|
||||
@@ -25,4 +27,4 @@ class Orgform_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,19 +13,12 @@ class Akte_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getAkten
|
||||
*/
|
||||
public function getAkten($person_id, $dokument_kurzbz = null, $stg_kz = null, $prestudent_id = null)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_dokument', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_dokumentstudiengang', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$query = 'SELECT akte_id,
|
||||
person_id,
|
||||
@@ -79,17 +72,12 @@ class Akte_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getAktenAccepted
|
||||
*/
|
||||
public function getAktenAccepted($person_id, $dokument_kurzbz = null)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$query = 'SELECT a.akte_id,
|
||||
a.person_id,
|
||||
@@ -130,21 +118,13 @@ class Akte_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getAktenAcceptedDms
|
||||
*/
|
||||
public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('campus.tbl_dms', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('campus.tbl_dms_version', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
if (isError($ent = $this->isEntitled('campus.tbl_dms', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$query = 'SELECT a.akte_id,
|
||||
a.person_id,
|
||||
@@ -193,4 +173,4 @@ class Akte_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,13 @@ class Dokumentprestudent_model extends DB_Model
|
||||
$this->pk = array('prestudent_id', 'dokument_kurzbz');
|
||||
}
|
||||
|
||||
/**
|
||||
* setAccepted
|
||||
*/
|
||||
public function setAccepted($prestudent_id, $studiengang_kz)
|
||||
{
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$result = null;
|
||||
|
||||
@@ -41,10 +44,13 @@ class Dokumentprestudent_model extends DB_Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* setAcceptedDocuments
|
||||
*/
|
||||
public function setAcceptedDocuments($prestudent_id, $dokument_kurzbz)
|
||||
{
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_dokumentprestudent', PermissionLib::INSERT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$result = null;
|
||||
|
||||
@@ -68,4 +74,4 @@ class Dokumentprestudent_model extends DB_Model
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,13 @@ class Dokumentstudiengang_model extends DB_Model
|
||||
$this->pk = array('studiengang_kz', 'dokument_kurzbz');
|
||||
}
|
||||
|
||||
/**
|
||||
* getDokumentstudiengangByStudiengang_kz
|
||||
*/
|
||||
public function getDokumentstudiengangByStudiengang_kz($studiengang_kz, $onlinebewerbung = null, $pflicht = null, $nachreichbar = null)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_dokument', 's', FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_dokument', 's', FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$this->addJoin('public.tbl_dokument', 'dokument_kurzbz');
|
||||
|
||||
@@ -39,4 +41,4 @@ class Dokumentstudiengang_model extends DB_Model
|
||||
|
||||
return $this->loadWhere($parameterArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,17 +13,15 @@ class Prestudent_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* getLastStatuses
|
||||
*/
|
||||
public function getLastStatuses($person_id, $studiensemester_kurzbz = null, $studiengang_kz = null, $status_kurzbz = null)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$query = 'SELECT *
|
||||
FROM public.tbl_prestudent p
|
||||
@@ -60,7 +58,7 @@ class Prestudent_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* updateAufnahmegruppe
|
||||
*/
|
||||
public function updateAufnahmegruppe($prestudentIdArray, $aufnahmegruppe)
|
||||
{
|
||||
@@ -85,8 +83,12 @@ class Prestudent_model extends DB_Model
|
||||
* - stufe and aufnahmegruppe
|
||||
* - reihungstest score
|
||||
*/
|
||||
public function getPrestudentMultiAssign($studiengang = null, $studiensemester = null, $gruppe = null, $reihungstest = null, $stufe = null)
|
||||
public function getPrestudentMultiAssign(
|
||||
$studiengang = null, $studiensemester = null, $gruppe = null, $reihungstest = null, $stufe = null
|
||||
)
|
||||
{
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$this->addSelect(
|
||||
'p.person_id,
|
||||
prestudent_id,
|
||||
|
||||
@@ -14,17 +14,15 @@ class Prestudentstatus_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* getLastStatus
|
||||
*/
|
||||
public function getLastStatus($prestudent_id, $studiensemester_kurzbz = '', $status_kurzbz = '')
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
if (isError($ent = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$query = 'SELECT tbl_prestudentstatus.*,
|
||||
bezeichnung AS studienplan_bezeichnung,
|
||||
@@ -53,10 +51,12 @@ class Prestudentstatus_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* updateStufe
|
||||
*/
|
||||
public function updateStufe($prestudentIdArray, $stufe)
|
||||
{
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
return $this->execQuery(
|
||||
'UPDATE public.tbl_prestudentstatus
|
||||
SET rt_stufe = ?
|
||||
@@ -82,8 +82,8 @@ class Prestudentstatus_model extends DB_Model
|
||||
public function getStatusByFilter($prestudent_id, $status_kurzbz = '', $ausbildungssemester = '', $studiensemester_kurzbz = '')
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$query = '
|
||||
SELECT
|
||||
|
||||
@@ -13,15 +13,14 @@ class Studiengang_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getAllForBewerbung
|
||||
*/
|
||||
public function getAllForBewerbung()
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('lehre.vw_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('bis.tbl_lgartcode', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
if (isError($ent = $this->isEntitled('bis.tbl_lgartcode', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
if (isError($ent = $this->isEntitled('lehre.vw_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$allForBewerbungQuery = 'SELECT DISTINCT studiengang_kz,
|
||||
typ,
|
||||
@@ -100,10 +99,12 @@ class Studiengang_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getStudienplan
|
||||
*/
|
||||
public function getStudienplan($studiensemester_kurzbz, $ausbildungssemester, $aktiv, $onlinebewerbung)
|
||||
{
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
// Join table public.tbl_studiengang with table lehre.tbl_studienordnung on column studiengang_kz
|
||||
$this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz');
|
||||
// Then join with table lehre.tbl_studienplan on column studienordnung_id
|
||||
@@ -135,10 +136,12 @@ class Studiengang_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getStudiengangBewerbung
|
||||
*/
|
||||
public function getStudiengangBewerbung()
|
||||
{
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
// Join table public.tbl_studiengang with table lehre.tbl_studienordnung on column studiengang_kz
|
||||
$this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz');
|
||||
// Join table lehre.tbl_studienordnung with table lehre.tbl_akadgrad on column akadgrad_id
|
||||
@@ -150,7 +153,8 @@ class Studiengang_model extends DB_Model
|
||||
// Then join with table lehre.tbl_bewerbungsfrist on column studiensemester_kurzbz
|
||||
$this->addJoin(
|
||||
'public.tbl_bewerbungstermine',
|
||||
'tbl_bewerbungstermine.studiensemester_kurzbz = ss.studiensemester_kurzbz AND tbl_bewerbungstermine.studienplan_id = ss.studienplan_id',
|
||||
'tbl_bewerbungstermine.studiensemester_kurzbz = ss.studiensemester_kurzbz
|
||||
AND tbl_bewerbungstermine.studienplan_id = ss.studienplan_id',
|
||||
'LEFT'
|
||||
);
|
||||
// Ordering by studiengang_kz and studienplan_id
|
||||
@@ -166,7 +170,9 @@ class Studiengang_model extends DB_Model
|
||||
'public.tbl_studiengang.aktiv = TRUE
|
||||
AND public.tbl_studiengang.onlinebewerbung = TRUE
|
||||
AND ((tbl_bewerbungstermine.beginn <= NOW() AND tbl_bewerbungstermine.ende >= NOW()) OR tbl_bewerbungstermine.beginn IS NULL)
|
||||
AND ss.studiensemester_kurzbz IN (SELECT DISTINCT studiensemester_kurzbz FROM public.tbl_bewerbungstermine WHERE beginn <= NOW() AND ende >= NOW())
|
||||
AND ss.studiensemester_kurzbz IN (
|
||||
SELECT DISTINCT studiensemester_kurzbz FROM public.tbl_bewerbungstermine WHERE beginn <= NOW() AND ende >= NOW()
|
||||
)
|
||||
AND ss.semester = 1
|
||||
AND lehre.tbl_studienplan.aktiv = TRUE'
|
||||
,
|
||||
@@ -180,10 +186,12 @@ class Studiengang_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getAppliedStudiengang
|
||||
*/
|
||||
public function getAppliedStudiengang($person_id, $studiensemester_kurzbz, $titel)
|
||||
{
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
// Then join with table public.tbl_prestudent
|
||||
$this->addJoin('public.tbl_prestudent', 'studiengang_kz');
|
||||
// Join table public.tbl_prestudentstatus
|
||||
@@ -227,10 +235,12 @@ class Studiengang_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getAppliedStudiengangFromNow
|
||||
*/
|
||||
public function getAppliedStudiengangFromNow($person_id, $titel)
|
||||
{
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
// Then join with table public.tbl_prestudent
|
||||
$this->addJoin('public.tbl_prestudent', 'studiengang_kz');
|
||||
// Join table public.tbl_prestudentstatus
|
||||
@@ -278,20 +288,20 @@ class Studiengang_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getAvailableReihungstestByPersonId
|
||||
*/
|
||||
public function getAvailableReihungstestByPersonId($person_id)
|
||||
{
|
||||
if (($isEntitled = $this->isEntitled('lehre.tbl_studienordnung', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_reihungstest', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('lehre.tbl_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_reihungstest', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('lehre.tbl_studienordnung', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$this->addJoin('lehre.tbl_studienordnung', 'studiengang_kz');
|
||||
|
||||
@@ -334,4 +344,4 @@ class Studiengang_model extends DB_Model
|
||||
array('reihungstest')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,13 @@ class Studiensemester_model extends DB_Model
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* getLastOrAktSemester
|
||||
*/
|
||||
public function getLastOrAktSemester($days = 60)
|
||||
{
|
||||
// Checks rights
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
if (!is_numeric($days))
|
||||
{
|
||||
@@ -33,11 +35,13 @@ class Studiensemester_model extends DB_Model
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* getNextFrom
|
||||
*/
|
||||
public function getNextFrom($studiensemester_kurzbz)
|
||||
{
|
||||
// Checks rights
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$query = 'SELECT studiensemester_kurzbz,
|
||||
start,
|
||||
@@ -55,13 +59,13 @@ class Studiensemester_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* getNearest
|
||||
*/
|
||||
public function getNearest($semester = '')
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.vw_studiensemester', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.vw_studiensemester', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$query = 'SELECT studiensemester_kurzbz,
|
||||
start,
|
||||
@@ -86,4 +90,4 @@ class Studiensemester_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,28 +12,31 @@ class Person_model extends DB_Model
|
||||
$this->pk = 'person_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* getPersonKontaktByZugangscode
|
||||
*/
|
||||
public function getPersonKontaktByZugangscode($zugangscode, $email)
|
||||
{
|
||||
$this->addJoin('public.tbl_kontakt', 'person_id');
|
||||
|
||||
|
||||
return $this->loadWhere(array('zugangscode' => $zugangscode, 'kontakt' => $email));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* checkBewerbung
|
||||
*/
|
||||
public function checkBewerbung($email, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_benutzer', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_benutzer', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$checkBewerbungQuery = '';
|
||||
$parametersArray = array($email, $email, $email);
|
||||
@@ -67,6 +70,9 @@ class Person_model extends DB_Model
|
||||
return $this->execQuery($checkBewerbungQuery, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* updatePerson
|
||||
*/
|
||||
public function updatePerson($person)
|
||||
{
|
||||
if (isset($person['svnr']) && $person['svnr'] != '')
|
||||
@@ -93,15 +99,15 @@ class Person_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* getPersonFromStatus
|
||||
*/
|
||||
public function getPersonFromStatus($status_kurzbz, $von, $bis)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudent', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_prestudentstatus', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$this->addJoin('public.tbl_prestudent', 'person_id');
|
||||
|
||||
@@ -129,5 +135,4 @@ class Person_model extends DB_Model
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ class Message_model extends DB_Model
|
||||
public function getMessagesByPerson($person_id, $all)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$sql = 'SELECT m.message_id,
|
||||
m.person_id,
|
||||
@@ -68,7 +68,7 @@ class Message_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getMessageVars
|
||||
*/
|
||||
public function getMessageVars()
|
||||
{
|
||||
@@ -85,7 +85,7 @@ class Message_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getMsgVarsDataByPrestudentId
|
||||
*/
|
||||
public function getMsgVarsDataByPrestudentId($prestudent_id)
|
||||
{
|
||||
@@ -93,4 +93,4 @@ class Message_model extends DB_Model
|
||||
|
||||
return $this->execQuery(sprintf($query, is_array($prestudent_id) ? 'IN' : '='), array($prestudent_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@ class Phrase_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* getPhrases
|
||||
*/
|
||||
public function getPhrases($app, $sprache, $phrase = null, $orgeinheit_kurzbz = null, $orgform_kurzbz = null)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('system.tbl_phrase', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('system.tbl_phrasentext', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('system.tbl_phrase', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('system.tbl_phrasentext', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$parametersArray = array('app' => $app, 'sprache' => $sprache);
|
||||
|
||||
@@ -60,4 +60,4 @@ class Phrase_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,22 +12,22 @@ class Recipient_model extends DB_Model
|
||||
$this->pk = array('person_id', 'message_id');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get data for a received message
|
||||
*/
|
||||
public function getMessage($message_id, $person_id)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
|
||||
if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$query = 'SELECT mr.message_id,
|
||||
mr.person_id,
|
||||
mm.subject,
|
||||
@@ -43,26 +43,26 @@ class Recipient_model extends DB_Model
|
||||
SELECT person_id, kontakt FROM public.tbl_kontakt WHERE kontakttyp = \'email\'
|
||||
) ks ON (ks.person_id = mr.person_id)
|
||||
WHERE mr.message_id = ? AND mr.person_id = ?';
|
||||
|
||||
|
||||
$parametersArray = array($message_id, $person_id);
|
||||
|
||||
|
||||
// Get data of the messages to sent
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a received message identified by token
|
||||
*/
|
||||
public function getMessageByToken($token)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$sql = 'SELECT r.message_id,
|
||||
m.person_id as sender_id,
|
||||
r.person_id as receiver_id,
|
||||
@@ -80,25 +80,25 @@ class Recipient_model extends DB_Model
|
||||
) s ON (r.message_id = s.message_id AND r.person_id = s.person_id)
|
||||
WHERE r.token = ?
|
||||
LIMIT 1';
|
||||
|
||||
|
||||
return $this->execQuery($sql, array(MSG_STATUS_DELETED, $token));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all received messages for a person identified by person_id
|
||||
*/
|
||||
public function getMessagesByPerson($person_id, $all)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_person', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$sql = 'SELECT DISTINCT ON (r.message_id) r.message_id,
|
||||
m.person_id,
|
||||
m.subject,
|
||||
@@ -126,9 +126,9 @@ class Recipient_model extends DB_Model
|
||||
) s ON (m.message_id = s.message_id AND r.person_id = s.person_id)
|
||||
WHERE r.person_id = ?
|
||||
ORDER BY r.message_id DESC, s.status DESC';
|
||||
|
||||
|
||||
$parametersArray = array($person_id);
|
||||
|
||||
|
||||
if ($all == 'true')
|
||||
{
|
||||
$sql = sprintf($sql, '');
|
||||
@@ -138,10 +138,10 @@ class Recipient_model extends DB_Model
|
||||
array_push($parametersArray, $person_id, $person_id);
|
||||
$sql = sprintf($sql, 'WHERE person_id = ? AND message_id NOT IN (SELECT message_id FROM public.tbl_msg_status WHERE status >= 3 AND person_id = ?)');
|
||||
}
|
||||
|
||||
|
||||
return $this->execQuery($sql, $parametersArray);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all received messages for a person identified by uid
|
||||
*/
|
||||
@@ -152,14 +152,14 @@ class Recipient_model extends DB_Model
|
||||
// if same user
|
||||
if ($uid === getAuthUID())
|
||||
{
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
}
|
||||
// if different user, for reading messages from other users
|
||||
else
|
||||
{
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
}
|
||||
|
||||
// get Data
|
||||
@@ -188,18 +188,18 @@ class Recipient_model extends DB_Model
|
||||
SELECT * FROM public.tbl_msg_status ORDER BY insertamum DESC LIMIT 1
|
||||
) s ON (r.message_id = s.message_id AND r.person_id = s.person_id)
|
||||
WHERE b.uid = ?';
|
||||
|
||||
|
||||
if (! $all)
|
||||
$sql .= ' AND (status < 3 OR status IS NULL)';
|
||||
|
||||
|
||||
return $this->execQuery($sql, array($uid));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getMessages
|
||||
*
|
||||
*
|
||||
* Gets all the messages to be sent
|
||||
*
|
||||
*
|
||||
* @param kontaktType specifies the type of the kontakt to get
|
||||
* @param sent specifies the status of the messages to get (NULL never sent, otherwise the shipping date)
|
||||
* @param limit specifies the number of messages to get
|
||||
@@ -208,16 +208,17 @@ class Recipient_model extends DB_Model
|
||||
public function getMessages($kontaktType, $sent, $limit = null, $message_id = null)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_message', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_kontakt', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$query = 'SELECT mm.message_id,
|
||||
ks.kontakt as sender,
|
||||
kr.kontakt as receiver,
|
||||
mu.mitarbeiter_uid as employeeContact,
|
||||
mr.person_id as receiver_id,
|
||||
mr.token,
|
||||
mm.subject,
|
||||
@@ -229,10 +230,16 @@ class Recipient_model extends DB_Model
|
||||
) ks ON (ks.person_id = mm.person_id)
|
||||
LEFT JOIN (
|
||||
SELECT person_id, kontakt FROM public.tbl_kontakt WHERE kontakttyp = ?
|
||||
) kr ON (kr.person_id = mr.person_id)';
|
||||
|
||||
) kr ON (kr.person_id = mr.person_id)
|
||||
LEFT JOIN (
|
||||
SELECT b.person_id,
|
||||
m.mitarbeiter_uid
|
||||
FROM public.tbl_benutzer b INNER JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid)
|
||||
WHERE b.aktiv = TRUE
|
||||
) mu ON (mu.person_id = mr.person_id)';
|
||||
|
||||
$parametersArray = array($kontaktType, $kontaktType);
|
||||
|
||||
|
||||
if (is_null($sent) || $sent == '')
|
||||
{
|
||||
$query .= ' WHERE mr.sent IS NULL';
|
||||
@@ -242,35 +249,35 @@ class Recipient_model extends DB_Model
|
||||
array_push($parametersArray, $sent);
|
||||
$query .= ' WHERE mr.sent = ?';
|
||||
}
|
||||
|
||||
|
||||
if (!is_null($message_id))
|
||||
{
|
||||
array_push($parametersArray, $message_id);
|
||||
$query .= ' AND mm.message_id = ?';
|
||||
}
|
||||
|
||||
|
||||
$query .= ' ORDER BY mr.insertamum ASC';
|
||||
|
||||
|
||||
if (!is_null($limit))
|
||||
{
|
||||
$query .= ' LIMIT ?';
|
||||
array_push($parametersArray, $limit);
|
||||
}
|
||||
|
||||
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all unread messages for a person identified by person_id
|
||||
*/
|
||||
public function getCountUnreadMessages($person_id)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (($isEntitled = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_recipient', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
if (isError($ent = $this->isEntitled('public.tbl_msg_status', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
||||
return $ent;
|
||||
|
||||
$sql = 'SELECT COUNT(r.message_id) AS unreadMessages
|
||||
FROM public.tbl_msg_recipient r JOIN public.tbl_msg_status s
|
||||
ON (r.message_id = s.message_id AND r.person_id = s.person_id)
|
||||
@@ -283,9 +290,9 @@ class Recipient_model extends DB_Model
|
||||
WHERE r.person_id = ?
|
||||
AND s.status > ?
|
||||
)';
|
||||
|
||||
|
||||
$parametersArray = array($person_id, MSG_STATUS_UNREAD, $person_id, MSG_STATUS_UNREAD);
|
||||
|
||||
|
||||
return $this->execQuery($sql, $parametersArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,14 +12,16 @@ class Vorlage_model extends DB_Model
|
||||
$this->pk = 'vorlage_kurzbz';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns mume types
|
||||
*/
|
||||
public function getMimeTypes()
|
||||
{
|
||||
// Checks rights
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$query = 'SELECT DISTINCT mimetype FROM public.tbl_vorlage ORDER BY mimetype';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,13 +13,12 @@ class Vorlagedokument_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* loadDokumenteFromVorlagestudiengang
|
||||
*/
|
||||
public function loadDokumenteFromVorlagestudiengang($vorlagestudiengang_id)
|
||||
{
|
||||
// Checks rights
|
||||
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $isEntitled;
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
$qry = 'SELECT vorlagedokument_id,
|
||||
sort,
|
||||
@@ -33,4 +32,4 @@ class Vorlagedokument_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry, array($vorlagestudiengang_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,323 +1,323 @@
|
||||
<?php $this->load->view("templates/header", array("title" => "Users manager", "jquery" => true, "tablesort" => true, "jquery_checkboxes" => true, "jquery_custom" => true)); ?>
|
||||
|
||||
<body>
|
||||
<form id="usersFiltersForm" action="" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Studiengang_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $studiengang),
|
||||
array('name' => 'studiengang', 'id' => 'studiengangFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Studiensemester_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $studiensemester),
|
||||
array('name' => 'studiensemester', 'id' => 'studiensemesterFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Reihungstest_widget',
|
||||
array(
|
||||
DropdownWidget::SELECTED_ELEMENT => $reihungstest,
|
||||
'studiengang' => $studiengang,
|
||||
'studiensemester' => $studiensemester
|
||||
),
|
||||
array('name' => 'reihungstest', 'id' => 'reihungstestFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Aufnahmegruppe_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $aufnahmegruppe),
|
||||
array('name' => 'aufnahmegruppe', 'id' => 'aufnahmegruppeFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Stufe_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $stufe),
|
||||
array('name' => 'stufe', 'id' => 'stufeFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<br>
|
||||
|
||||
<form id="linkUsersForm" action="" method="post">
|
||||
<?php
|
||||
if ($users != null)
|
||||
{
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<strong>Assign to:</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="3px" colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Stufe_widget',
|
||||
array('stufe' => $stufe),
|
||||
array('name' => 'stufe', 'id' => 'stufeAssign')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="button" id="linkToStufe" value="Assign this stufe">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Aufnahmegruppe_widget',
|
||||
array('aufnahmegruppe' => $aufnahmegruppe),
|
||||
array('name' => 'aufnahmegruppe', 'id' => 'aufnahmegruppeAssign')
|
||||
);
|
||||
?>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="button" id="linkToGruppe" value="Assign to this group">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<?php
|
||||
if ($users != null)
|
||||
{
|
||||
?>
|
||||
<table id="t0" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th class="clm_prestudent_id header">Prestudent ID</th>
|
||||
<th class="clm_person_id header">Person ID</th>
|
||||
<th class="header headerSortDown">Vorname</th>
|
||||
<th>Nachname</th>
|
||||
<th>Geschlecht</th>
|
||||
<th>Studiengang</th>
|
||||
<th>OrgForm</th>
|
||||
<th>Studienplan</th>
|
||||
<th>Geburtsdatum</th>
|
||||
<th>Email</th>
|
||||
<th>Stufe</th>
|
||||
<th>Gruppe</th>
|
||||
<th>Punkte</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i = 0; $i < count($users); $i++)
|
||||
{
|
||||
$user = $users[$i];
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="prestudent_id[]" value="<?php echo $user->prestudent_id ?>">
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->prestudent_id; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->person_id; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->vorname; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->nachname; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->geschlecht; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->kurzbzlang; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->orgform_kurzbz; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->studienplan; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->gebdatum; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->email; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->rt_stufe; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->aufnahmegruppe_kurzbz; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->punkte; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'No users found.';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
$hrefLinkToStufe = str_replace("/system/aufnahme/PrestudentMultiAssign", "/system/aufnahme/PrestudentMultiAssign/linkToStufe", $_SERVER["REQUEST_URI"]);
|
||||
$hrefLinkToAufnahmegruppe = str_replace("/system/aufnahme/PrestudentMultiAssign", "/system/aufnahme/PrestudentMultiAssign/linkToAufnahmegruppe", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
if ($("#linkToStufe"))
|
||||
{
|
||||
$("#linkToStufe").click(function() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "<?php echo $hrefLinkToStufe; ?>",
|
||||
data: $("#linkUsersForm").serialize(),
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
alert(data.msg);
|
||||
$("#usersFiltersForm").submit();
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#linkToGruppe"))
|
||||
{
|
||||
$("#linkToGruppe").click(function() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "<?php echo $hrefLinkToAufnahmegruppe; ?>",
|
||||
data: $("#linkUsersForm").serialize(),
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
alert(data.msg);
|
||||
$("#usersFiltersForm").submit();
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#studiengangFilter'))
|
||||
{
|
||||
$('#studiengangFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#studiensemesterFilter'))
|
||||
{
|
||||
$('#studiensemesterFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#aufnahmegruppeFilter'))
|
||||
{
|
||||
$('#aufnahmegruppeFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#stufeFilter'))
|
||||
{
|
||||
$('#stufeFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#reihungstestFilter'))
|
||||
{
|
||||
$('#reihungstestFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
$(".tablesorter").each(function(i, v) {
|
||||
$("#"+v.id).tablesorter(
|
||||
{
|
||||
widgets: ["zebra"],
|
||||
sortList: [[3,0],[4,0]],
|
||||
headers: {0: { sorter: false}}
|
||||
});
|
||||
|
||||
$("#toggle_"+v.id).on('click', function(e) {
|
||||
$("#"+v.id).checkboxes('toggle');
|
||||
e.preventDefault();
|
||||
if ($("input.chkbox:checked").size() > 0)
|
||||
$("#mailSendButton").html('Mail an markierte Personen senden');
|
||||
else
|
||||
$("#mailSendButton").html('Mail an alle senden');
|
||||
});
|
||||
|
||||
$("#uncheck_"+v.id).on('click', function(e) {
|
||||
$("#"+v.id).checkboxes('uncheck');
|
||||
e.preventDefault();
|
||||
if ($("input.chkbox:checked").size() > 0)
|
||||
$("#mailSendButton").html('Mail an markierte Personen senden');
|
||||
else
|
||||
$("#mailSendButton").html('Mail an alle senden');
|
||||
});
|
||||
|
||||
$("#"+v.id).checkboxes('range', true);
|
||||
});
|
||||
|
||||
$('.chkbox').change(function()
|
||||
{
|
||||
if ($("input.chkbox:checked").size() > 0)
|
||||
$("#mailSendButton").html('Mail an markierte Personen senden');
|
||||
else
|
||||
$("#mailSendButton").html('Mail an alle senden');
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
<?php $this->load->view("templates/footer"); ?>
|
||||
<?php $this->load->view("templates/header", array("title" => "Users manager", "jquery19" => true, "tablesort" => true, "jquery_checkboxes" => true, "jquery_custom" => true)); ?>
|
||||
|
||||
<body>
|
||||
<form id="usersFiltersForm" action="" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Studiengang_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $studiengang),
|
||||
array('name' => 'studiengang', 'id' => 'studiengangFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Studiensemester_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $studiensemester),
|
||||
array('name' => 'studiensemester', 'id' => 'studiensemesterFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Reihungstest_widget',
|
||||
array(
|
||||
DropdownWidget::SELECTED_ELEMENT => $reihungstest,
|
||||
'studiengang' => $studiengang,
|
||||
'studiensemester' => $studiensemester
|
||||
),
|
||||
array('name' => 'reihungstest', 'id' => 'reihungstestFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Aufnahmegruppe_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $aufnahmegruppe),
|
||||
array('name' => 'aufnahmegruppe', 'id' => 'aufnahmegruppeFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Stufe_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $stufe),
|
||||
array('name' => 'stufe', 'id' => 'stufeFilter')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<br>
|
||||
|
||||
<form id="linkUsersForm" action="" method="post">
|
||||
<?php
|
||||
if ($users != null)
|
||||
{
|
||||
?>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<strong>Assign to:</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="3px" colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Stufe_widget',
|
||||
array('stufe' => $stufe),
|
||||
array('name' => 'stufe', 'id' => 'stufeAssign')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="button" id="linkToStufe" value="Assign this stufe">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Aufnahmegruppe_widget',
|
||||
array('aufnahmegruppe' => $aufnahmegruppe),
|
||||
array('name' => 'aufnahmegruppe', 'id' => 'aufnahmegruppeAssign')
|
||||
);
|
||||
?>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="button" id="linkToGruppe" value="Assign to this group">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<?php
|
||||
if ($users != null)
|
||||
{
|
||||
?>
|
||||
<table id="t0" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th class="clm_prestudent_id header">Prestudent ID</th>
|
||||
<th class="clm_person_id header">Person ID</th>
|
||||
<th class="header headerSortDown">Vorname</th>
|
||||
<th>Nachname</th>
|
||||
<th>Geschlecht</th>
|
||||
<th>Studiengang</th>
|
||||
<th>OrgForm</th>
|
||||
<th>Studienplan</th>
|
||||
<th>Geburtsdatum</th>
|
||||
<th>Email</th>
|
||||
<th>Stufe</th>
|
||||
<th>Gruppe</th>
|
||||
<th>Punkte</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i = 0; $i < count($users); $i++)
|
||||
{
|
||||
$user = $users[$i];
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="prestudent_id[]" value="<?php echo $user->prestudent_id ?>">
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->prestudent_id; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->person_id; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->vorname; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->nachname; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->geschlecht; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->kurzbzlang; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->orgform_kurzbz; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->studienplan; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->gebdatum; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->email; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->rt_stufe; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->aufnahmegruppe_kurzbz; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $user->punkte; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'No users found.';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
$hrefLinkToStufe = str_replace("/system/aufnahme/PrestudentMultiAssign", "/system/aufnahme/PrestudentMultiAssign/linkToStufe", $_SERVER["REQUEST_URI"]);
|
||||
$hrefLinkToAufnahmegruppe = str_replace("/system/aufnahme/PrestudentMultiAssign", "/system/aufnahme/PrestudentMultiAssign/linkToAufnahmegruppe", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
if ($("#linkToStufe"))
|
||||
{
|
||||
$("#linkToStufe").click(function() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "<?php echo $hrefLinkToStufe; ?>",
|
||||
data: $("#linkUsersForm").serialize(),
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
alert(data.msg);
|
||||
$("#usersFiltersForm").submit();
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#linkToGruppe"))
|
||||
{
|
||||
$("#linkToGruppe").click(function() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "<?php echo $hrefLinkToAufnahmegruppe; ?>",
|
||||
data: $("#linkUsersForm").serialize(),
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
alert(data.msg);
|
||||
$("#usersFiltersForm").submit();
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#studiengangFilter'))
|
||||
{
|
||||
$('#studiengangFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#studiensemesterFilter'))
|
||||
{
|
||||
$('#studiensemesterFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#aufnahmegruppeFilter'))
|
||||
{
|
||||
$('#aufnahmegruppeFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#stufeFilter'))
|
||||
{
|
||||
$('#stufeFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#reihungstestFilter'))
|
||||
{
|
||||
$('#reihungstestFilter').change(function() {
|
||||
$('#usersFiltersForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
$(".tablesorter").each(function(i, v) {
|
||||
$("#"+v.id).tablesorter(
|
||||
{
|
||||
widgets: ["zebra"],
|
||||
sortList: [[3,0],[4,0]],
|
||||
headers: {0: { sorter: false}}
|
||||
});
|
||||
|
||||
$("#toggle_"+v.id).on('click', function(e) {
|
||||
$("#"+v.id).checkboxes('toggle');
|
||||
e.preventDefault();
|
||||
if ($("input.chkbox:checked").size() > 0)
|
||||
$("#mailSendButton").html('Mail an markierte Personen senden');
|
||||
else
|
||||
$("#mailSendButton").html('Mail an alle senden');
|
||||
});
|
||||
|
||||
$("#uncheck_"+v.id).on('click', function(e) {
|
||||
$("#"+v.id).checkboxes('uncheck');
|
||||
e.preventDefault();
|
||||
if ($("input.chkbox:checked").size() > 0)
|
||||
$("#mailSendButton").html('Mail an markierte Personen senden');
|
||||
else
|
||||
$("#mailSendButton").html('Mail an alle senden');
|
||||
});
|
||||
|
||||
$("#"+v.id).checkboxes('range', true);
|
||||
});
|
||||
|
||||
$('.chkbox').change(function()
|
||||
{
|
||||
if ($("input.chkbox:checked").size() > 0)
|
||||
$("#mailSendButton").html('Mail an markierte Personen senden');
|
||||
else
|
||||
$("#mailSendButton").html('Mail an alle senden');
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
<?php $this->load->view("templates/footer"); ?>
|
||||
|
||||
@@ -1,286 +1,286 @@
|
||||
<?php $this->load->view("templates/header", array("title" => "MessageReply", "jquery" => true, "tinymce" => true)); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
$href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
<form id="sendForm" method="post" action="<?php echo $href; ?>">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<strong>To:</strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
for ($i = 0; $i < count($receivers); $i++)
|
||||
{
|
||||
$receiver = $receivers[$i];
|
||||
// Every 10 recipients a new line
|
||||
if ($i > 1 && $i % 10 == 0)
|
||||
{
|
||||
echo '<br>';
|
||||
}
|
||||
echo $receiver->Vorname . " " . $receiver->Nachname . "; ";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="3px"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong>Subject:</strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$subject = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$subject = 'Re: '.$message->subject;
|
||||
}
|
||||
?>
|
||||
<input id="subject" type="text" value="<?php echo $subject; ?>" name="subject" size="70">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="80%">
|
||||
<strong>Message:</strong><br>
|
||||
<?php
|
||||
$body = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$body = $message->body;
|
||||
}
|
||||
?>
|
||||
<textarea id="bodyTextArea" name="body"><?php echo $body; ?></textarea>
|
||||
</td>
|
||||
<td width="3%"> </td>
|
||||
<td width="17%">
|
||||
<?php
|
||||
if (isset($variables))
|
||||
{
|
||||
?>
|
||||
<div>
|
||||
<strong>Variables:</strong><br>
|
||||
<select id="variables" size="14" style="min-width:200px;">
|
||||
<?php
|
||||
foreach($variables as $key => $val)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Vorlage_widget',
|
||||
array('oe_kurzbz' => $oe_kurzbz, 'isAdmin' => $isAdmin),
|
||||
array('name' => 'vorlage', 'id' => 'vorlageDnD')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<button id="sendButton" type="button">Send</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<?php
|
||||
if (isset($receivers) && count($receivers) > 0)
|
||||
{
|
||||
?>
|
||||
<div>
|
||||
Preview:
|
||||
</div>
|
||||
<div style="border: 1px; border-style: solid;">
|
||||
<table width="100%" style="margin: 3px;">
|
||||
<tr>
|
||||
<td>
|
||||
<strong>Recipient:</strong>
|
||||
<select id="recipients">
|
||||
<option value="-1">Select...</option>
|
||||
<?php
|
||||
foreach($receivers as $receiver)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $receiver->prestudent_id; ?>"><?php echo $receiver->Nachname . " " . $receiver->Vorname; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<strong><a href="#" id="refresh">Refresh</a></strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<textarea id="tinymcePreview"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
for($i = 0; $i < count($receivers); $i++)
|
||||
{
|
||||
$receiver = $receivers[$i];
|
||||
echo '<input type="hidden" name="prestudents[]" value="' . $receiver->prestudent_id . '">' . "\n";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($message))
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="relationmessage_id" value="<?php echo $message->message_id; ?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: "#bodyTextArea"
|
||||
});
|
||||
|
||||
tinymce.init({
|
||||
menubar: false,
|
||||
toolbar: false,
|
||||
readonly: 1,
|
||||
selector: "#tinymcePreview",
|
||||
statusbar: true
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
if ($("#variables"))
|
||||
{
|
||||
$("#variables").dblclick(function() {
|
||||
if ($("#bodyTextArea"))
|
||||
{
|
||||
tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#recipients"))
|
||||
{
|
||||
$("#recipients").change(tinymcePreviewSetContent);
|
||||
}
|
||||
|
||||
if ($("#refresh"))
|
||||
{
|
||||
$("#refresh").click(tinymcePreviewSetContent);
|
||||
}
|
||||
|
||||
if ($("#sendButton") && $("#sendForm"))
|
||||
{
|
||||
$("#sendButton").click(function() {
|
||||
if ($("#subject") && $("#subject").val() != '' && tinyMCE.get("bodyTextArea").getContent() != '')
|
||||
{
|
||||
$("#sendForm").submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Subject and text are required fields!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#vorlageDnD"))
|
||||
{
|
||||
$("#vorlageDnD").change(function() {
|
||||
if (this.value != '')
|
||||
{
|
||||
<?php
|
||||
$url = str_replace("/system/Messages/write", "/system/Messages/getVorlage", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: "<?php echo $url; ?>",
|
||||
data: {"vorlage_kurzbz": this.value},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
tinyMCE.get("bodyTextArea").setContent(data.retval[0].text);
|
||||
$("#subject").val(data.retval[0].subject);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function tinymcePreviewSetContent()
|
||||
{
|
||||
if ($("#tinymcePreview"))
|
||||
{
|
||||
if ($("#recipients").children(":selected").val() > -1)
|
||||
{
|
||||
parseMessageText($("#recipients").children(":selected").val(), tinyMCE.get("bodyTextArea").getContent());
|
||||
}
|
||||
else
|
||||
{
|
||||
tinyMCE.get("tinymcePreview").setContent("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parseMessageText(prestudent_id, text)
|
||||
{
|
||||
<?php
|
||||
$url = str_replace("/system/Messages/write", "/system/Messages/parseMessageText", $_SERVER["REQUEST_URI"]);
|
||||
$url = substr($url, 0, strrpos($url, '/'));
|
||||
?>
|
||||
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: "<?php echo $url; ?>",
|
||||
data: {"prestudent_id": prestudent_id, "text" : text},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
tinyMCE.get("tinymcePreview").setContent(data);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/footer"); ?>
|
||||
<?php $this->load->view("templates/header", array("title" => "MessageReply", "jquery19" => true, "tinymce" => true)); ?>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
$href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
<form id="sendForm" method="post" action="<?php echo $href; ?>">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<strong>To:</strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
for ($i = 0; $i < count($receivers); $i++)
|
||||
{
|
||||
$receiver = $receivers[$i];
|
||||
// Every 10 recipients a new line
|
||||
if ($i > 1 && $i % 10 == 0)
|
||||
{
|
||||
echo '<br>';
|
||||
}
|
||||
echo $receiver->Vorname . " " . $receiver->Nachname . "; ";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="3px"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong>Subject:</strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$subject = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$subject = 'Re: '.$message->subject;
|
||||
}
|
||||
?>
|
||||
<input id="subject" type="text" value="<?php echo $subject; ?>" name="subject" size="70">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="80%">
|
||||
<strong>Message:</strong><br>
|
||||
<?php
|
||||
$body = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$body = $message->body;
|
||||
}
|
||||
?>
|
||||
<textarea id="bodyTextArea" name="body"><?php echo $body; ?></textarea>
|
||||
</td>
|
||||
<td width="3%"> </td>
|
||||
<td width="17%">
|
||||
<?php
|
||||
if (isset($variables))
|
||||
{
|
||||
?>
|
||||
<div>
|
||||
<strong>Variables:</strong><br>
|
||||
<select id="variables" size="14" style="min-width:200px;">
|
||||
<?php
|
||||
foreach($variables as $key => $val)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Vorlage_widget',
|
||||
array('oe_kurzbz' => $oe_kurzbz, 'isAdmin' => $isAdmin),
|
||||
array('name' => 'vorlage', 'id' => 'vorlageDnD')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<button id="sendButton" type="button">Send</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<?php
|
||||
if (isset($receivers) && count($receivers) > 0)
|
||||
{
|
||||
?>
|
||||
<div>
|
||||
Preview:
|
||||
</div>
|
||||
<div style="border: 1px; border-style: solid;">
|
||||
<table width="100%" style="margin: 3px;">
|
||||
<tr>
|
||||
<td>
|
||||
<strong>Recipient:</strong>
|
||||
<select id="recipients">
|
||||
<option value="-1">Select...</option>
|
||||
<?php
|
||||
foreach($receivers as $receiver)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $receiver->prestudent_id; ?>"><?php echo $receiver->Nachname . " " . $receiver->Vorname; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<strong><a href="#" id="refresh">Refresh</a></strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<textarea id="tinymcePreview"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
for($i = 0; $i < count($receivers); $i++)
|
||||
{
|
||||
$receiver = $receivers[$i];
|
||||
echo '<input type="hidden" name="prestudents[]" value="' . $receiver->prestudent_id . '">' . "\n";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($message))
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="relationmessage_id" value="<?php echo $message->message_id; ?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: "#bodyTextArea"
|
||||
});
|
||||
|
||||
tinymce.init({
|
||||
menubar: false,
|
||||
toolbar: false,
|
||||
readonly: 1,
|
||||
selector: "#tinymcePreview",
|
||||
statusbar: true
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
if ($("#variables"))
|
||||
{
|
||||
$("#variables").dblclick(function() {
|
||||
if ($("#bodyTextArea"))
|
||||
{
|
||||
tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#recipients"))
|
||||
{
|
||||
$("#recipients").change(tinymcePreviewSetContent);
|
||||
}
|
||||
|
||||
if ($("#refresh"))
|
||||
{
|
||||
$("#refresh").click(tinymcePreviewSetContent);
|
||||
}
|
||||
|
||||
if ($("#sendButton") && $("#sendForm"))
|
||||
{
|
||||
$("#sendButton").click(function() {
|
||||
if ($("#subject") && $("#subject").val() != '' && tinyMCE.get("bodyTextArea").getContent() != '')
|
||||
{
|
||||
$("#sendForm").submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Subject and text are required fields!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#vorlageDnD"))
|
||||
{
|
||||
$("#vorlageDnD").change(function() {
|
||||
if (this.value != '')
|
||||
{
|
||||
<?php
|
||||
$url = str_replace("/system/Messages/write", "/system/Messages/getVorlage", $_SERVER["REQUEST_URI"]);
|
||||
?>
|
||||
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: "<?php echo $url; ?>",
|
||||
data: {"vorlage_kurzbz": this.value},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
tinyMCE.get("bodyTextArea").setContent(data.retval[0].text);
|
||||
$("#subject").val(data.retval[0].subject);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function tinymcePreviewSetContent()
|
||||
{
|
||||
if ($("#tinymcePreview"))
|
||||
{
|
||||
if ($("#recipients").children(":selected").val() > -1)
|
||||
{
|
||||
parseMessageText($("#recipients").children(":selected").val(), tinyMCE.get("bodyTextArea").getContent());
|
||||
}
|
||||
else
|
||||
{
|
||||
tinyMCE.get("tinymcePreview").setContent("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parseMessageText(prestudent_id, text)
|
||||
{
|
||||
<?php
|
||||
$url = str_replace("/system/Messages/write", "/system/Messages/parseMessageText", $_SERVER["REQUEST_URI"]);
|
||||
$url = substr($url, 0, strrpos($url, '/'));
|
||||
?>
|
||||
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: "<?php echo $url; ?>",
|
||||
data: {"prestudent_id": prestudent_id, "text" : text},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
tinyMCE.get("tinymcePreview").setContent(data);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/footer"); ?>
|
||||
|
||||
@@ -91,12 +91,12 @@ function initTextile() {
|
||||
|
||||
// use a simple timer to check if the textarea content has changed
|
||||
var value = $content.val();
|
||||
$preview.html(textile.convert(value));
|
||||
$preview.html(textile.parse(value));
|
||||
setInterval(function () {
|
||||
var newValue = $content.val();
|
||||
if (value != newValue) {
|
||||
value = newValue;
|
||||
$preview.html(textile.convert(newValue)); // convert the textile to html
|
||||
$preview.html(textile.parse(newValue)); // convert the textile to html
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
isset($title) ? $title = 'VileSci - '.$title : $title = 'VileSci';
|
||||
!isset($jquery) ? $jquery = false : $jquery = $jquery;
|
||||
!isset($jquery19) ? $jquery19 = false : $jquery19 = $jquery19;
|
||||
!isset($jqueryComposer) ? $jqueryComposer = false : $jqueryComposer = $jqueryComposer;
|
||||
!isset($jqueryui) ? $jqueryui = false : $jqueryui = $jqueryui;
|
||||
!isset($jquery_checkboxes) ? $jquery_checkboxes = false : $jquery_checkboxes = $jquery_checkboxes;
|
||||
@@ -19,7 +19,7 @@ isset($title) ? $title = 'VileSci - '.$title : $title = 'VileSci';
|
||||
!isset($datepicker) ? $datepicker = false : $datepicker = $datepicker;
|
||||
|
||||
if ($tablesort || $jquery_checkboxes || $jquery_custom)
|
||||
$jquery = true;
|
||||
$jquery19 = true;
|
||||
|
||||
if($datepicker)
|
||||
$jqueryui = true;
|
||||
@@ -27,8 +27,8 @@ if($datepicker)
|
||||
if($jqueryui)
|
||||
$jqueryComposer = true;
|
||||
|
||||
if($jquery && $jqueryComposer)
|
||||
show_error("Two JQuery versions used: composer and includefolderversion");
|
||||
if($jquery19 && $jqueryComposer)
|
||||
show_error("Two JQuery versions used: composer and include folder version");
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML>
|
||||
@@ -42,7 +42,7 @@ if($jquery && $jqueryComposer)
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url('skin/tablesort.css'); ?>" />
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($jquery) : ?>
|
||||
<?php if($jquery19) : ?>
|
||||
<script type="text/javascript" src="<?php echo base_url('include/js/jquery1.9.min.js'); ?>"></script>
|
||||
<?php endif ?>
|
||||
|
||||
@@ -56,7 +56,7 @@ if($jquery && $jqueryComposer)
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($jquery_checkboxes) : ?>
|
||||
<script type="text/javascript" src="<?php echo base_url('include/js/jquery.checkboxes-1.0.7.min.js'); ?>"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url('vendor/rmariuzzo/jquery-checkboxes/dist/jquery.checkboxes-1.0.7.min.js'); ?>"></script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($jquery_custom) : ?>
|
||||
@@ -93,7 +93,7 @@ if($jquery && $jqueryComposer)
|
||||
<script type="text/javascript" src="<?php echo base_url('vendor/tinymce/tinymce/tinymce.min.js');?>"></script>
|
||||
<?php endif ?>
|
||||
<?php if($textile) : ?>
|
||||
<script type="text/javascript" src="<?php echo base_url('include/js/textile.min.js');?>"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url('vendor/borgar/textile-js/lib/textile.min.js');?>"></script>
|
||||
<?php endif ?>
|
||||
<?php if($jsoneditor) : ?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url('vendor/jsoneditor/dist/jsoneditor.css');?>" />
|
||||
@@ -106,4 +106,4 @@ if($jquery && $jqueryComposer)
|
||||
<?php if($widgetsCSS) : ?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url('skin/widgets.css'); ?>" />
|
||||
<?php endif ?>
|
||||
</head>
|
||||
</head>
|
||||
|
||||
@@ -125,4 +125,4 @@ class Vorlage_widget extends DropdownWidget
|
||||
|
||||
return $vorlage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ $summe_stud = 0;
|
||||
$summe_t2 = 0;
|
||||
$summe_komm = 0;
|
||||
$summe_ng = 0;
|
||||
|
||||
$grades = array();
|
||||
$sprache = getSprache();
|
||||
$p = new phrasen($sprache);
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ function drawTree($tree, $depth)
|
||||
{
|
||||
global $uid, $stsem_arr, $noten_arr, $lvangebot_arr, $aktornext;
|
||||
global $datum_obj, $db, $lv_arr, $p, $note_pruef_arr, $student;
|
||||
|
||||
|
||||
foreach($tree as $row_tree)
|
||||
{
|
||||
$style='';
|
||||
@@ -376,7 +376,8 @@ function drawTree($tree, $depth)
|
||||
break;
|
||||
case 'lv':
|
||||
$icon='<img src="../../../skin/images/lv.png"> ';
|
||||
$termine="<a href='../lvplan/stpl_week.php?type=lva&lva=" . $row_tree->lehrveranstaltung_id . "' target='_blank'><img src='../../../skin/images/date_magnify.png' title='Termine' alt='Termine'></a>";
|
||||
if (!defined('CIS_STUDIENPLAN_LVPLANLINK_ANZEIGEN') || CIS_STUDIENPLAN_LVPLANLINK_ANZEIGEN)
|
||||
$termine="<a href='../lvplan/stpl_week.php?type=lva&lva=" . $row_tree->lehrveranstaltung_id . "' target='_blank'><img src='../../../skin/images/date_magnify.png' title='Termine' alt='Termine'></a>";
|
||||
break;
|
||||
default:
|
||||
$icon='';
|
||||
@@ -434,10 +435,10 @@ function drawTree($tree, $depth)
|
||||
echo '<td>';
|
||||
|
||||
// Note zu dieser LV vorhanden?
|
||||
|
||||
|
||||
$lv_kompatibel = new lehrveranstaltung();
|
||||
$kompatibleLVs = $lv_kompatibel->loadLVkompatibel($row_tree->lehrveranstaltung_id);
|
||||
|
||||
|
||||
if(isset($noten_arr[$row_tree->lehrveranstaltung_id]))
|
||||
{
|
||||
// Positive Note fuer diese LV vorhanden?
|
||||
@@ -447,7 +448,7 @@ function drawTree($tree, $depth)
|
||||
if($note_pruef_arr[$note]->positiv)
|
||||
$positiv=true;
|
||||
}
|
||||
|
||||
|
||||
if(!$positiv)
|
||||
{
|
||||
//echo '<span class="error">'.$p->t('studienplan/negativ').'</span>';
|
||||
@@ -478,7 +479,7 @@ function drawTree($tree, $depth)
|
||||
else
|
||||
{
|
||||
echo '<span>'.$p->t('studienplan/offen').'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
//check if compatible course has grade
|
||||
elseif(count($kompatibleLVs) > 0)
|
||||
@@ -526,15 +527,15 @@ function drawTree($tree, $depth)
|
||||
}
|
||||
elseif(count($kompatibleLVs) > 0)
|
||||
{
|
||||
|
||||
|
||||
$i = 0;
|
||||
while(!$found && $i < count($kompatibleLVs))
|
||||
{
|
||||
{
|
||||
foreach($kompatibleLVs as $komp)
|
||||
{
|
||||
$anrechnung = new anrechnung();
|
||||
$anrechnung->getAnrechnungPrestudent($student->prestudent_id, $row_tree->lehrveranstaltung_id, $komp);
|
||||
|
||||
|
||||
if(count($anrechnung->result) == 1)
|
||||
{
|
||||
$lv = $anrechnung->result[0]->lehrveranstaltung_id_kompatibel;
|
||||
@@ -582,7 +583,7 @@ function drawTree($tree, $depth)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach($lvkompatibel_arr as $row_lvid)
|
||||
{
|
||||
// Angebot der LV pruefen
|
||||
@@ -661,16 +662,16 @@ function drawTree($tree, $depth)
|
||||
|
||||
function checkKompatibleLvs($kompatibleLVs, $student, $row_tree, $noten_arr, $note_pruef_arr, $p, $uid, $negativeNote= null)
|
||||
{
|
||||
$positiv = false;
|
||||
$positiv = false;
|
||||
$found = false;
|
||||
$i = 0;
|
||||
while(!$found && $i < count($kompatibleLVs))
|
||||
{
|
||||
{
|
||||
foreach($kompatibleLVs as $komp)
|
||||
{
|
||||
|
||||
$anrechnung = new anrechnung();
|
||||
$anrechnung->getAnrechnungPrestudent($student->prestudent_id, $row_tree->lehrveranstaltung_id, $komp);
|
||||
$anrechnung->getAnrechnungPrestudent($student->prestudent_id, $row_tree->lehrveranstaltung_id, $komp);
|
||||
|
||||
if(count($anrechnung->result) == 1)
|
||||
{
|
||||
|
||||
+137
-104
@@ -1,113 +1,146 @@
|
||||
{
|
||||
"name": "fh-complete/fhc-core",
|
||||
"type": "app",
|
||||
"description": "FH-Complete Core",
|
||||
"keywords": ["fhc", "fh-complete", "campusmanagement"],
|
||||
"homepage": "https://github.com/FH-Complete/FHC-Core",
|
||||
"license": "GPLv3",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Christian Paminger",
|
||||
"email": "christian.paminger@fhcomplete.org",
|
||||
"homepage": "http://fhcomplete.org"
|
||||
},
|
||||
{
|
||||
"name": "Andreas Österreicher",
|
||||
"email": "oesi@technikum-wien.at",
|
||||
"homepage": "http://fhcomplete.org"
|
||||
}],
|
||||
"support":
|
||||
{
|
||||
"email": "info@fhcomplete.org",
|
||||
"forum": "https://plus.google.com/communities/113278802529782592610",
|
||||
"wiki": "http://wiki.fhcomplete.org/"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "package",
|
||||
"package":
|
||||
{
|
||||
"name": "codeigniter-restserver",
|
||||
"version": "2.6",
|
||||
"dist":
|
||||
{
|
||||
"url": "https://github.com/chriskacerguis/codeigniter-restserver/archive/master.zip",
|
||||
"type": "zip"
|
||||
}
|
||||
"name": "fh-complete/fhc-core",
|
||||
"type": "app",
|
||||
"description": "FH-Complete Core",
|
||||
"keywords": [
|
||||
"fhc",
|
||||
"fh-complete",
|
||||
"campusmanagement"
|
||||
],
|
||||
"homepage": "https://github.com/FH-Complete/FHC-Core",
|
||||
"license": "GPLv3",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Christian Paminger",
|
||||
"email": "christian.paminger@fhcomplete.org",
|
||||
"homepage": "http://fhcomplete.org"
|
||||
},
|
||||
{
|
||||
"name": "Andreas Österreicher",
|
||||
"email": "oesi@technikum-wien.at",
|
||||
"homepage": "http://fhcomplete.org"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"email": "info@fhcomplete.org",
|
||||
"forum": "https://plus.google.com/communities/113278802529782592610",
|
||||
"wiki": "http://wiki.fhcomplete.org/"
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package":
|
||||
{
|
||||
"name": "jsoneditor",
|
||||
"version": "5.5.6",
|
||||
"dist":
|
||||
{
|
||||
"url": "https://github.com/josdejong/jsoneditor/archive/v5.5.6.zip",
|
||||
"type": "zip"
|
||||
"repositories": [
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "codeigniter-restserver",
|
||||
"version": "2.6",
|
||||
"dist": {
|
||||
"url": "https://github.com/chriskacerguis/codeigniter-restserver/archive/master.zip",
|
||||
"type": "zip"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "jsoneditor",
|
||||
"version": "5.5.6",
|
||||
"dist": {
|
||||
"url": "https://github.com/josdejong/jsoneditor/archive/v5.5.6.zip",
|
||||
"type": "zip"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "json-forms",
|
||||
"version": "1.4.0",
|
||||
"dist": {
|
||||
"url": "https://github.com/brutusin/json-forms/archive/v1.4.0.zip",
|
||||
"type": "zip"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "borgar/textile-js",
|
||||
"version": "1.0",
|
||||
"source": {
|
||||
"url": "https://github.com/borgar/textile-js.git",
|
||||
"type": "git",
|
||||
"reference": "master"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "rmariuzzo/jquery-checkboxes",
|
||||
"version": "1.0.7",
|
||||
"source": {
|
||||
"url": "https://github.com/rmariuzzo/checkboxes.js.git",
|
||||
"type": "git",
|
||||
"reference": "081cac1eb9b504dc32be27b57f32f6d1d29a5253"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "jquery/jquery1.9",
|
||||
"version": "1.9.0",
|
||||
"dist": {
|
||||
"type": "file",
|
||||
"url": "https://code.jquery.com/jquery-1.9.0.min.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.4.0",
|
||||
"codeigniter/framework": "3.*",
|
||||
"codeigniter-restserver": "2.6",
|
||||
"jsoneditor": "5.5.6",
|
||||
"kingsquare/json-schema-form": "*",
|
||||
"easyrdf/easyrdf": "0.9.*",
|
||||
"ml/json-ld": "1.*",
|
||||
"rougin/combustor": "1.1.*",
|
||||
"rougin/refinery": "*",
|
||||
"components/jquery": "2.1.4",
|
||||
"components/jqueryui": "1.12.*",
|
||||
"components/angular.js": "1.3.16",
|
||||
"components/bootstrap": "3.3.5",
|
||||
"michelf/php-markdown": "1.5.0",
|
||||
"tinymce/tinymce": "4.*",
|
||||
"zetacomponents/workflow": "1.*",
|
||||
"zetacomponents/document": "1.*",
|
||||
"zetacomponents/workflow-database-tiein": "1.*",
|
||||
"zetacomponents/workflow-event-log-tiein": "1.*",
|
||||
"json-forms": "1.4.0",
|
||||
"wikimedia/composer-merge-plugin": "^1.3",
|
||||
"fzaninotto/faker": "1.*",
|
||||
"netcarver/textile": "^3.5",
|
||||
"netcarver/textile": "^3.5",
|
||||
"borgar/textile-js": "1.0",
|
||||
"rmariuzzo/jquery-checkboxes": "1.0.7",
|
||||
"jquery/jquery1.9": "1.9.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "2.*"
|
||||
},
|
||||
"config": {
|
||||
"bin-dir": "bin"
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package":
|
||||
{
|
||||
"name": "json-forms",
|
||||
"version": "1.4.0",
|
||||
"dist":
|
||||
{
|
||||
"url": "https://github.com/brutusin/json-forms/archive/v1.4.0.zip",
|
||||
"type": "zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"require":
|
||||
{
|
||||
"php": ">=5.4.0",
|
||||
"codeigniter/framework":"3.*",
|
||||
"codeigniter-restserver": "2.6",
|
||||
"jsoneditor": "5.5.6",
|
||||
"kingsquare/json-schema-form": "*",
|
||||
"easyrdf/easyrdf": "0.9.*",
|
||||
"ml/json-ld": "1.*",
|
||||
"rougin/combustor": "1.1.*",
|
||||
"rougin/refinery": "*",
|
||||
"components/jquery": "2.1.4",
|
||||
"components/jqueryui": "1.12.*",
|
||||
"components/angular.js": "1.3.16",
|
||||
"components/bootstrap": "3.3.5",
|
||||
"michelf/php-markdown": "1.5.0",
|
||||
"tinymce/tinymce": "4.*",
|
||||
"zetacomponents/workflow": "1.*",
|
||||
"zetacomponents/document": "1.*",
|
||||
"zetacomponents/workflow-database-tiein": "1.*",
|
||||
"zetacomponents/workflow-event-log-tiein": "1.*",
|
||||
"json-forms": "1.4.0",
|
||||
"wikimedia/composer-merge-plugin": "^1.3",
|
||||
"fzaninotto/faker": "1.*",
|
||||
"netcarver/textile": "^3.5"
|
||||
},
|
||||
"require-dev":
|
||||
{
|
||||
"squizlabs/php_codesniffer": "2.*"
|
||||
},
|
||||
"config":
|
||||
{
|
||||
"bin-dir": "bin"
|
||||
},
|
||||
|
||||
"extra": {
|
||||
"merge-plugin": {
|
||||
"include": [
|
||||
"composer.json",
|
||||
"addons/*/composer.json"
|
||||
],
|
||||
"recurse": true,
|
||||
"replace": false,
|
||||
"merge-dev": false,
|
||||
"merge-extra": false
|
||||
}
|
||||
"merge-plugin": {
|
||||
"include": [
|
||||
"composer.json",
|
||||
"addons/*/composer.json"
|
||||
],
|
||||
"recurse": true,
|
||||
"replace": false,
|
||||
"merge-dev": false,
|
||||
"merge-extra": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,6 +186,7 @@ define('VILESCI_PERSON_NEU_STUDIENSEMESTER_WINTERONLY',false);
|
||||
|
||||
// Anzeigeoptionen für den Studienplan im CIS
|
||||
define('CIS_STUDIENPLAN_SEMESTER_ANZEIGEN', false);
|
||||
define('CIS_STUDIENPLAN_LVPLANLINK_ANZEIGEN',true);
|
||||
|
||||
//Legt fest ob ein User zu einer LV angemeldet sein muss um Detailinformationen abrufen zu können. (true|false)
|
||||
define('CIS_LEHRVERANSTALTUNG_WENNANGEMELDET_DETAILS_ANZEIGEN', false);
|
||||
|
||||
@@ -623,7 +623,7 @@ function MitarbeiterAuswahl()
|
||||
// ***** Termine *****
|
||||
document.getElementById('mitarbeiter-termine').setAttribute('src','termine.xul.php?mitarbeiter_uid='+uid);
|
||||
}
|
||||
|
||||
|
||||
// ***** UDF *****
|
||||
if (document.getElementById('mitarbeiter-tabs').selectedItem == document.getElementById('mitarbeiter-tab-udf'))
|
||||
{
|
||||
@@ -915,56 +915,48 @@ function MitarbeiterNeu()
|
||||
}
|
||||
|
||||
// ****
|
||||
// * Exportiert die Daten in ein Excel File
|
||||
// * Excel Export der Mitarbeiter
|
||||
// ****
|
||||
function MitarbeiterExport()
|
||||
{
|
||||
var treeMitarbeiter=document.getElementById('mitarbeiter-tree');
|
||||
var treeMitarbeiterMenu=document.getElementById('tree-menu-mitarbeiter');
|
||||
var col = treeMitarbeiterMenu.columns ? treeMitarbeiterMenu.columns["tree-menu-mitarbeiter-col-filter"] : "tree-menu-mitarbeiter-col-filter";
|
||||
var filter=treeMitarbeiterMenu.view.getCellText(treeMitarbeiterMenu.currentIndex,col);
|
||||
cols = treeMitarbeiter.getElementsByTagName('treecol');
|
||||
|
||||
var url = "<?php echo APP_ROOT; ?>content/statistik/mitarbeiterexport.xls.php";
|
||||
var attributes="?type=mitarbeiter";
|
||||
if (filter=="Studiengangsleiter")
|
||||
attributes+="&stgl=true";
|
||||
if (filter=="Fachbereichsleiter")
|
||||
attributes+="&fbl=true";
|
||||
if (filter=="Alle")
|
||||
attributes+="&alle=true";
|
||||
if (filter=="Aktive")
|
||||
attributes+="&aktiv=true";
|
||||
if (filter=="FixAngestellte")
|
||||
attributes+="&fix=true&aktiv=true";
|
||||
if (filter=="FixAngestellteAlle")
|
||||
attributes+="&fix=true";
|
||||
if (filter=="Inaktive")
|
||||
attributes+="&aktiv=false";
|
||||
if (filter=="Karenziert")
|
||||
attributes+="&karenziert=true";
|
||||
if (filter=="Ausgeschieden")
|
||||
attributes+="&ausgeschieden=true";
|
||||
if (filter=="FreiAngestellte")
|
||||
attributes+="&fix=false&aktiv=true";
|
||||
if (filter=="FreiAngestellteAlle")
|
||||
attributes+="&fix=false";
|
||||
|
||||
url+=attributes;
|
||||
spalte=0;
|
||||
for(i in cols)
|
||||
var tree = document.getElementById('mitarbeiter-tree');
|
||||
var data='';
|
||||
//Wenn nichts markiert wurde -> alle exportieren
|
||||
if(tree.currentIndex==-1)
|
||||
{
|
||||
if(cols[i].hidden==false)
|
||||
if(tree.view)
|
||||
var items = tree.view.rowCount; //Anzahl der Zeilen ermitteln
|
||||
else
|
||||
return false;
|
||||
|
||||
for (var v=0; v < items; v++)
|
||||
{
|
||||
url += "&spalte"+spalte+"="+MitarbeiterDetailgetSpaltenname(cols[i].id);
|
||||
spalte=spalte+1;
|
||||
var mitarbeiter_uid = getTreeCellText(tree, 'mitarbeiter-treecol-uid', v);
|
||||
data = data+';'+mitarbeiter_uid;
|
||||
}
|
||||
}
|
||||
//url+='&spalte0=titelpre&spalte1=vorname&spalte2=vornamen&spalte3=familienname&spalte4=uid';
|
||||
else
|
||||
{
|
||||
var start = new Object();
|
||||
var end = new Object();
|
||||
var numRanges = tree.view.selection.getRangeCount();
|
||||
var paramList= '';
|
||||
var anzahl=0;
|
||||
|
||||
//alert(url);
|
||||
//window.open(url,"","chrome,status=no, modal, width=400, height=250, centerscreen, resizable");
|
||||
window.location.href=url;
|
||||
//alle markierten personen holen
|
||||
for (var t = 0; t < numRanges; t++)
|
||||
{
|
||||
tree.view.selection.getRangeAt(t,start,end);
|
||||
for (var v = start.value; v <= end.value; v++)
|
||||
{
|
||||
mitarbeiter_uid = getTreeCellText(tree, 'mitarbeiter-treecol-uid', v);
|
||||
data = data+';'+mitarbeiter_uid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
action = '<?php echo APP_ROOT; ?>content/statistik/mitarbeiterexport.xls.php';
|
||||
OpenWindowPost(action, data);
|
||||
}
|
||||
|
||||
// ****
|
||||
@@ -1992,9 +1984,9 @@ function MitarbeiterUDFIFrameLoad()
|
||||
{
|
||||
//Ausgewaehlte person_id holen
|
||||
var person_id = getTreeCellText(tree, 'mitarbeiter-treecol-person_id', tree.currentIndex);
|
||||
|
||||
|
||||
url = 'udf.xul.php?person_id='+person_id;
|
||||
document.getElementById('mitarbeiter-udf').setAttribute('src', url);
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/mitarbeiter/mitarbeitervertragover
|
||||
<toolbox flex="1">
|
||||
<toolbar id="mitarbeiter-nav-toolbar">
|
||||
<toolbarbutton id="mitarbeiter-toolbar-neu" label="Neu" oncommand="MitarbeiterNeu()" disabled="false" image="../skin/images/NeuDokument.png" tooltiptext="Neuen Mitarbeiter anlegen"/>
|
||||
<toolbarbutton id="mitarbeiter-toolbar-export" label="Export" oncommand="MitarbeiterExport()" disabled="false" image="../skin/images/ExcelIcon.png" tooltiptext="Daten ins Excel Exportieren"/>
|
||||
<toolbarbutton id="mitarbeiter-toolbar-export" label="Export" oncommand="MitarbeiterExport()" disabled="false" image="../skin/images/ExcelIcon.png" tooltiptext="Daten ins Excel exportieren"/>
|
||||
<toolbarbutton id="mitarbeiter-toolbar-refresh" label="Aktualisieren" oncommand="MitarbeiterTreeRefresh()" disabled="false" image="../skin/images/refresh.png" tooltiptext="Liste neu laden"/>
|
||||
<textbox id="mitarbeiter-toolbar-textbox-suche" control="mitarbeiter-toolbar-button-search" onkeypress="MitarbeiterSearchFieldKeyPress(event)" />
|
||||
<button id="mitarbeiter-toolbar-button-search" oncommand="MitarbeiterSuche()" label="Suchen"/>
|
||||
|
||||
@@ -36,59 +36,13 @@ $db = new basis_db();
|
||||
$user = get_uid();
|
||||
loadVariables($user);
|
||||
|
||||
//Parameter holen
|
||||
|
||||
if (isset($_GET['fix']))
|
||||
$fix = $_GET['fix'];
|
||||
else
|
||||
$fix=null;
|
||||
|
||||
if (isset($_GET['stgl']))
|
||||
$stgl = ($_GET['stgl'] == 'true' ? true : false);
|
||||
else
|
||||
$stgl=null;
|
||||
|
||||
if (isset($_GET['fbl']))
|
||||
$fbl = $_GET['fbl'];
|
||||
else
|
||||
$fbl=null;
|
||||
|
||||
if (isset($_GET['aktiv']))
|
||||
$aktiv = $_GET['aktiv'];
|
||||
else
|
||||
$aktiv=null;
|
||||
|
||||
if (isset($_GET['karenziert']))
|
||||
$karenziert = $_GET['karenziert'];
|
||||
else
|
||||
$karenziert=null;
|
||||
|
||||
if (isset($_GET['ausgeschieden']))
|
||||
$ausgeschieden = $_GET['ausgeschieden'];
|
||||
else
|
||||
$ausgeschieden=null;
|
||||
|
||||
if (isset($_GET['zustelladresse']))
|
||||
$zustelladresse = $_GET['zustelladresse'];
|
||||
else
|
||||
$zustelladresse = null;
|
||||
|
||||
// Die Spalten die Exportiert werden sollen, werden per GET uebergeben
|
||||
// spalte1=nachname, spalte2=vorname, spalte3=gebdatum, ...
|
||||
$anzSpalten = 0;
|
||||
$varname = 'spalte'.(string)$anzSpalten;
|
||||
while (isset($_GET[$varname]))
|
||||
{
|
||||
$spalte[$anzSpalten] = $_GET[$varname];
|
||||
$anzSpalten++;
|
||||
$varname = 'spalte'.(string)$anzSpalten;
|
||||
}
|
||||
|
||||
$zustelladresse = true;
|
||||
$data = $_POST['data'];
|
||||
$uids= explode(';',$data);
|
||||
|
||||
// Mitarbeiter holen
|
||||
$mitarbeiterDAO = new mitarbeiter();
|
||||
$mitarbeiterDAO->getPersonal($fix, $stgl, $fbl, $aktiv, $karenziert, $ausgeschieden, $semester_aktuell);
|
||||
//$mitarbeiterDAO->getPersonal($fix, $stgl, $fbl, $aktiv, $karenziert, $ausgeschieden, $semester_aktuell);
|
||||
$mitarbeiterDAO->getMitarbeiterArray($uids);
|
||||
|
||||
//Sortieren der Eintraege nach Nachname, Vorname
|
||||
//Umlaute werden ersetzt damit diese nicht unten angereiht werden
|
||||
@@ -106,6 +60,10 @@ foreach ($mitarbeiterDAO->result as $key => $foo)
|
||||
|
||||
array_multisort($nachname, SORT_ASC, $vorname, SORT_ASC, $mitarbeiterDAO->result);
|
||||
|
||||
$spalte = array('titelpre', 'vorname', 'vornamen', 'nachname', 'titelpost','gebdatum','svnr','ersatzkennzeichen',
|
||||
'aktiv','personalnummer', 'kurzbz','fixangestellt','lektor');
|
||||
$anzSpalten = count($spalte);
|
||||
|
||||
// Creating a workbook
|
||||
$workbook = new Spreadsheet_Excel_Writer();
|
||||
$workbook->setVersion(8);
|
||||
@@ -193,7 +151,7 @@ foreach ($mitarbeiterDAO->result as $mitarbeiter)
|
||||
if (mb_strlen($row->ort) > $maxlength[$col])
|
||||
$maxlength[$col] = mb_strlen($row->ort);
|
||||
$worksheet->write($zeile, $col, $row->ort);
|
||||
|
||||
|
||||
$col++;
|
||||
if ($row->firma_id != '')
|
||||
{
|
||||
@@ -210,38 +168,26 @@ foreach ($mitarbeiterDAO->result as $mitarbeiter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$col++;
|
||||
|
||||
|
||||
// UDF
|
||||
if (isset($mitarbeiter->p_udf_values))
|
||||
{
|
||||
$udfPerson = json_decode($mitarbeiter->p_udf_values);
|
||||
if (is_object($udfPerson)) $udfPerson = (array)$udfPerson;
|
||||
|
||||
|
||||
foreach($udfTitlesPerson as $udfTitle)
|
||||
{
|
||||
if (isset($udfPerson[$udfTitle['name']]))
|
||||
$toWrite = $udf->encodeToString($udfPerson, $udfTitle);
|
||||
|
||||
if (mb_strlen($toWrite) > $maxlength[$col])
|
||||
{
|
||||
if (is_string($udfPerson[$udfTitle['name']]) || is_numeric($udfPerson[$udfTitle['name']]))
|
||||
{
|
||||
if (mb_strlen($udfPerson[$udfTitle['name']]) > $maxlength[$col])
|
||||
{
|
||||
$maxlength[$col] = mb_strlen($udfPerson[$udfTitle['name']]);
|
||||
}
|
||||
$worksheet->write($zeile, $col, $udfPerson[$udfTitle['name']]);
|
||||
}
|
||||
else if(is_array($udfPerson[$udfTitle['name']]) && isset($udfTitle['enum']))
|
||||
{
|
||||
$toWrite = $udf->dropdownListValuesToString($udfPerson[$udfTitle['name']], $udfTitle['enum']);
|
||||
|
||||
if (mb_strlen($toWrite) > $maxlength[$col])
|
||||
{
|
||||
$maxlength[$col] = mb_strlen($toWrite);
|
||||
}
|
||||
$worksheet->write($zeile, $col, $toWrite);
|
||||
}
|
||||
$maxlength[$col] = mb_strlen($toWrite);
|
||||
}
|
||||
|
||||
$worksheet->write($zeile, $col, $toWrite);
|
||||
|
||||
$col++;
|
||||
}
|
||||
}
|
||||
@@ -263,4 +209,4 @@ $worksheet->setColumn($col, $col, $maxlength[$col] + 2);
|
||||
|
||||
$workbook->close();
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
/**
|
||||
* Exportiert die Daten von Prestudenten und Studenten in ein Excel File.
|
||||
*
|
||||
*
|
||||
* Parameter:
|
||||
* GET:
|
||||
* studiensemester_kurzbz ... Studiensemester
|
||||
@@ -43,7 +43,7 @@ $user = get_uid();
|
||||
$datum_obj = new datum();
|
||||
$db = new basis_db();
|
||||
loadVariables($user);
|
||||
|
||||
|
||||
//Parameter holen
|
||||
$data = $_REQUEST['data'];
|
||||
$studiensemester_kurzbz = $_GET['studiensemester_kurzbz'];
|
||||
@@ -108,6 +108,18 @@ $worksheet->write($zeile, ++$i, "TITELPOST", $format_bold);
|
||||
$maxlength[$i] = 9;
|
||||
$worksheet->write($zeile, ++$i, "EMail Privat", $format_bold);
|
||||
$maxlength[$i] = 12;
|
||||
$worksheet->write($zeile,++$i,"STRASSE", $format_bold);
|
||||
$maxlength[$i]=7;
|
||||
$worksheet->write($zeile-1,$i,"Zustelladresse", $format_bold);
|
||||
$maxlength[$i]=14;
|
||||
$worksheet->write($zeile,++$i,"PLZ", $format_bold);
|
||||
$maxlength[$i]=3;
|
||||
$worksheet->write($zeile,++$i,"ORT", $format_bold);
|
||||
$maxlength[$i]=3;
|
||||
$worksheet->write($zeile,++$i,"GEMEINDE", $format_bold);
|
||||
$maxlength[$i]=9;
|
||||
$worksheet->write($zeile,++$i,"NATION", $format_bold);
|
||||
$maxlength[$i] = 6;
|
||||
$worksheet->write($zeile, ++$i, "GEBURTSDATUM", $format_bold);
|
||||
$maxlength[$i] = 12;
|
||||
$worksheet->write($zeile, ++$i, "PERSONENKENNZEICHEN", $format_bold);
|
||||
@@ -189,13 +201,13 @@ $zeile++;
|
||||
$ids = explode(';',$data);
|
||||
$prestudent_ids = '';
|
||||
|
||||
foreach ($ids as $id)
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
if ($id!='')
|
||||
{
|
||||
if ($prestudent_ids!='')
|
||||
$prestudent_ids .= ',';
|
||||
$prestudent_ids .= "'".addslashes($id)."'";
|
||||
$prestudent_ids .= "'".$db->db_escape($id)."'";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +215,7 @@ if ($prestudent_ids!='')
|
||||
{
|
||||
// Student holen
|
||||
$qry = "SELECT *,";
|
||||
|
||||
|
||||
if ($udf->personHasUDF())
|
||||
{
|
||||
$qry .= " p.udf_values AS p_udf_values,";
|
||||
@@ -212,7 +224,7 @@ if ($prestudent_ids!='')
|
||||
{
|
||||
$qry .= " ps.udf_values AS ps_udf_values,";
|
||||
}
|
||||
|
||||
|
||||
$qry .= " ps.studiengang_kz AS prestgkz,
|
||||
(
|
||||
SELECT UPPER(typ || kurzbz)
|
||||
@@ -243,66 +255,121 @@ function draw_content($row)
|
||||
global $studiensemester_kurzbz;
|
||||
global $udfTitlesPerson, $udfTitlesPrestudent, $udf;
|
||||
$db = new basis_db();
|
||||
|
||||
|
||||
$prestudent = new prestudent();
|
||||
$prestudent->getLastStatus($row->prestudent_id);
|
||||
$status = $prestudent->status_kurzbz;
|
||||
$orgform = $prestudent->orgform_kurzbz;
|
||||
|
||||
|
||||
$i = 0;
|
||||
|
||||
|
||||
//Anrede
|
||||
if (mb_strlen($row->anrede) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->anrede);
|
||||
$worksheet->write($zeile, $i, $row->anrede);
|
||||
$i++;
|
||||
|
||||
|
||||
//Titelpre
|
||||
if (mb_strlen($row->titelpre) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->titelpre);
|
||||
$worksheet->write($zeile, $i, $row->titelpre);
|
||||
$i++;
|
||||
|
||||
|
||||
//Nachname
|
||||
if (mb_strlen($row->nachname) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->nachname);
|
||||
$worksheet->write($zeile, $i, $row->nachname);
|
||||
$i++;
|
||||
|
||||
|
||||
//Vorname
|
||||
if (mb_strlen($row->vorname) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->vorname);
|
||||
$worksheet->write($zeile, $i, $row->vorname);
|
||||
$i++;
|
||||
|
||||
|
||||
//Titelpost
|
||||
if (mb_strlen($row->titelpost) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->titelpost);
|
||||
$worksheet->write($zeile, $i, $row->titelpost);
|
||||
$i++;
|
||||
|
||||
|
||||
//Email Privat
|
||||
//ZustellEmailAdresse aus der Datenbank holen und dazuhaengen
|
||||
$qry_1 = "SELECT kontakt FROM public.tbl_kontakt
|
||||
WHERE kontakttyp='email' AND person_id='".addslashes($row->person_id)."' AND zustellung=true
|
||||
ORDER BY kontakt_id DESC LIMIT 1";
|
||||
$qry_1 = "
|
||||
SELECT
|
||||
kontakt
|
||||
FROM
|
||||
public.tbl_kontakt
|
||||
WHERE
|
||||
kontakttyp='email'
|
||||
AND person_id=".$db->db_add_param($row->person_id)."
|
||||
AND zustellung=true
|
||||
ORDER BY kontakt_id DESC
|
||||
LIMIT 1";
|
||||
|
||||
if ($db->db_query($qry_1))
|
||||
{
|
||||
if ($row_1 = $db->db_fetch_object())
|
||||
{
|
||||
{
|
||||
if (mb_strlen($row_1->kontakt) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row_1->kontakt);
|
||||
$worksheet->write($zeile, $i, $row_1->kontakt);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//Zustelladresse
|
||||
//Zustelladresse aus der Datenbank holen und dazuhaengen
|
||||
$qry_1 = "
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
public.tbl_adresse
|
||||
WHERE
|
||||
person_id=".$db->db_add_param($row->person_id)."
|
||||
AND zustelladresse=true LIMIT 1";
|
||||
|
||||
if($result_1 = $db->db_query($qry_1))
|
||||
{
|
||||
if($row_1 = $db->db_fetch_object($result_1))
|
||||
{
|
||||
if(mb_strlen($row_1->strasse)>$maxlength[$i])
|
||||
$maxlength[$i]=mb_strlen($row_1->strasse);
|
||||
$worksheet->write($zeile,$i, $row_1->strasse);
|
||||
$i++;
|
||||
|
||||
if(mb_strlen($row_1->plz)>$maxlength[$i])
|
||||
$maxlength[$i]=mb_strlen($row_1->plz);
|
||||
$worksheet->writeString($zeile,$i, $row_1->plz);
|
||||
$i++;
|
||||
|
||||
if(mb_strlen($row_1->ort)>$maxlength[$i])
|
||||
$maxlength[$i]=mb_strlen($row_1->ort);
|
||||
$worksheet->write($zeile,$i, $row_1->ort);
|
||||
$i++;
|
||||
|
||||
if(mb_strlen($row_1->gemeinde)>$maxlength[$i])
|
||||
$maxlength[$i]=mb_strlen($row_1->gemeinde);
|
||||
$worksheet->write($zeile,$i, $row_1->gemeinde);
|
||||
$i++;
|
||||
|
||||
if(mb_strlen($row_1->nation)>$maxlength[$i])
|
||||
$maxlength[$i]=mb_strlen($row_1->nation);
|
||||
$worksheet->write($zeile,$i, $row_1->nation);
|
||||
$i++;
|
||||
}
|
||||
else
|
||||
$i+=5;
|
||||
}
|
||||
else
|
||||
$i+=5;
|
||||
|
||||
//Geburtsdatum
|
||||
if (mb_strlen($row->gebdatum) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->gebdatum);
|
||||
$worksheet->write($zeile, $i, $datum_obj->convertISODate($row->gebdatum));
|
||||
$i++;
|
||||
|
||||
|
||||
//Personenkennzeichen
|
||||
if (isset($row->matrikelnr))
|
||||
{
|
||||
@@ -311,40 +378,49 @@ function draw_content($row)
|
||||
$worksheet->writeString($zeile, $i, $row->matrikelnr);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//Staatsbuergerschaft
|
||||
if (mb_strlen($row->staatsbuergerschaft) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->staatsbuergerschaft);
|
||||
$worksheet->write($zeile, $i, $row->staatsbuergerschaft);
|
||||
$i++;
|
||||
|
||||
|
||||
//SVNR
|
||||
if (mb_strlen($row->svnr) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->svnr);
|
||||
$worksheet->write($zeile, $i, $row->svnr);
|
||||
$i++;
|
||||
|
||||
|
||||
//Ersatzkennzeichen
|
||||
if (mb_strlen($row->ersatzkennzeichen) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->ersatzkennzeichen);
|
||||
$worksheet->write($zeile, $i, $row->ersatzkennzeichen);
|
||||
$i++;
|
||||
|
||||
|
||||
//Geschlecht
|
||||
if (mb_strlen($row->geschlecht) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->geschlecht);
|
||||
$worksheet->write($zeile, $i, $row->geschlecht);
|
||||
$i++;
|
||||
|
||||
|
||||
//Studiengang
|
||||
if (mb_strlen($row->stgbez) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->stgbez);
|
||||
$worksheet->write($zeile, $i, $row->stgbez);
|
||||
$i++;
|
||||
|
||||
$qry = "SELECT tbl_studentlehrverband.semester AS semester_studiensemester, tbl_student.semester AS semester_aktuell,* FROM public.tbl_studentlehrverband JOIN public.tbl_student USING(student_uid)
|
||||
WHERE prestudent_id='".addslashes($row->prestudent_id)."'
|
||||
AND studiensemester_kurzbz='".addslashes($studiensemester_kurzbz)."'";
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
tbl_studentlehrverband.semester AS semester_studiensemester,
|
||||
tbl_student.semester AS semester_aktuell,
|
||||
*
|
||||
FROM
|
||||
public.tbl_studentlehrverband
|
||||
JOIN public.tbl_student USING(student_uid)
|
||||
WHERE
|
||||
prestudent_id=".$db->db_add_param($row->prestudent_id)."
|
||||
AND studiensemester_kurzbz=".$db->db_add_param($studiensemester_kurzbz);
|
||||
|
||||
if ($db->db_query($qry))
|
||||
{
|
||||
if ($row_sem = $db->db_fetch_object())
|
||||
@@ -354,14 +430,14 @@ function draw_content($row)
|
||||
$verband = $row_sem->verband;
|
||||
$gruppe = $row_sem->gruppe;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$semester_aktuell = '';
|
||||
$verband = '';
|
||||
$gruppe = '';
|
||||
}
|
||||
}
|
||||
//Semester im eingestellten Studiensemester
|
||||
//Semester im eingestellten Studiensemester
|
||||
if (isset($semester_studiensemester))
|
||||
{
|
||||
if (mb_strlen($semester_studiensemester) > $maxlength[$i])
|
||||
@@ -369,7 +445,7 @@ function draw_content($row)
|
||||
$worksheet->write($zeile, $i, $semester_studiensemester);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//Semester aktuell
|
||||
if (isset($semester_aktuell))
|
||||
{
|
||||
@@ -378,7 +454,7 @@ function draw_content($row)
|
||||
$worksheet->write($zeile, $i, $semester_aktuell);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//Verband
|
||||
if (isset($verband))
|
||||
{
|
||||
@@ -387,7 +463,7 @@ function draw_content($row)
|
||||
$worksheet->write($zeile, $i, $verband);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//Gruppe
|
||||
if (isset($gruppe))
|
||||
{
|
||||
@@ -396,8 +472,8 @@ function draw_content($row)
|
||||
$worksheet->write($zeile, $i, $gruppe);
|
||||
}
|
||||
$i++;
|
||||
|
||||
//ZGV
|
||||
|
||||
//ZGV
|
||||
if ($row->zgv_code!='' && isset($zgv_arr[$row->zgv_code]))
|
||||
{
|
||||
if (mb_strlen($zgv_arr[$row->zgv_code]) > $maxlength[$i])
|
||||
@@ -405,19 +481,19 @@ function draw_content($row)
|
||||
$worksheet->write($zeile, $i, $zgv_arr[$row->zgv_code]);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//ZGV Ort
|
||||
if (mb_strlen($row->zgvort) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->zgvort);
|
||||
$worksheet->write($zeile, $i, $row->zgvort);
|
||||
$i++;
|
||||
|
||||
|
||||
//ZGV Datum
|
||||
if (mb_strlen($row->zgvdatum) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->zgvdatum);
|
||||
$worksheet->write($zeile, $i, $row->zgvdatum);
|
||||
$i++;
|
||||
|
||||
|
||||
//ZGV Master
|
||||
if ($row->zgvmas_code!='' && isset($zgvmas_arr[$row->zgvmas_code]))
|
||||
{
|
||||
@@ -426,31 +502,38 @@ function draw_content($row)
|
||||
$worksheet->write($zeile, $i, $zgvmas_arr[$row->zgvmas_code]);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//ZGV Master Ort
|
||||
if (mb_strlen($row->zgvmaort) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->zgvmaort);
|
||||
$worksheet->write($zeile, $i, $row->zgvmaort);
|
||||
$i++;
|
||||
|
||||
|
||||
//ZGV Master Datum
|
||||
if (mb_strlen($row->zgvmadatum) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->zgvmadatum);
|
||||
$worksheet->write($zeile, $i, $row->zgvmadatum);
|
||||
$i++;
|
||||
|
||||
|
||||
//Status
|
||||
if (mb_strlen($status) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($status);
|
||||
$worksheet->write($zeile, $i, $status);
|
||||
$i++;
|
||||
|
||||
|
||||
//Stati in anderen Studiengaengen
|
||||
$stati='';
|
||||
$qry_1 = "SELECT UPPER(typ::varchar(1) || kurzbz) as stg, get_rolle_prestudent(prestudent_id, null) as status FROM
|
||||
public.tbl_prestudent JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE person_id='".addslashes($row->person_id)."' AND tbl_prestudent.studiengang_kz<>'".addslashes($row->prestgkz)."'";
|
||||
|
||||
$qry_1 = "
|
||||
SELECT
|
||||
UPPER(typ::varchar(1) || kurzbz) as stg,
|
||||
get_rolle_prestudent(prestudent_id, null) as status
|
||||
FROM
|
||||
public.tbl_prestudent
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE
|
||||
person_id=".$db->db_add_param($row->person_id)."
|
||||
AND tbl_prestudent.studiengang_kz<>".$db->db_add_param($row->prestgkz);
|
||||
|
||||
if ($db->db_query($qry_1))
|
||||
{
|
||||
while($row_1 = $db->db_fetch_object())
|
||||
@@ -464,7 +547,7 @@ function draw_content($row)
|
||||
$maxlength[$i] = mb_strlen($stati);
|
||||
$worksheet->write($zeile, $i, $stati);
|
||||
$i++;
|
||||
|
||||
|
||||
//Email Intern
|
||||
if (isset($row->student_uid))
|
||||
{
|
||||
@@ -473,10 +556,19 @@ function draw_content($row)
|
||||
$worksheet->write($zeile, $i, $row->student_uid.'@'.DOMAIN);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//Telefon
|
||||
$qry_1 = "SELECT kontakt FROM public.tbl_kontakt
|
||||
WHERE kontakttyp in('mobil','telefon','so.tel') AND person_id='".addslashes($row->person_id)."' AND zustellung=true LIMIT 1";
|
||||
$qry_1 = "
|
||||
SELECT
|
||||
kontakt
|
||||
FROM
|
||||
public.tbl_kontakt
|
||||
WHERE
|
||||
kontakttyp in('mobil','telefon','so.tel')
|
||||
AND person_id=".$db->db_add_param($row->person_id)."
|
||||
AND zustellung=true
|
||||
LIMIT 1";
|
||||
|
||||
if ($db->db_query($qry_1))
|
||||
{
|
||||
if ($row_1 = $db->db_fetch_object())
|
||||
@@ -487,19 +579,26 @@ function draw_content($row)
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//Spezialgruppen
|
||||
$grps='';
|
||||
$qry_1 = "SELECT gruppe_kurzbz FROM public.tbl_student JOIN public.tbl_benutzergruppe ON (student_uid=uid)
|
||||
WHERE tbl_student.prestudent_id='".addslashes($row->prestudent_id)."'
|
||||
AND tbl_benutzergruppe.studiensemester_kurzbz='".addslashes($studiensemester_kurzbz)."'";
|
||||
$qry_1 = "
|
||||
SELECT
|
||||
gruppe_kurzbz
|
||||
FROM
|
||||
public.tbl_student
|
||||
JOIN public.tbl_benutzergruppe ON (student_uid=uid)
|
||||
WHERE
|
||||
tbl_student.prestudent_id=".$db->db_add_param($row->prestudent_id)."
|
||||
AND tbl_benutzergruppe.studiensemester_kurzbz=".$db->db_add_param($studiensemester_kurzbz);
|
||||
|
||||
if ($db->db_query($qry_1))
|
||||
{
|
||||
while($row_1 = $db->db_fetch_object())
|
||||
{
|
||||
if ($grps!='')
|
||||
$grps.=',';
|
||||
|
||||
|
||||
$grps.=$row_1->gruppe_kurzbz;
|
||||
}
|
||||
}
|
||||
@@ -507,7 +606,7 @@ function draw_content($row)
|
||||
$maxlength[$i] = mb_strlen($grps);
|
||||
$worksheet->write($zeile, $i, $grps);
|
||||
$i++;
|
||||
|
||||
|
||||
//UID
|
||||
if (isset($row->student_uid))
|
||||
{
|
||||
@@ -516,99 +615,75 @@ function draw_content($row)
|
||||
$worksheet->write($zeile, $i, $row->student_uid);
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
//Orgform
|
||||
if (mb_strlen($orgform) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($orgform);
|
||||
$worksheet->write($zeile, $i, $orgform);
|
||||
$i++;
|
||||
|
||||
|
||||
//Vornamen
|
||||
if (mb_strlen($row->vornamen) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->vornamen);
|
||||
$worksheet->write($zeile, $i, $row->vornamen);
|
||||
$i++;
|
||||
|
||||
|
||||
|
||||
|
||||
//RT_Punkte1
|
||||
if (mb_strlen($row->rt_punkte1) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->rt_punkte1);
|
||||
$worksheet->write($zeile, $i, $row->rt_punkte1);
|
||||
$i++;
|
||||
|
||||
|
||||
//RT_Punkte2
|
||||
if (mb_strlen($row->rt_punkte2) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->rt_punkte2);
|
||||
$worksheet->write($zeile, $i, $row->rt_punkte2);
|
||||
$i++;
|
||||
|
||||
|
||||
//RT_Gesamtpunkte
|
||||
if (mb_strlen($row->rt_gesamtpunkte) > $maxlength[$i])
|
||||
$maxlength[$i] = mb_strlen($row->rt_gesamtpunkte);
|
||||
$worksheet->write($zeile, $i, $row->rt_gesamtpunkte);
|
||||
$i++;
|
||||
|
||||
|
||||
// UDF
|
||||
if (isset($row->p_udf_values))
|
||||
{
|
||||
$udfPerson = json_decode($row->p_udf_values);
|
||||
if (is_object($udfPerson)) $udfPerson = (array)$udfPerson;
|
||||
|
||||
foreach($udfTitlesPerson as $udfTitle)
|
||||
|
||||
foreach ($udfTitlesPerson as $udfTitle)
|
||||
{
|
||||
if (isset($udfPerson[$udfTitle['name']]))
|
||||
$toWrite = $udf->encodeToString($udfPerson, $udfTitle);
|
||||
|
||||
if (mb_strlen($toWrite) > $maxlength[$i])
|
||||
{
|
||||
if (is_string($udfPerson[$udfTitle['name']]) || is_numeric($udfPerson[$udfTitle['name']]))
|
||||
{
|
||||
if (mb_strlen($udfPerson[$udfTitle['name']]) > $maxlength[$i])
|
||||
{
|
||||
$maxlength[$i] = mb_strlen($udfPerson[$udfTitle['name']]);
|
||||
}
|
||||
$worksheet->write($zeile, $i, $udfPerson[$udfTitle['name']]);
|
||||
}
|
||||
else if(is_array($udfPerson[$udfTitle['name']]) && isset($udfTitle['enum']))
|
||||
{
|
||||
$toWrite = $udf->dropdownListValuesToString($udfPerson[$udfTitle['name']], $udfTitle['enum']);
|
||||
|
||||
if (mb_strlen($toWrite) > $maxlength[$i])
|
||||
{
|
||||
$maxlength[$i] = mb_strlen($toWrite);
|
||||
}
|
||||
$worksheet->write($zeile, $i, $toWrite);
|
||||
}
|
||||
$maxlength[$i] = mb_strlen($toWrite);
|
||||
}
|
||||
|
||||
$worksheet->write($zeile, $i, $toWrite);
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($row->ps_udf_values))
|
||||
{
|
||||
$udfPrestudent = json_decode($row->ps_udf_values);
|
||||
if (is_object($udfPrestudent)) $udfPrestudent = (array)$udfPrestudent;
|
||||
|
||||
foreach($udfTitlesPrestudent as $udfTitle)
|
||||
|
||||
foreach ($udfTitlesPrestudent as $udfTitle)
|
||||
{
|
||||
if (isset($udfPrestudent[$udfTitle['name']]))
|
||||
$toWrite = $udf->encodeToString($udfPrestudent, $udfTitle);
|
||||
|
||||
if (mb_strlen($toWrite) > $maxlength[$i])
|
||||
{
|
||||
if (is_string($udfPrestudent[$udfTitle['name']]) || is_numeric($udfPrestudent[$udfTitle['name']]))
|
||||
{
|
||||
if (mb_strlen($udfPrestudent[$udfTitle['name']]) > $maxlength[$i])
|
||||
{
|
||||
$maxlength[$i] = mb_strlen($udfPrestudent[$udfTitle['name']]);
|
||||
}
|
||||
$worksheet->write($zeile, $i, $udfPrestudent[$udfTitle['name']]);
|
||||
}
|
||||
else if(is_array($udfPrestudent[$udfTitle['name']]) && isset($udfTitle['enum']))
|
||||
{
|
||||
$toWrite = $udf->dropdownListValuesToString($udfPrestudent[$udfTitle['name']], $udfTitle['enum']);
|
||||
|
||||
if (mb_strlen($toWrite) > $maxlength[$i])
|
||||
{
|
||||
$maxlength[$i] = mb_strlen($toWrite);
|
||||
}
|
||||
$worksheet->write($zeile, $i, $toWrite);
|
||||
}
|
||||
$maxlength[$i] = mb_strlen($toWrite);
|
||||
}
|
||||
|
||||
$worksheet->write($zeile, $i, $toWrite);
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@@ -620,4 +695,4 @@ foreach($maxlength as $i => $breite)
|
||||
|
||||
$workbook->close();
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
CSS FILES
|
||||
*****************************
|
||||
in einzubindender Reihenfolge
|
||||
Alle CSS Files im Ordner trunk/skin
|
||||
|
||||
jquery.css
|
||||
->autocomplete
|
||||
->datepicker
|
||||
|
||||
tabelsort.css
|
||||
->tablesort
|
||||
|
||||
fhcomplete.css
|
||||
|
||||
wawi/cis/fas.css
|
||||
|
||||
|
||||
JS FILES
|
||||
*****************************
|
||||
in einzubindender Reihenfolge
|
||||
Alle JS Files im Ordner trunk/include/js
|
||||
|
||||
|
||||
|
||||
// DEPRECATED NICHT MEHR VERWENDEN!
|
||||
jquery.js
|
||||
->autocomplete (Plugin Version)
|
||||
->datepicker
|
||||
->tablesorter
|
||||
->Deutsches Schema fuer datepicker
|
||||
|
||||
|
||||
|
||||
jquery1.9.min.js
|
||||
-> jqueryUI (autocomplete, datepicker, etc)
|
||||
-> Deutsches Schema für datepicker
|
||||
-> tablesorter
|
||||
|
||||
|
||||
Tablesorter
|
||||
**************
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#t1").tablesorter(
|
||||
{
|
||||
sortList: [[2,1]],
|
||||
widgets: ["zebra"]
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,828 +0,0 @@
|
||||
/*
|
||||
* BarCode Coder Library (BCC Library)
|
||||
* BCCL Version 1.0
|
||||
*
|
||||
* Porting : Jquery barcode plugin
|
||||
* Version : 1.3.3
|
||||
*
|
||||
* Date : October 17 2009
|
||||
* Author : DEMONTE Jean-Baptiste (firejocker)
|
||||
* Contact : jbdemonte @ gmail.com
|
||||
* Web site: http://barcode-coder.com/
|
||||
* dual licence : http://www.cecill.info/licences/Licence_CeCILL_V2-fr.html
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Managed :
|
||||
*
|
||||
* standard 2 of 5 (std25)
|
||||
* interleaved 2 of 5 (int25)
|
||||
* ean 8 (ean8)
|
||||
* ean 13 (ean13)
|
||||
* code 11 (code11)
|
||||
* code 39 (code39)
|
||||
* code 93 (code93)
|
||||
* code 128 (code128)
|
||||
* codabar (codabar)
|
||||
* msi (msi)
|
||||
*
|
||||
* Output :
|
||||
*
|
||||
* CSS (compatible with any browser) - To print, you must set the option in your browser "print background image"
|
||||
* SVG inline (not compatible with IE)
|
||||
* BMP inline (not compatible with IE)
|
||||
*
|
||||
*
|
||||
* 1.1 - 2009/05/26
|
||||
* -> std25 fixed
|
||||
*
|
||||
* 1.2 - 2009/09/10
|
||||
* parseInt replaced by intval (nb: parseInt("09") => 0)
|
||||
* code128 fixed (C Table analyse)
|
||||
* Thanks to Vadim for the bug reporting
|
||||
* 1.3 - 2009/09/26
|
||||
* add bmp and svg image renderer
|
||||
* 1.3.2 - 2009/10/03
|
||||
* manage int and string formated values for barcode width/height
|
||||
* 1.3.3 - 2009/10/17
|
||||
* no wait document is ready to add plugin
|
||||
*
|
||||
*/
|
||||
|
||||
$.barcode = {
|
||||
settings:{
|
||||
barWidth: 1,
|
||||
barHeight: 50,
|
||||
showHRI: true,
|
||||
marginHRI: 5,
|
||||
bgColor: "#FFFFFF",
|
||||
color: "#000000",
|
||||
fontSize: "10px",
|
||||
output: "css"
|
||||
},
|
||||
intval: function(val){
|
||||
var type = typeof( val );
|
||||
if (type == 'string'){
|
||||
val = val.replace(/[^0-9-.]/g, "");
|
||||
val = parseInt(val * 1, 10);
|
||||
if (isNaN(val) || !isFinite(val)){
|
||||
return 0;
|
||||
} else{
|
||||
return val;
|
||||
}
|
||||
} else if (type == 'number' && isFinite(val) ){
|
||||
return Math.floor(val);
|
||||
} else{
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
i25: { // std25 int25
|
||||
encoding: [ "NNWWN", "WNNNW", "NWNNW", "WWNNN", "NNWNW",
|
||||
"WNWNN", "NWWNN", "NNNWW", "WNNWN","NWNWN"],
|
||||
compute: function(code, crc, type){
|
||||
if (! crc) {
|
||||
if (code.length % 2 != 0) code = '0' + code;
|
||||
} else {
|
||||
if ( (type == "int25") && (code.length % 2 == 0) ) code = '0' + code;
|
||||
var odd = true, v, sum = 0;
|
||||
for(var i=code.length-1; i>-1; i--){
|
||||
v = $.barcode.intval(code.charAt(i));
|
||||
if (isNaN(v)) return("");
|
||||
sum += odd ? 3 * v : v;
|
||||
odd = ! odd;
|
||||
}
|
||||
code += ((10 - sum % 10) % 10).toString();
|
||||
}
|
||||
return(code);
|
||||
},
|
||||
getDigit: function(code, crc, type){
|
||||
code = this.compute(code, crc, type);
|
||||
if (code == "") return("");
|
||||
result = "";
|
||||
|
||||
var i, j;
|
||||
if (type == "int25") {
|
||||
// Interleaved 2 of 5
|
||||
|
||||
// start
|
||||
result += "1010";
|
||||
|
||||
// digits + CRC
|
||||
var c1, c2;
|
||||
for(i=0; i<code.length / 2; i++){
|
||||
c1 = code.charAt(2*i);
|
||||
c2 = code.charAt(2*i+1);
|
||||
for(j=0; j<5; j++){
|
||||
result += '1';
|
||||
if (this.encoding[c1].charAt(j) == 'W') result += '1';
|
||||
result += '0';
|
||||
if (this.encoding[c2].charAt(j) == 'W') result += '0';
|
||||
}
|
||||
}
|
||||
// stop
|
||||
result += "1101";
|
||||
} else if (type == "std25") {
|
||||
// Standard 2 of 5 is a numeric-only barcode that has been in use a long time.
|
||||
// Unlike Interleaved 2 of 5, all of the information is encoded in the bars; the spaces are fixed width and are used only to separate the bars.
|
||||
// The code is self-checking and does not include a checksum.
|
||||
|
||||
// start
|
||||
result += "11011010";
|
||||
|
||||
// digits + CRC
|
||||
var c;
|
||||
for(i=0; i<code.length; i++){
|
||||
c = code.charAt(i);
|
||||
for(j=0; j<5; j++){
|
||||
result += '1';
|
||||
if (this.encoding[c].charAt(j) == 'W') result += "11";
|
||||
result += '0';
|
||||
}
|
||||
}
|
||||
// stop
|
||||
result += "11010110";
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
},
|
||||
ean: {
|
||||
encoding: [ ["0001101", "0100111", "1110010"],
|
||||
["0011001", "0110011", "1100110"],
|
||||
["0010011", "0011011", "1101100"],
|
||||
["0111101", "0100001", "1000010"],
|
||||
["0100011", "0011101", "1011100"],
|
||||
["0110001", "0111001", "1001110"],
|
||||
["0101111", "0000101", "1010000"],
|
||||
["0111011", "0010001", "1000100"],
|
||||
["0110111", "0001001", "1001000"],
|
||||
["0001011", "0010111", "1110100"] ],
|
||||
first: ["000000","001011","001101","001110","010011","011001","011100","010101","010110","011010"],
|
||||
getDigit: function(code, type){
|
||||
// Check len (12 for ean13, 7 for ean8)
|
||||
var len = type == "ean8" ? 7 : 12;
|
||||
code = code.substring(0, len);
|
||||
if (code.length != len) return("");
|
||||
// Check each digit is numeric
|
||||
var c;
|
||||
for(var i=0; i<code.length; i++){
|
||||
c = code.charAt(i);
|
||||
if ( (c < '0') || (c > '9') ){
|
||||
return("");
|
||||
}
|
||||
}
|
||||
// get checksum
|
||||
code = this.compute(code, type);
|
||||
|
||||
// process analyse
|
||||
var result = "101"; // start
|
||||
|
||||
if (type == "ean8"){
|
||||
|
||||
// process left part
|
||||
for(var i=0; i<4; i++){
|
||||
result += this.encoding[$.barcode.intval(code.charAt(i))][0];
|
||||
}
|
||||
|
||||
// center guard bars
|
||||
result += "01010";
|
||||
|
||||
// process right part
|
||||
for(var i=4; i<8; i++){
|
||||
result += this.encoding[$.barcode.intval(code.charAt(i))][2];
|
||||
}
|
||||
|
||||
} else { // ean13
|
||||
// extract first digit and get sequence
|
||||
var seq = this.first[ $.barcode.intval(code.charAt(0)) ];
|
||||
|
||||
// process left part
|
||||
for(var i=1; i<7; i++){
|
||||
result += this.encoding[$.barcode.intval(code.charAt(i))][ $.barcode.intval(seq.charAt(i-1)) ];
|
||||
}
|
||||
|
||||
// center guard bars
|
||||
result += "01010";
|
||||
|
||||
// process right part
|
||||
for(var i=7; i<13; i++){
|
||||
result += this.encoding[$.barcode.intval(code.charAt(i))][ 2 ];
|
||||
}
|
||||
} // ean13
|
||||
|
||||
result += "101"; // stop
|
||||
return(result);
|
||||
},
|
||||
compute: function (code, type){
|
||||
var len = type == "ean13" ? 12 : 7;
|
||||
code = code.substring(0, len);
|
||||
var sum = 0, odd = true;
|
||||
for(i=code.length-1; i>-1; i--){
|
||||
sum += (odd ? 3 : 1) * $.barcode.intval(code.charAt(i));
|
||||
odd = ! odd;
|
||||
}
|
||||
return(code + ((10 - sum % 10) % 10).toString());
|
||||
}
|
||||
},
|
||||
msi: {
|
||||
encoding:[ "100100100100", "100100100110", "100100110100", "100100110110",
|
||||
"100110100100", "100110100110", "100110110100", "100110110110",
|
||||
"110100100100", "110100100110"],
|
||||
compute: function(code, crc){
|
||||
if (typeof(crc) == "object"){
|
||||
if (crc.crc1 == "mod10"){
|
||||
code = this.computeMod10(code);
|
||||
} else if (crc.crc1 == "mod11"){
|
||||
code = this.computeMod11(code);
|
||||
}
|
||||
if (crc.crc2 == "mod10"){
|
||||
code = this.computeMod10(code);
|
||||
} else if (crc.crc2 == "mod11"){
|
||||
code = this.computeMod11(code);
|
||||
}
|
||||
} else if (typeof(crc) == "boolean"){
|
||||
if (crc){
|
||||
code = this.computeMod10(code);
|
||||
}
|
||||
}
|
||||
return(code);
|
||||
},
|
||||
computeMod10:function(code){
|
||||
var i,
|
||||
toPart1 = code.length % 2;
|
||||
var n1 = 0, sum = 0;
|
||||
for(i=0; i<code.length; i++){
|
||||
if (toPart1) {
|
||||
n1 = 10 * n1 + $.barcode.intval(code.charAt(i));
|
||||
} else {
|
||||
sum += $.barcode.intval(code.charAt(i));
|
||||
}
|
||||
toPart1 = ! toPart1;
|
||||
}
|
||||
var s1 = (2 * n1).toString();
|
||||
for(i=0; i<s1.length; i++){
|
||||
sum += $.barcode.intval(s1.charAt(i));
|
||||
}
|
||||
return(code + ((10 - sum % 10) % 10).toString());
|
||||
},
|
||||
computeMod11:function(code){
|
||||
var weight = 2;
|
||||
var sum = 0, weight = 2;
|
||||
for(var i=code.length-1; i>=0; i--){
|
||||
sum += weight * $.barcode.intval(code.charAt(i));
|
||||
weight = weight == 7 ? 2 : weight + 1;
|
||||
}
|
||||
return(code + ((11 - sum % 11) % 11).toString());
|
||||
},
|
||||
getDigit: function(code, crc){
|
||||
var table = "0123456789";
|
||||
var index = 0;
|
||||
var result = "";
|
||||
|
||||
code = this.compute(code, false);
|
||||
|
||||
// start
|
||||
result = "110";
|
||||
|
||||
// digits
|
||||
for(i=0; i<code.length; i++){
|
||||
index = table.indexOf( code.charAt(i) );
|
||||
if (index < 0) return("");
|
||||
result += this.encoding[ index ];
|
||||
}
|
||||
|
||||
// stop
|
||||
result += "1001";
|
||||
|
||||
return(result);
|
||||
}
|
||||
},
|
||||
code11: {
|
||||
encoding:[ "101011", "1101011", "1001011", "1100101",
|
||||
"1011011", "1101101", "1001101", "1010011",
|
||||
"1101001", "110101", "101101"],
|
||||
getDigit: function(code){
|
||||
var table = "0123456789-";
|
||||
var i, index, result = "", intercharacter = '0'
|
||||
|
||||
// start
|
||||
result = "1011001" + intercharacter;
|
||||
|
||||
// digits
|
||||
for(i=0; i<code.length; i++){
|
||||
index = table.indexOf( code.charAt(i) );
|
||||
if (index < 0) return("");
|
||||
result += this.encoding[ index ] + intercharacter;
|
||||
}
|
||||
|
||||
// checksum
|
||||
var weightC = 0,
|
||||
weightSumC = 0,
|
||||
weightK = 1, // start at 1 because the right-most character is "C" checksum
|
||||
weightSumK = 0;
|
||||
for(i=code.length-1; i>=0; i--){
|
||||
weightC = weightC == 10 ? 1 : weightC + 1;
|
||||
weightK = weightK == 10 ? 1 : weightK + 1;
|
||||
|
||||
index = table.indexOf( code.charAt(i) );
|
||||
|
||||
weightSumC += weightC * index;
|
||||
weightSumK += weightK * index;
|
||||
}
|
||||
|
||||
var c = weightSumC % 11;
|
||||
weightSumK += c;
|
||||
var k = weightSumK % 11;
|
||||
|
||||
result += this.encoding[c] + intercharacter;
|
||||
|
||||
if (code.length >= 10){
|
||||
result += this.encoding[k] + intercharacter;
|
||||
}
|
||||
|
||||
// stop
|
||||
result += "1011001";
|
||||
|
||||
return(result);
|
||||
}
|
||||
},
|
||||
code39: {
|
||||
encoding:[ "101001101101", "110100101011", "101100101011", "110110010101",
|
||||
"101001101011", "110100110101", "101100110101", "101001011011",
|
||||
"110100101101", "101100101101", "110101001011", "101101001011",
|
||||
"110110100101", "101011001011", "110101100101", "101101100101",
|
||||
"101010011011", "110101001101", "101101001101", "101011001101",
|
||||
"110101010011", "101101010011", "110110101001", "101011010011",
|
||||
"110101101001", "101101101001", "101010110011", "110101011001",
|
||||
"101101011001", "101011011001", "110010101011", "100110101011",
|
||||
"110011010101", "100101101011", "110010110101", "100110110101",
|
||||
"100101011011", "110010101101", "100110101101", "100100100101",
|
||||
"100100101001", "100101001001", "101001001001", "100101101101"],
|
||||
getDigit: function(code){
|
||||
var table = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*";
|
||||
var i, index, result="", intercharacter='0';
|
||||
|
||||
if (code.indexOf('*') >= 0) return("");
|
||||
|
||||
// Add Start and Stop charactere : *
|
||||
code = ("*" + code + "*").toUpperCase();
|
||||
|
||||
for(i=0; i<code.length; i++){
|
||||
index = table.indexOf( code.charAt(i) );
|
||||
if (index < 0) return("");
|
||||
if (i > 0) result += intercharacter;
|
||||
result += this.encoding[ index ];
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
},
|
||||
code93:{
|
||||
encoding:[ "100010100", "101001000", "101000100", "101000010",
|
||||
"100101000", "100100100", "100100010", "101010000",
|
||||
"100010010", "100001010", "110101000", "110100100",
|
||||
"110100010", "110010100", "110010010", "110001010",
|
||||
"101101000", "101100100", "101100010", "100110100",
|
||||
"100011010", "101011000", "101001100", "101000110",
|
||||
"100101100", "100010110", "110110100", "110110010",
|
||||
"110101100", "110100110", "110010110", "110011010",
|
||||
"101101100", "101100110", "100110110", "100111010",
|
||||
"100101110", "111010100", "111010010", "111001010",
|
||||
"101101110", "101110110", "110101110", "100100110",
|
||||
"111011010", "111010110", "100110010", "101011110"],
|
||||
getDigit: function(code, crc){
|
||||
var table = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%____*", // _ => ($), (%), (/) et (+)
|
||||
c, result = "";
|
||||
|
||||
if (code.indexOf('*') >= 0) return("");
|
||||
|
||||
code = code.toUpperCase();
|
||||
|
||||
// start : *
|
||||
result += this.encoding[47];
|
||||
|
||||
// digits
|
||||
for(i=0; i<code.length; i++){
|
||||
c = code.charAt(i);
|
||||
index = table.indexOf( c );
|
||||
if ( (c == '_') || (index < 0) ) return("");
|
||||
result += this.encoding[ index ];
|
||||
}
|
||||
|
||||
// checksum
|
||||
if (crc){
|
||||
var weightC = 0,
|
||||
weightSumC = 0,
|
||||
weightK = 1, // start at 1 because the right-most character is "C" checksum
|
||||
weightSumK = 0;
|
||||
for(i=code.length-1; i>=0; i--){
|
||||
weightC = weightC == 20 ? 1 : weightC + 1;
|
||||
weightK = weightK == 15 ? 1 : weightK + 1;
|
||||
|
||||
index = table.indexOf( code.charAt(i) );
|
||||
|
||||
weightSumC += weightC * index;
|
||||
weightSumK += weightK * index;
|
||||
}
|
||||
|
||||
var c = weightSumC % 47;
|
||||
weightSumK += c;
|
||||
var k = weightSumK % 47;
|
||||
|
||||
result += this.encoding[c];
|
||||
result += this.encoding[k];
|
||||
}
|
||||
|
||||
// stop : *
|
||||
result += this.encoding[47];
|
||||
|
||||
// Terminaison bar
|
||||
result += '1';
|
||||
return(result);
|
||||
}
|
||||
|
||||
},
|
||||
code128: {
|
||||
encoding:[ "11011001100", "11001101100", "11001100110", "10010011000",
|
||||
"10010001100", "10001001100", "10011001000", "10011000100",
|
||||
"10001100100", "11001001000", "11001000100", "11000100100",
|
||||
"10110011100", "10011011100", "10011001110", "10111001100",
|
||||
"10011101100", "10011100110", "11001110010", "11001011100",
|
||||
"11001001110", "11011100100", "11001110100", "11101101110",
|
||||
"11101001100", "11100101100", "11100100110", "11101100100",
|
||||
"11100110100", "11100110010", "11011011000", "11011000110",
|
||||
"11000110110", "10100011000", "10001011000", "10001000110",
|
||||
"10110001000", "10001101000", "10001100010", "11010001000",
|
||||
"11000101000", "11000100010", "10110111000", "10110001110",
|
||||
"10001101110", "10111011000", "10111000110", "10001110110",
|
||||
"11101110110", "11010001110", "11000101110", "11011101000",
|
||||
"11011100010", "11011101110", "11101011000", "11101000110",
|
||||
"11100010110", "11101101000", "11101100010", "11100011010",
|
||||
"11101111010", "11001000010", "11110001010", "10100110000",
|
||||
"10100001100", "10010110000", "10010000110", "10000101100",
|
||||
"10000100110", "10110010000", "10110000100", "10011010000",
|
||||
"10011000010", "10000110100", "10000110010", "11000010010",
|
||||
"11001010000", "11110111010", "11000010100", "10001111010",
|
||||
"10100111100", "10010111100", "10010011110", "10111100100",
|
||||
"10011110100", "10011110010", "11110100100", "11110010100",
|
||||
"11110010010", "11011011110", "11011110110", "11110110110",
|
||||
"10101111000", "10100011110", "10001011110", "10111101000",
|
||||
"10111100010", "11110101000", "11110100010", "10111011110",
|
||||
"10111101110", "11101011110", "11110101110", "11010000100",
|
||||
"11010010000", "11010011100", "11000111010"],
|
||||
getDigit: function(code){
|
||||
var tableB = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
|
||||
var result = "";
|
||||
var sum = 0;
|
||||
var isum = 0;
|
||||
var i = 0;
|
||||
var j = 0;
|
||||
var value = 0;
|
||||
|
||||
// check each characters
|
||||
for(i=0; i<code.length; i++){
|
||||
if (tableB.indexOf(code.charAt(i)) == -1) return("");
|
||||
}
|
||||
|
||||
// check firsts characters : start with C table only if enought numeric
|
||||
var tableCActivated = code.length > 1;
|
||||
var c = '';
|
||||
for(i=0; i<3 && i<code.length; i++){
|
||||
c = code.charAt(i);
|
||||
tableCActivated &= c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
sum = tableCActivated ? 105 : 104;
|
||||
|
||||
// start : [105] : C table or [104] : B table
|
||||
result = this.encoding[ sum ];
|
||||
|
||||
i = 0;
|
||||
while( i < code.length ){
|
||||
|
||||
if (! tableCActivated){
|
||||
j = 0;
|
||||
// check next character to activate C table if interresting
|
||||
while ( (i + j < code.length) && (code.charAt(i+j) >= '0') && (code.charAt(i+j) <= '9') ) j++;
|
||||
|
||||
// 6 min everywhere or 4 mini at the end
|
||||
tableCActivated = (j > 5) || ((i + j - 1 == code.length) && (j > 3));
|
||||
|
||||
if ( tableCActivated ){
|
||||
result += this.encoding[ 99 ]; // C table
|
||||
sum += ++isum * 99;
|
||||
}
|
||||
// 2 min for table C so need table B
|
||||
} else if ( (i == code.length) || (code.charAt(i) < '0') || (code.charAt(i) > '9') || (code.charAt(i+1) < '0') || (code.charAt(i+1) > '9') ) {
|
||||
tableCActivated = false;
|
||||
result += this.encoding[ 100 ]; // B table
|
||||
sum += ++isum * 100;
|
||||
}
|
||||
|
||||
if ( tableCActivated ) {
|
||||
value = $.barcode.intval(code.charAt(i) + code.charAt(i+1)); // Add two characters (numeric)
|
||||
i += 2;
|
||||
} else {
|
||||
value = tableB.indexOf( code.charAt(i) ); // Add one character
|
||||
i += 1;
|
||||
}
|
||||
result += this.encoding[ value ];
|
||||
sum += ++isum * value;
|
||||
}
|
||||
|
||||
// Add CRC
|
||||
result += this.encoding[ sum % 103 ];
|
||||
|
||||
// Stop
|
||||
result += this.encoding[106];
|
||||
|
||||
// Termination bar
|
||||
result += "11";
|
||||
|
||||
return(result);
|
||||
}
|
||||
},
|
||||
codabar: {
|
||||
encoding:[ "101010011", "101011001", "101001011", "110010101",
|
||||
"101101001", "110101001", "100101011", "100101101",
|
||||
"100110101", "110100101", "101001101", "101100101",
|
||||
"1101011011", "1101101011", "1101101101", "1011011011",
|
||||
"1011001001", "1010010011", "1001001011", "1010011001"],
|
||||
getDigit: function(code){
|
||||
var table = "0123456789-$:/.+";
|
||||
var i, index, result="", intercharacter = '0';
|
||||
|
||||
// add start : A->D : arbitrary choose A
|
||||
result += this.encoding[16] + intercharacter;
|
||||
|
||||
for(i=0; i<code.length; i++){
|
||||
index = table.indexOf( code.charAt(i) );
|
||||
if (index < 0) return("");
|
||||
result += this.encoding[ index ] + intercharacter;
|
||||
}
|
||||
|
||||
// add stop : A->D : arbitrary choose A
|
||||
result += this.encoding[16];
|
||||
return(result);
|
||||
}
|
||||
},
|
||||
// little endian convertor
|
||||
lec:{
|
||||
// convert an int
|
||||
cInt: function(value, byteCount){
|
||||
var le = '';
|
||||
for(var i=0; i<byteCount; i++){
|
||||
le += String.fromCharCode(value & 0xFF);
|
||||
value = value >> 8;
|
||||
}
|
||||
return le;
|
||||
},
|
||||
// return a byte string from rgb values
|
||||
cRgb: function(r,g,b){
|
||||
return String.fromCharCode(b) + String.fromCharCode(g) + String.fromCharCode(r);
|
||||
},
|
||||
// return a byte string from a hex string color
|
||||
cHexColor: function(hex){
|
||||
var v = parseInt('0x' + hex.substr(1));
|
||||
var b = v & 0xFF;
|
||||
v = v >> 8;
|
||||
var g = v & 0xFF;
|
||||
var r = v >> 8;
|
||||
return(this.cRgb(r,g,b));
|
||||
}
|
||||
},
|
||||
// test if a string is a hexa string color (like #FF0000)
|
||||
isHexColor: function (value){
|
||||
var r = new RegExp("#[0-91-F]", "gi");
|
||||
return value.match(r);
|
||||
},
|
||||
// encode data in base64
|
||||
base64Encode: function(value) {
|
||||
var r = '', c1, c2, c3, b1, b2, b3, b4;
|
||||
var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
var i = 0;
|
||||
while (i < value.length) {
|
||||
c1 = value.charCodeAt(i++);
|
||||
c2 = value.charCodeAt(i++);
|
||||
c3 = value.charCodeAt(i++);
|
||||
b1 = c1 >> 2;
|
||||
b2 = ((c1 & 3) << 4) | (c2 >> 4);
|
||||
b3 = ((c2 & 15) << 2) | (c3 >> 6);
|
||||
b4 = c3 & 63;
|
||||
if (isNaN(c2)) b3 = b4 = 64;
|
||||
else if (isNaN(c3)) b4 = 64;
|
||||
r += k.charAt(b1) + k.charAt(b2) + k.charAt(b3) + k.charAt(b4);
|
||||
}
|
||||
return r;
|
||||
},
|
||||
// bmp barcode renderer
|
||||
digitToBmp: function($container, settings, digit, hri){
|
||||
var barWidth = $.barcode.intval(settings.barWidth);
|
||||
var barHeight = $.barcode.intval(settings.barHeight);
|
||||
var i = 0;
|
||||
var c0 = this.isHexColor(settings.bgColor) ? this.lec.cHexColor(settings.bgColor) : this.lec.cRgb(255,255,255);
|
||||
var c1 = this.isHexColor(settings.color) ? this.lec.cHexColor(settings.color) : this.lec.cRgb(0,0,0);
|
||||
var bar0 = '';
|
||||
var bar1 = '';
|
||||
// create one bar 0 and 1 of "barWidth" byte length
|
||||
for(i=0; i<barWidth; i++){
|
||||
bar0 += c0;
|
||||
bar1 += c1;
|
||||
}
|
||||
var bars = '';
|
||||
var width = digit.length;
|
||||
var padding = (4 - ((barWidth * width * 3) % 4)) % 4; // Padding for 4 byte alignment ("* 3" come from "3 byte to color R, G and B")
|
||||
var dataLen = (barWidth * width + padding) * barHeight;
|
||||
|
||||
// create one line of byte with padding
|
||||
for(i=0; i<digit.length; i++) bars += digit.charAt(i) == '0' ? bar0 : bar1;
|
||||
for(i=0; i<padding; i++) bars += '\0';
|
||||
|
||||
// Bitmap header
|
||||
var bmp = 'BM' + // Magic Number
|
||||
this.lec.cInt(54 + dataLen, 4) + // Size of Bitmap size (header size + data len)
|
||||
'\0\0\0\0' + // Unused
|
||||
this.lec.cInt(54, 4) + // The offset where the bitmap data (pixels) can be found
|
||||
this.lec.cInt(40, 4) + // The number of bytes in the header (from this point).
|
||||
this.lec.cInt(barWidth * width, 4) + // width
|
||||
this.lec.cInt(barHeight, 4) + // height
|
||||
this.lec.cInt(1, 2) + // Number of color planes being used
|
||||
this.lec.cInt(24, 2) + // The number of bits/pixel
|
||||
'\0\0\0\0' + // BI_RGB, No compression used
|
||||
this.lec.cInt(dataLen, 4) + // The size of the raw BMP data (after this header)
|
||||
this.lec.cInt(2835, 4) + // The horizontal resolution of the image (pixels/meter)
|
||||
this.lec.cInt(2835, 4) + // The vertical resolution of the image (pixels/meter)
|
||||
this.lec.cInt(0, 4) + // Number of colors in the palette
|
||||
this.lec.cInt(0, 4); // Means all colors are important
|
||||
// Bitmap Data : dupplicate byte line "barHeight" time
|
||||
for(i=0; i<barHeight; i++) bmp += bars;
|
||||
// set bmp image to the container
|
||||
var object = document.createElement('object');
|
||||
object.setAttribute('type', 'image/bmp');
|
||||
object.setAttribute('data', 'data:image/bmp;base64,'+ this.base64Encode(bmp));
|
||||
$container.html("").append(object);
|
||||
|
||||
},
|
||||
// css barcode renderer
|
||||
digitToCss: function($container, settings, digit, hri){
|
||||
var barWidth = $.barcode.intval(settings.barWidth);
|
||||
var barHeight = $.barcode.intval(settings.barHeight);
|
||||
var content = "";
|
||||
var bar1 = "<div style=\"float: left; background-color: " + settings.color + "; height: " + barHeight + "px; width: ";
|
||||
var bar0 = "<div style=\"float: left; background-color: " + settings.bgColor + "; height: " + barHeight + "px; width: ";
|
||||
var len = 0;
|
||||
var current = digit.charAt(0);
|
||||
for(var i=0; i<digit.length; i++){
|
||||
if (current == digit.charAt(i)) {
|
||||
len++;
|
||||
} else {
|
||||
content += (current == '0' ? bar0 : bar1) + (len * barWidth) + "px\"></div>";
|
||||
current = digit.charAt(i);
|
||||
len=1;
|
||||
}
|
||||
}
|
||||
if (len > 0){
|
||||
content += (current == '0' ? bar0 : bar1) + (len * barWidth) + "px\"></div>";
|
||||
}
|
||||
if (settings.showHRI){
|
||||
// add HRI centered
|
||||
content += "<div style=\"clear:both; width: 100%; background-color: " + settings.bgColor + "; color: " + settings.color + "; text-align: center; font-size: " + settings.fontSize + ";\">"+hri+"</div>";
|
||||
}
|
||||
// set "css" image to the container
|
||||
$container
|
||||
.css("padding", "0px")
|
||||
.css("overflow", "auto")
|
||||
.css("width", (barWidth * digit.length) + "px")
|
||||
.html(content);
|
||||
},
|
||||
// svg barcode renderer
|
||||
digitToSvg: function($container, settings, digit, hri){
|
||||
var barWidth = $.barcode.intval(settings.barWidth);
|
||||
var barHeight = $.barcode.intval(settings.barHeight);
|
||||
var width = digit.length * barWidth;
|
||||
var height = barHeight;
|
||||
var fontSize = $.barcode.intval(settings.fontSize);
|
||||
if (settings.showHRI){
|
||||
height += $.barcode.intval(settings.marginHRI) + fontSize;
|
||||
}
|
||||
// svg header
|
||||
var svg = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="' + width + '" height="' + height + '">';
|
||||
|
||||
// background
|
||||
svg += '<rect width="' + width + '" height="' + height + '" x="0" y="0" fill="' + settings.bgColor + '" />';
|
||||
|
||||
var len = 0;
|
||||
var current = digit.charAt(0);
|
||||
for(var i=0; i<digit.length; i++){
|
||||
if (current == digit.charAt(i)) {
|
||||
len++;
|
||||
} else {
|
||||
if (current == '1'){ // only draw "1" digit, "0" are in the background
|
||||
svg += '<rect width="' + (len * barWidth) + '" height="' + barHeight + '" x="' + ( (i-len) * barWidth) + '" y="0" fill="' + settings.color + '" />';
|
||||
}
|
||||
current = digit.charAt(i);
|
||||
len=1;
|
||||
}
|
||||
}
|
||||
if ( (len > 0) && (current == '1') ){
|
||||
svg += '<rect width="' + (len * barWidth) + '" height="' + barHeight + '" x="' + ((i-len) * barWidth) + '" y="0" fill="' + settings.color + '" />';
|
||||
}
|
||||
if (settings.showHRI){
|
||||
// add HRI as centered text
|
||||
svg += '<g transform="translate(' + Math.floor(width/2) + ' 0)">';
|
||||
svg += '<text y="' + height + '" text-anchor="middle" style="font-family: Arial; font-size: ' + fontSize + 'px;" fill="' + settings.color + '">' + hri + '</text>';
|
||||
svg += '</g>';
|
||||
}
|
||||
// svg footer
|
||||
svg += '</svg>';
|
||||
|
||||
// create a dom object, flush container and add object to the container
|
||||
var object = document.createElement('object');
|
||||
object.setAttribute('type', 'image/svg+xml');
|
||||
object.setAttribute('data', 'data:image/svg+xml,'+ svg);
|
||||
$container.html("").append(object);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$.fn.extend({
|
||||
barcode: function(datas, type, settings) {
|
||||
var digit = "",
|
||||
hri = "",
|
||||
code = "",
|
||||
crc = true;
|
||||
|
||||
if (typeof(datas) == "string"){
|
||||
code = datas;
|
||||
} else if (typeof(datas) == "object"){
|
||||
code = typeof(datas.code) == "string" ? datas.code : "";
|
||||
crc = typeof(datas.crc) != "undefined" ? datas.crc : true;
|
||||
}
|
||||
|
||||
if (code == "") return(false);
|
||||
|
||||
|
||||
switch(type){
|
||||
case "std25":
|
||||
case "int25":
|
||||
digit = $.barcode.i25.getDigit(code, crc, type);
|
||||
hri = $.barcode.i25.compute(code, crc, type);
|
||||
break;
|
||||
case "ean8":
|
||||
case "ean13":
|
||||
digit = $.barcode.ean.getDigit(code, type);
|
||||
hri = $.barcode.ean.compute(code, type);
|
||||
break;
|
||||
case "code11":
|
||||
digit = $.barcode.code11.getDigit(code);
|
||||
hri = code;
|
||||
break;
|
||||
case "code39":
|
||||
digit = $.barcode.code39.getDigit(code);
|
||||
hri = code;
|
||||
break;
|
||||
case "code93":
|
||||
digit = $.barcode.code93.getDigit(code, crc);
|
||||
hri = code;
|
||||
break;
|
||||
case "code128":
|
||||
digit = $.barcode.code128.getDigit(code);
|
||||
hri = code;
|
||||
break
|
||||
case "codabar":
|
||||
digit = $.barcode.codabar.getDigit(code);
|
||||
hri = code;
|
||||
break;
|
||||
case "msi":
|
||||
digit = $.barcode.msi.getDigit(code, crc);
|
||||
hri = $.barcode.msi.compute(code, crc);
|
||||
break;
|
||||
}
|
||||
if (digit.length == 0) return($(this));
|
||||
// add Quiet Zone
|
||||
digit = "0000000000" + digit + "0000000000";
|
||||
|
||||
// merge default settings with call settings
|
||||
if (settings == undefined){
|
||||
settings = [];
|
||||
}
|
||||
for(var name in $.barcode.settings){
|
||||
if (settings[name] == undefined) settings[name] = $.barcode.settings[name];
|
||||
}
|
||||
|
||||
var $this = $(this);
|
||||
|
||||
// call the god renderer
|
||||
switch(settings.output){
|
||||
case "bmp":
|
||||
$.barcode.digitToBmp($this, settings, digit, hri);
|
||||
break;
|
||||
case "svg":
|
||||
$.barcode.digitToSvg($this, settings, digit, hri);
|
||||
break;
|
||||
default:
|
||||
$.barcode.digitToCss($this, settings, digit, hri);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return($this);
|
||||
}
|
||||
});
|
||||
-15
File diff suppressed because one or more lines are too long
-1
@@ -1 +0,0 @@
|
||||
/*! checkboxes.js v1.0.7 | (c) 2013, 2016 Rubens Mariuzzo | http://github.com/rmariuzzo/checkboxes.js/LICENSE */"use strict";!function(a){var b=function(a){this.$context=a};b.prototype.check=function(){this.$context.find(":checkbox").filter(":not(:disabled)").filter(":visible").prop("checked",!0)},b.prototype.uncheck=function(){this.$context.find(":checkbox:visible").filter(":not(:disabled)").prop("checked",!1)},b.prototype.toggle=function(){this.$context.find(":checkbox:visible").filter(":not(:disabled)").each(function(){var b=a(this);b.prop("checked",!b.is(":checked"))})},b.prototype.max=function(a){if(a>0){var b=this;this.$context.on("click.checkboxes.max",":checkbox",function(){b.$context.find(":checked").length===a?b.$context.find(":checkbox:not(:checked)").prop("disabled",!0):b.$context.find(":checkbox:not(:checked)").prop("disabled",!1)})}else this.$context.off("click.checkboxes.max")},b.prototype.range=function(b){if(b){var c=this;this.$context.on("click.checkboxes.range",":checkbox",function(b){var d=a(b.target);if(b.shiftKey&&c.$last){var e=c.$context.find(":checkbox:visible"),f=e.index(c.$last),g=e.index(d),h=Math.min(f,g),i=Math.max(f,g)+1;e.slice(h,i).filter(":not(:disabled)").prop("checked",d.prop("checked"))}c.$last=d})}else this.$context.off("click.checkboxes.range")};var c=a.fn.checkboxes;a.fn.checkboxes=function(c){var d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a(this),f=e.data("checkboxes");f||e.data("checkboxes",f=new b(e,"object"==typeof c&&c)),"string"==typeof c&&f[c]&&f[c].apply(f,d)})},a.fn.checkboxes.Constructor=b,a.fn.checkboxes.noConflict=function(){return a.fn.checkboxes=c,this};var d=function(b){var c=a(b.target),d=c.attr("href"),e=a(c.data("context")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=c.data("action");e&&f&&(c.is(":checkbox")||b.preventDefault(),e.checkboxes(f))},e=function(){a("[data-toggle^=checkboxes]").each(function(){var b=a(this),c=b.data();delete c.toggle;for(var d in c)b.checkboxes(d,c[d])})};a(document).on("click.checkboxes.data-api","[data-toggle^=checkboxes]",d),a(document).on("ready.checkboxes.data-api",e)}(window.jQuery);
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
/* idTabs ~ Sean Catchpole - Version 2.2 - MIT/GPL */
|
||||
(function(){var dep={"jQuery":"http://code.jquery.com/jquery-latest.min.js"};var init=function(){(function($){$.fn.idTabs=function(){var s={};for(var i=0;i<arguments.length;++i){var a=arguments[i];switch(a.constructor){case Object:$.extend(s,a);break;case Boolean:s.change=a;break;case Number:s.start=a;break;case Function:s.click=a;break;case String:if(a.charAt(0)=='.')s.selected=a;else if(a.charAt(0)=='!')s.event=a;else s.start=a;break;}}
|
||||
if(typeof s['return']=="function")
|
||||
s.change=s['return'];return this.each(function(){$.idTabs(this,s);});}
|
||||
$.idTabs=function(tabs,options){var meta=($.metadata)?$(tabs).metadata():{};var s=$.extend({},$.idTabs.settings,meta,options);if(s.selected.charAt(0)=='.')s.selected=s.selected.substr(1);if(s.event.charAt(0)=='!')s.event=s.event.substr(1);if(s.start==null)s.start=-1;var showId=function(){if($(this).is('.'+s.selected))
|
||||
return s.change;var id="#"+this.href.split('#')[1];var aList=[];var idList=[];$("a",tabs).each(function(){if(this.href.match(/#/)){aList.push(this);idList.push("#"+this.href.split('#')[1]);}});if(s.click&&!s.click.apply(this,[id,idList,tabs,s]))return s.change;for(i in aList)$(aList[i]).removeClass(s.selected);for(i in idList)$(idList[i]).hide();$(this).addClass(s.selected);$(id).show();return s.change;}
|
||||
var list=$("a[href*='#']",tabs).unbind(s.event,showId).bind(s.event,showId);list.each(function(){$("#"+this.href.split('#')[1]).hide();});var test=false;if((test=list.filter('.'+s.selected)).length);else if(typeof s.start=="number"&&(test=list.eq(s.start)).length);else if(typeof s.start=="string"&&(test=list.filter("[href*='#"+s.start+"']")).length);if(test){test.removeClass(s.selected);test.trigger(s.event);}
|
||||
return s;}
|
||||
$.idTabs.settings={start:0,change:false,click:null,selected:".selected",event:"!click"};$.idTabs.version="2.2";$(function(){$(".idTabs").idTabs();});})(jQuery);}
|
||||
var check=function(o,s){s=s.split('.');while(o&&s.length)o=o[s.shift()];return o;}
|
||||
var head=document.getElementsByTagName("head")[0];var add=function(url){var s=document.createElement("script");s.type="text/javascript";s.src=url;head.appendChild(s);}
|
||||
var s=document.getElementsByTagName('script');var src=s[s.length-1].src;var ok=true;for(d in dep){if(check(this,d))continue;ok=false;add(dep[d]);}if(ok)return init();add(src);})();
|
||||
Vendored
-38
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* jquery.tools 1.1.2 - The missing UI library for the Web
|
||||
*
|
||||
* [tools.tabs-1.0.4, tools.tabs.slideshow-1.0.2, tools.tabs.history-1.0.2, tools.tooltip-1.1.3, tools.tooltip.slide-1.0.0, tools.tooltip.dynamic-1.0.1, tools.scrollable-1.1.2, tools.scrollable.circular-0.5.1, tools.scrollable.autoscroll-1.0.1, tools.scrollable.navigator-1.0.2, tools.scrollable.mousewheel-1.0.1, tools.overlay-1.1.2, tools.overlay.gallery-1.0.0, tools.overlay.apple-1.0.1, tools.expose-1.0.5]
|
||||
*
|
||||
* Copyright (c) 2009 Tero Piirainen
|
||||
* http://flowplayer.org/tools/
|
||||
*
|
||||
* Dual licensed under MIT and GPL 2+ licenses
|
||||
* http://www.opensource.org/licenses
|
||||
*
|
||||
* -----
|
||||
*
|
||||
* jquery.event.wheel.js - rev 1
|
||||
* Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
|
||||
* Liscensed under the MIT License (MIT-LICENSE.txt)
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* Created: 2008-07-01 | Updated: 2008-07-14
|
||||
*
|
||||
* -----
|
||||
*
|
||||
* File generated: Wed Feb 24 03:14:17 GMT 2010
|
||||
*/
|
||||
(function(d){d.tools=d.tools||{};d.tools.tabs={version:"1.0.4",conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(e,f){c[e]=f}};var c={"default":function(f,e){this.getPanes().hide().eq(f).show();e.call()},fade:function(g,e){var f=this.getConf(),j=f.fadeOutSpeed,h=this.getPanes();if(j){h.fadeOut(j)}else{h.hide()}h.eq(g).fadeIn(f.fadeInSpeed,e)},slide:function(f,e){this.getPanes().slideUp(200);this.getPanes().eq(f).slideDown(400,e)},ajax:function(f,e){this.getPanes().eq(0).load(this.getTabs().eq(f).attr("href"),e)}};var b;d.tools.tabs.addEffect("horizontal",function(f,e){if(!b){b=this.getPanes().eq(0).width()}this.getCurrentPane().animate({width:0},function(){d(this).hide()});this.getPanes().eq(f).animate({width:b},function(){d(this).show();e.call()})});function a(g,h,f){var e=this,j=d(this),i;d.each(f,function(k,l){if(d.isFunction(l)){j.bind(k,l)}});d.extend(this,{click:function(k,n){var o=e.getCurrentPane();var l=g.eq(k);if(typeof k=="string"&&k.replace("#","")){l=g.filter("[href*="+k.replace("#","")+"]");k=Math.max(g.index(l),0)}if(f.rotate){var m=g.length-1;if(k<0){return e.click(m,n)}if(k>m){return e.click(0,n)}}if(!l.length){if(i>=0){return e}k=f.initialIndex;l=g.eq(k)}if(k===i){return e}n=n||d.Event();n.type="onBeforeClick";j.trigger(n,[k]);if(n.isDefaultPrevented()){return}c[f.effect].call(e,k,function(){n.type="onClick";j.trigger(n,[k])});n.type="onStart";j.trigger(n,[k]);if(n.isDefaultPrevented()){return}i=k;g.removeClass(f.current);l.addClass(f.current);return e},getConf:function(){return f},getTabs:function(){return g},getPanes:function(){return h},getCurrentPane:function(){return h.eq(i)},getCurrentTab:function(){return g.eq(i)},getIndex:function(){return i},next:function(){return e.click(i+1)},prev:function(){return e.click(i-1)},bind:function(k,l){j.bind(k,l);return e},onBeforeClick:function(k){return this.bind("onBeforeClick",k)},onClick:function(k){return this.bind("onClick",k)},unbind:function(k){j.unbind(k);return e}});g.each(function(k){d(this).bind(f.event,function(l){e.click(k,l);return false})});if(location.hash){e.click(location.hash)}else{if(f.initialIndex===0||f.initialIndex>0){e.click(f.initialIndex)}}h.find("a[href^=#]").click(function(k){e.click(d(this).attr("href"),k)})}d.fn.tabs=function(i,f){var g=this.eq(typeof f=="number"?f:0).data("tabs");if(g){return g}if(d.isFunction(f)){f={onBeforeClick:f}}var h=d.extend({},d.tools.tabs.conf),e=this.length;f=d.extend(h,f);this.each(function(l){var j=d(this);var k=j.find(f.tabs);if(!k.length){k=j.children()}var m=i.jquery?i:j.children(i);if(!m.length){m=e==1?d(i):j.parent().find(i)}g=new a(k,m,f);j.data("tabs",g)});return f.api?g:this}})(jQuery);
|
||||
(function(b){var a=b.tools.tabs;a.plugins=a.plugins||{};a.plugins.slideshow={version:"1.0.2",conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3000,clickable:true,api:false}};b.prototype.slideshow=function(e){var f=b.extend({},a.plugins.slideshow.conf),c=this.length,d;e=b.extend(f,e);this.each(function(){var p=b(this),m=p.tabs(),i=b(m),o=m;b.each(e,function(t,u){if(b.isFunction(u)){m.bind(t,u)}});function n(t){return c==1?b(t):p.parent().find(t)}var s=n(e.next).click(function(){m.next()});var q=n(e.prev).click(function(){m.prev()});var h,j,l,g=false;b.extend(m,{play:function(){if(h){return}var t=b.Event("onBeforePlay");i.trigger(t);if(t.isDefaultPrevented()){return m}g=false;h=setInterval(m.next,e.interval);i.trigger("onPlay");m.next()},pause:function(){if(!h){return m}var t=b.Event("onBeforePause");i.trigger(t);if(t.isDefaultPrevented()){return m}h=clearInterval(h);l=clearInterval(l);i.trigger("onPause")},stop:function(){m.pause();g=true},onBeforePlay:function(t){return m.bind("onBeforePlay",t)},onPlay:function(t){return m.bind("onPlay",t)},onBeforePause:function(t){return m.bind("onBeforePause",t)},onPause:function(t){return m.bind("onPause",t)}});if(e.autopause){var k=m.getTabs().add(s).add(q).add(m.getPanes());k.hover(function(){m.pause();j=clearInterval(j)},function(){if(!g){j=setTimeout(m.play,e.interval)}})}if(e.autoplay){l=setTimeout(m.play,e.interval)}else{m.stop()}if(e.clickable){m.getPanes().click(function(){m.next()})}if(!m.getConf().rotate){var r=e.disabledClass;if(!m.getIndex()){q.addClass(r)}m.onBeforeClick(function(u,t){if(!t){q.addClass(r)}else{q.removeClass(r);if(t==m.getTabs().length-1){s.addClass(r)}else{s.removeClass(r)}}})}});return e.api?d:this}})(jQuery);
|
||||
(function(d){var a=d.tools.tabs;a.plugins=a.plugins||{};a.plugins.history={version:"1.0.2",conf:{api:false}};var e,b;function c(f){if(f){var g=b.contentWindow.document;g.open().close();g.location.hash=f}}d.fn.onHash=function(g){var f=this;if(d.browser.msie&&d.browser.version<"8"){if(!b){b=d("<iframe/>").attr("src","javascript:false;").hide().get(0);d("body").append(b);setInterval(function(){var i=b.contentWindow.document,j=i.location.hash;if(e!==j){d.event.trigger("hash",j);e=j}},100);c(location.hash||"#")}f.bind("click.hash",function(h){c(d(this).attr("href"))})}else{setInterval(function(){var j=location.hash;var i=f.filter("[href$="+j+"]");if(!i.length){j=j.replace("#","");i=f.filter("[href$="+j+"]")}if(i.length&&j!==e){e=j;d.event.trigger("hash",j)}},100)}d(window).bind("hash",g);return this};d.fn.history=function(g){var h=d.extend({},a.plugins.history.conf),f;g=d.extend(h,g);this.each(function(){var j=d(this).tabs(),i=j.getTabs();if(j){f=j}i.onHash(function(k,l){if(!l||l=="#"){l=j.getConf().initialIndex}j.click(l)});i.click(function(k){location.hash=d(this).attr("href").replace("#","")})});return g.api?f:this}})(jQuery);
|
||||
(function(c){var d=[];c.tools=c.tools||{};c.tools.tooltip={version:"1.1.3",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(e,g,f){b[e]=[g,f]}};var b={toggle:[function(e){var f=this.getConf(),g=this.getTip(),h=f.opacity;if(h<1){g.css({opacity:h})}g.show();e.call()},function(e){this.getTip().hide();e.call()}],fade:[function(e){this.getTip().fadeIn(this.getConf().fadeInSpeed,e)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};function a(f,g){var p=this,k=c(this);f.data("tooltip",p);var l=f.next();if(g.tip){l=c(g.tip);if(l.length>1){l=f.nextAll(g.tip).eq(0);if(!l.length){l=f.parent().nextAll(g.tip).eq(0)}}}function o(u){var t=g.relative?f.position().top:f.offset().top,s=g.relative?f.position().left:f.offset().left,v=g.position[0];t-=l.outerHeight()-g.offset[0];s+=f.outerWidth()+g.offset[1];var q=l.outerHeight()+f.outerHeight();if(v=="center"){t+=q/2}if(v=="bottom"){t+=q}v=g.position[1];var r=l.outerWidth()+f.outerWidth();if(v=="center"){s-=r/2}if(v=="left"){s-=r}return{top:t,left:s}}var i=f.is(":input"),e=i&&f.is(":checkbox, :radio, select, :button"),h=f.attr("type"),n=g.events[h]||g.events[i?(e?"widget":"input"):"def"];n=n.split(/,\s*/);if(n.length!=2){throw"Tooltip: bad events configuration for "+h}f.bind(n[0],function(r){if(g.oneInstance){c.each(d,function(){this.hide()})}var q=l.data("trigger");if(q&&q[0]!=this){l.hide().stop(true,true)}r.target=this;p.show(r);n=g.events.tooltip.split(/,\s*/);l.bind(n[0],function(){p.show(r)});if(n[1]){l.bind(n[1],function(){p.hide(r)})}});f.bind(n[1],function(q){p.hide(q)});if(!c.browser.msie&&!i&&!g.predelay){f.mousemove(function(){if(!p.isShown()){f.triggerHandler("mouseover")}})}if(g.opacity<1){l.css("opacity",g.opacity)}var m=0,j=f.attr("title");if(j&&g.cancelDefault){f.removeAttr("title");f.data("title",j)}c.extend(p,{show:function(r){if(r){f=c(r.target)}clearTimeout(l.data("timer"));if(l.is(":animated")||l.is(":visible")){return p}function q(){l.data("trigger",f);var t=o(r);if(g.tip&&j){l.html(f.data("title"))}r=r||c.Event();r.type="onBeforeShow";k.trigger(r,[t]);if(r.isDefaultPrevented()){return p}t=o(r);l.css({position:"absolute",top:t.top,left:t.left});var s=b[g.effect];if(!s){throw'Nonexistent effect "'+g.effect+'"'}s[0].call(p,function(){r.type="onShow";k.trigger(r)})}if(g.predelay){clearTimeout(m);m=setTimeout(q,g.predelay)}else{q()}return p},hide:function(r){clearTimeout(l.data("timer"));clearTimeout(m);if(!l.is(":visible")){return}function q(){r=r||c.Event();r.type="onBeforeHide";k.trigger(r);if(r.isDefaultPrevented()){return}b[g.effect][1].call(p,function(){r.type="onHide";k.trigger(r)})}if(g.delay&&r){l.data("timer",setTimeout(q,g.delay))}else{q()}return p},isShown:function(){return l.is(":visible, :animated")},getConf:function(){return g},getTip:function(){return l},getTrigger:function(){return f},bind:function(q,r){k.bind(q,r);return p},onHide:function(q){return this.bind("onHide",q)},onBeforeShow:function(q){return this.bind("onBeforeShow",q)},onShow:function(q){return this.bind("onShow",q)},onBeforeHide:function(q){return this.bind("onBeforeHide",q)},unbind:function(q){k.unbind(q);return p}});c.each(g,function(q,r){if(c.isFunction(r)){p.bind(q,r)}})}c.prototype.tooltip=function(e){var f=this.eq(typeof e=="number"?e:0).data("tooltip");if(f){return f}var g=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(e)){e={onBeforeShow:e}}else{if(typeof e=="string"){e={tip:e}}}e=c.extend(true,g,e);if(typeof e.position=="string"){e.position=e.position.split(/,?\s/)}if(e.lazy!==false&&(e.lazy===true||this.length>20)){this.one("mouseover",function(h){f=new a(c(this),e);f.show(h);d.push(f)})}else{this.each(function(){f=new a(c(this),e);d.push(f)})}return e.api?f:this}})(jQuery);
|
||||
(function(b){var a=b.tools.tooltip;a.effects=a.effects||{};a.effects.slide={version:"1.0.0"};b.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!b.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.tools.tooltip.addEffect("slide",function(d){var f=this.getConf(),g=this.getTip(),h=f.slideFade?{opacity:f.opacity}:{},e=c[f.direction]||c.up;h[e[1]]=e[0]+"="+f.slideOffset;if(f.slideFade){g.css({opacity:0})}g.show().animate(h,f.slideInSpeed,d)},function(e){var g=this.getConf(),i=g.slideOffset,h=g.slideFade?{opacity:0}:{},f=c[g.direction]||c.up;var d=""+f[0];if(g.bounce){d=d=="+"?"-":"+"}h[f[1]]=d+"="+i;this.getTip().animate(h,g.slideOutSpeed,function(){b(this).hide();e.call()})})})(jQuery);
|
||||
(function(d){var c=d.tools.tooltip;c.plugins=c.plugins||{};c.plugins.dynamic={version:"1.0.1",conf:{api:false,classNames:"top right bottom left"}};function b(h){var e=d(window);var g=e.width()+e.scrollLeft();var f=e.height()+e.scrollTop();return[h.offset().top<=e.scrollTop(),g<=h.offset().left+h.width(),f<=h.offset().top+h.height(),e.scrollLeft()>=h.offset().left]}function a(f){var e=f.length;while(e--){if(f[e]){return false}}return true}d.fn.dynamic=function(g){var h=d.extend({},c.plugins.dynamic.conf),f;if(typeof g=="number"){g={speed:g}}g=d.extend(h,g);var e=g.classNames.split(/\s/),i;this.each(function(){if(d(this).tooltip().jquery){throw"Lazy feature not supported by dynamic plugin. set lazy: false for tooltip"}var j=d(this).tooltip().onBeforeShow(function(n,o){var m=this.getTip(),l=this.getConf();if(!i){i=[l.position[0],l.position[1],l.offset[0],l.offset[1],d.extend({},l)]}d.extend(l,i[4]);l.position=[i[0],i[1]];l.offset=[i[2],i[3]];m.css({visibility:"hidden",position:"absolute",top:o.top,left:o.left}).show();var k=b(m);if(!a(k)){if(k[2]){d.extend(l,g.top);l.position[0]="top";m.addClass(e[0])}if(k[3]){d.extend(l,g.right);l.position[1]="right";m.addClass(e[1])}if(k[0]){d.extend(l,g.bottom);l.position[0]="bottom";m.addClass(e[2])}if(k[1]){d.extend(l,g.left);l.position[1]="left";m.addClass(e[3])}if(k[0]||k[2]){l.offset[0]*=-1}if(k[1]||k[3]){l.offset[1]*=-1}}m.css({visibility:"visible"}).hide()});j.onShow(function(){var l=this.getConf(),k=this.getTip();l.position=[i[0],i[1]];l.offset=[i[2],i[3]]});j.onHide(function(){var k=this.getTip();k.removeClass(g.classNames)});f=j});return g.api?f:this}})(jQuery);
|
||||
(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c;function a(o,m){var r=this,p=b(this),d=!m.vertical,e=o.children(),k=0,i;if(!c){c=r}b.each(m,function(s,t){if(b.isFunction(t)){p.bind(s,t)}});if(e.length>1){e=b(m.items,o)}function l(t){var s=b(t);return m.globalNav?s:o.parent().find(t)}o.data("finder",l);var f=l(m.prev),h=l(m.next),g=l(m.prevPage),n=l(m.nextPage);b.extend(r,{getIndex:function(){return k},getClickIndex:function(){var s=r.getItems();return s.index(s.filter("."+m.activeClass))},getConf:function(){return m},getSize:function(){return r.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(k/m.size)},getNaviButtons:function(){return f.add(h).add(g).add(n)},getRoot:function(){return o},getItemWrap:function(){return e},getItems:function(){return e.children(m.item)},getVisibleItems:function(){return r.getItems().slice(k,k+m.size)},seekTo:function(s,w,t){if(s<0){s=0}if(k===s){return r}if(b.isFunction(w)){t=w}if(s>r.getSize()-m.size){return m.loop?r.begin():this.end()}var u=r.getItems().eq(s);if(!u.length){return r}var v=b.Event("onBeforeSeek");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}if(w===undefined||b.isFunction(w)){w=m.speed}function x(){if(t){t.call(r,s)}p.trigger("onSeek",[s])}if(d){e.animate({left:-u.position().left},w,m.easing,x)}else{e.animate({top:-u.position().top},w,m.easing,x)}c=r;k=s;v=b.Event("onStart");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}f.add(g).toggleClass(m.disabledClass,s===0);h.add(n).toggleClass(m.disabledClass,s>=r.getSize()-m.size);return r},move:function(u,t,s){i=u>0;return this.seekTo(k+u,t,s)},next:function(t,s){return this.move(1,t,s)},prev:function(t,s){return this.move(-1,t,s)},movePage:function(w,v,u){i=w>0;var s=m.size*w;var t=k%m.size;if(t>0){s+=(w>0?-t:m.size-t)}return this.move(s,v,u)},prevPage:function(t,s){return this.movePage(-1,t,s)},nextPage:function(t,s){return this.movePage(1,t,s)},setPage:function(t,u,s){return this.seekTo(t*m.size,u,s)},begin:function(t,s){i=false;return this.seekTo(0,t,s)},end:function(t,s){i=true;var u=this.getSize()-m.size;return u>0?this.seekTo(u,t,s):r},reload:function(){p.trigger("onReload");return r},focus:function(){c=r;return r},click:function(u){var v=r.getItems().eq(u),s=m.activeClass,t=m.size;if(u<0||u>=r.getSize()){return r}if(t==1){if(m.loop){return r.next()}if(u===0||u==r.getSize()-1){i=(i===undefined)?true:!i}return i===false?r.prev():r.next()}if(t==2){if(u==k){u--}r.getItems().removeClass(s);v.addClass(s);return r.seekTo(u,time,fn)}if(!v.hasClass(s)){r.getItems().removeClass(s);v.addClass(s);var x=Math.floor(t/2);var w=u-x;if(w>r.getSize()-t){w=r.getSize()-t}if(w!==u){return r.seekTo(w)}}return r},bind:function(s,t){p.bind(s,t);return r},unbind:function(s){p.unbind(s);return r}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(s,t){r[t]=function(u){return r.bind(t,u)}});f.addClass(m.disabledClass).click(function(){r.prev()});h.click(function(){r.next()});n.click(function(){r.nextPage()});if(r.getSize()<m.size){h.add(n).addClass(m.disabledClass)}g.addClass(m.disabledClass).click(function(){r.prevPage()});var j=m.hoverClass,q="keydown."+Math.random().toString().substring(10);r.onReload(function(){if(j){r.getItems().hover(function(){b(this).addClass(j)},function(){b(this).removeClass(j)})}if(m.clickable){r.getItems().each(function(s){b(this).unbind("click.scrollable").bind("click.scrollable",function(t){if(b(t.target).is("a")){return}return r.click(s)})})}if(m.keyboard){b(document).unbind(q).bind(q,function(t){if(t.altKey||t.ctrlKey){return}if(m.keyboard!="static"&&c!=r){return}var u=m.keyboardSteps;if(d&&(t.keyCode==37||t.keyCode==39)){r.move(t.keyCode==37?-u:u);return t.preventDefault()}if(!d&&(t.keyCode==38||t.keyCode==40)){r.move(t.keyCode==38?-u:u);return t.preventDefault()}return true})}else{b(document).unbind(q)}});r.reload()}b.fn.scrollable=function(d){var e=this.eq(typeof d=="number"?d:0).data("scrollable");if(e){return e}var f=b.extend({},b.tools.scrollable.conf);d=b.extend(f,d);d.keyboardSteps=d.keyboardSteps||d.size;this.each(function(){e=new a(b(this),d);b(this).data("scrollable",e)});return d.api?e:this}})(jQuery);
|
||||
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.circular={version:"0.5.1",conf:{api:false,clonedClass:"cloned"}};b.fn.circular=function(e){var d=b.extend({},a.plugins.circular.conf),c;b.extend(d,e);this.each(function(){var i=b(this).scrollable(),n=i.getItems(),k=i.getConf(),f=i.getItemWrap(),j=0;if(i){c=i}if(n.length<k.size){return false}n.slice(0,k.size).each(function(o){b(this).clone().appendTo(f).click(function(){i.click(n.length+o)}).addClass(d.clonedClass)});var l=b.makeArray(n.slice(-k.size)).reverse();b(l).each(function(o){b(this).clone().prependTo(f).click(function(){i.click(-o-1)}).addClass(d.clonedClass)});var m=f.children(k.item);var h=k.hoverClass;if(h){m.hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)})}function g(o){var p=m.eq(o);if(k.vertical){f.css({top:-p.position().top})}else{f.css({left:-p.position().left})}}g(k.size);b.extend(i,{move:function(s,r,p,q){var u=j+s+k.size;var t=u>i.getSize()-k.size;if(u<=0||t){var o=j+k.size+(t?-n.length:n.length);g(o);u=o+s}if(q){m.removeClass(k.activeClass).eq(u+Math.floor(k.size/2)).addClass(k.activeClass)}if(u===j+k.size){return self}return i.seekTo(u,r,p)},begin:function(p,o){return this.seekTo(k.size,p,o)},end:function(p,o){return this.seekTo(n.length,p,o)},click:function(p,r,q){if(!k.clickable){return self}if(k.size==1){return this.next()}var s=p-j,o=k.activeClass;s-=Math.floor(k.size/2);return this.move(s,r,q,true)},getIndex:function(){return j},setPage:function(p,q,o){return this.seekTo(p*k.size+k.size,q,o)},getPageAmount:function(){return Math.ceil(n.length/k.size)},getPageIndex:function(){if(j<0){return this.getPageAmount()-1}if(j>=n.length){return 0}var o=(j+k.size)/k.size-1;return o},getVisibleItems:function(){var o=j+k.size;return m.slice(o,o+k.size)}});i.onStart(function(p,o){j=o-k.size;return false});i.getNaviButtons().removeClass(k.disabledClass)});return d.api?c:this}})(jQuery);
|
||||
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};b.fn.autoscroll=function(d){if(typeof d=="number"){d={interval:d}}var e=b.extend({},a.plugins.autoscroll.conf),c;b.extend(e,d);this.each(function(){var g=b(this).scrollable();if(g){c=g}var i,f,h=true;g.play=function(){if(i){return}h=false;i=setInterval(function(){g.move(e.steps)},e.interval);g.move(e.steps)};g.pause=function(){i=clearInterval(i)};g.stop=function(){g.pause();h=true};if(e.autopause){g.getRoot().add(g.getNaviButtons()).hover(function(){g.pause();clearInterval(f)},function(){if(!h){f=setTimeout(g.play,e.interval)}})}if(e.autoplay){setTimeout(g.play,e.interval)}});return e.api?c:this}})(jQuery);
|
||||
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};b.fn.navigator=function(d){var e=b.extend({},a.plugins.navigator.conf),c;if(typeof d=="string"){d={navi:d}}d=b.extend(e,d);this.each(function(){var i=b(this).scrollable(),f=i.getRoot(),l=f.data("finder").call(null,d.navi),g=null,k=i.getNaviButtons();if(i){c=i}i.getNaviButtons=function(){return k.add(l)};function j(){if(!l.children().length||l.data("navi")==i){l.empty();l.data("navi",i);for(var m=0;m<i.getPageAmount();m++){l.append(b("<"+(d.naviItem||"a")+"/>"))}g=l.children().each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()});if(d.indexed){o.text(n)}if(d.idPrefix){o.attr("id",d.idPrefix+n)}})}else{g=d.naviItem?l.find(d.naviItem):l.children();g.each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()})})}g.eq(0).addClass(d.activeClass)}i.onStart(function(o,n){var m=d.activeClass;g.removeClass(m).eq(i.getPageIndex()).addClass(m)});i.onReload(function(){j()});j();var h=g.filter("[href="+location.hash+"]");if(h.length){i.move(g.index(h))}});return d.api?c:this}})(jQuery);
|
||||
(function(b){b.fn.wheel=function(e){return this[e?"bind":"trigger"]("wheel",e)};b.event.special.wheel={setup:function(){b.event.add(this,d,c,{})},teardown:function(){b.event.remove(this,d,c)}};var d=!b.browser.mozilla?"mousewheel":"DOMMouseScroll"+(b.browser.version<"1.9"?" mousemove":"");function c(e){switch(e.type){case"mousemove":return b.extend(e.data,{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY});case"DOMMouseScroll":b.extend(e,e.data);e.delta=-e.detail/3;break;case"mousewheel":e.delta=e.wheelDelta/120;break}e.type="wheel";return b.event.handle.call(this,e,e.delta)}var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};b.fn.mousewheel=function(f){var g=b.extend({},a.plugins.mousewheel.conf),e;if(typeof f=="number"){f={speed:f}}f=b.extend(g,f);this.each(function(){var h=b(this).scrollable();if(h){e=h}h.getRoot().wheel(function(i,j){h.move(j<0?1:-1,f.speed||50);return false})});return f.api?e:this}})(jQuery);
|
||||
(function(c){c.tools=c.tools||{};c.tools.overlay={version:"1.1.2",addEffect:function(e,f,g){b[e]=[f,g]},conf:{top:"10%",left:"center",absolute:false,speed:"normal",closeSpeed:"fast",effect:"default",close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var b={};c.tools.overlay.addEffect("default",function(e){this.getOverlay().fadeIn(this.getConf().speed,e)},function(e){this.getOverlay().fadeOut(this.getConf().closeSpeed,e)});var d=[];function a(g,k){var o=this,m=c(this),n=c(window),j,i,h,e=k.expose&&c.tools.expose.version;var f=k.target||g.attr("rel");i=f?c(f):null||g;if(!i.length){throw"Could not find Overlay: "+f}if(g&&g.index(i)==-1){g.click(function(p){o.load(p);return p.preventDefault()})}c.each(k,function(p,q){if(c.isFunction(q)){m.bind(p,q)}});c.extend(o,{load:function(u){if(o.isOpened()){return o}var r=b[k.effect];if(!r){throw'Overlay: cannot find effect : "'+k.effect+'"'}if(k.oneInstance){c.each(d,function(){this.close(u)})}u=u||c.Event();u.type="onBeforeLoad";m.trigger(u);if(u.isDefaultPrevented()){return o}h=true;if(e){i.expose().load(u)}var t=k.top;var s=k.left;var p=i.outerWidth({margin:true});var q=i.outerHeight({margin:true});if(typeof t=="string"){t=t=="center"?Math.max((n.height()-q)/2,0):parseInt(t,10)/100*n.height()}if(s=="center"){s=Math.max((n.width()-p)/2,0)}if(!k.absolute){t+=n.scrollTop();s+=n.scrollLeft()}i.css({top:t,left:s,position:"absolute"});u.type="onStart";m.trigger(u);r[0].call(o,function(){if(h){u.type="onLoad";m.trigger(u)}});if(k.closeOnClick){c(document).bind("click.overlay",function(w){if(!o.isOpened()){return}var v=c(w.target);if(v.parents(i).length>1){return}c.each(d,function(){this.close(w)})})}if(k.closeOnEsc){c(document).unbind("keydown.overlay").bind("keydown.overlay",function(v){if(v.keyCode==27){c.each(d,function(){this.close(v)})}})}return o},close:function(q){if(!o.isOpened()){return o}q=q||c.Event();q.type="onBeforeClose";m.trigger(q);if(q.isDefaultPrevented()){return}h=false;b[k.effect][1].call(o,function(){q.type="onClose";m.trigger(q)});var p=true;c.each(d,function(){if(this.isOpened()){p=false}});if(p){c(document).unbind("click.overlay").unbind("keydown.overlay")}return o},getContent:function(){return i},getOverlay:function(){return i},getTrigger:function(){return g},getClosers:function(){return j},isOpened:function(){return h},getConf:function(){return k},bind:function(p,q){m.bind(p,q);return o},unbind:function(p){m.unbind(p);return o}});c.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(p,q){o[q]=function(r){return o.bind(q,r)}});if(e){if(typeof k.expose=="string"){k.expose={color:k.expose}}c.extend(k.expose,{api:true,closeOnClick:k.closeOnClick,closeOnEsc:false});var l=i.expose(k.expose);l.onBeforeClose(function(p){o.close(p)});o.onClose(function(p){l.close(p)})}j=i.find(k.close||".close");if(!j.length&&!k.close){j=c('<div class="close"></div>');i.prepend(j)}j.click(function(p){o.close(p)})}c.fn.overlay=function(e){var f=this.eq(typeof e=="number"?e:0).data("overlay");if(f){return f}if(c.isFunction(e)){e={onBeforeLoad:e}}var g=c.extend({},c.tools.overlay.conf);e=c.extend(true,g,e);this.each(function(){f=new a(c(this),e);d.push(f);c(this).data("overlay",f)});return e.api?f:this}})(jQuery);
|
||||
(function(b){var a=b.tools.overlay;a.plugins=a.plugins||{};a.plugins.gallery={version:"1.0.0",conf:{imgId:"img",next:".next",prev:".prev",info:".info",progress:".progress",disabledClass:"disabled",activeClass:"active",opacity:0.8,speed:"slow",template:"<strong>${title}</strong> <span>Image ${index} of ${total}</span>",autohide:true,preload:true,api:false}};b.fn.gallery=function(d){var o=b.extend({},a.plugins.gallery.conf),m;b.extend(o,d);m=this.overlay();var r=this,j=m.getOverlay(),k=j.find(o.next),g=j.find(o.prev),e=j.find(o.info),c=j.find(o.progress),h=g.add(k).add(e).css({opacity:o.opacity}),s=m.getClosers(),l;function p(u){c.fadeIn();h.hide();s.hide();var t=u.attr("href");var v=new Image();v.onload=function(){c.fadeOut();var y=b("#"+o.imgId,j);if(!y.length){y=b("<img/>").attr("id",o.imgId).css("visibility","hidden");j.prepend(y)}y.attr("src",t).css("visibility","hidden");var z=v.width;var A=(b(window).width()-z)/2;l=r.index(r.filter("[href="+t+"]"));r.removeClass(o.activeClass).eq(l).addClass(o.activeClass);var w=o.disabledClass;h.removeClass(w);if(l===0){g.addClass(w)}if(l==r.length-1){k.addClass(w)}var B=o.template.replace("${title}",u.attr("title")||u.data("title")).replace("${index}",l+1).replace("${total}",r.length);var x=parseInt(e.css("paddingLeft"),10)+parseInt(e.css("paddingRight"),10);e.html(B).css({width:z-x});j.animate({width:z,height:v.height,left:A},o.speed,function(){y.hide().css("visibility","visible").fadeIn(function(){if(!o.autohide){h.fadeIn();s.show()}})})};v.onerror=function(){j.fadeIn().html("Cannot find image "+t)};v.src=t;if(o.preload){r.filter(":eq("+(l-1)+"), :eq("+(l+1)+")").each(function(){var w=new Image();w.src=b(this).attr("href")})}}function f(t,u){t.click(function(){if(t.hasClass(o.disabledClass)){return}var v=r.eq(i=l+(u?1:-1));if(v.length){p(v)}})}f(k,true);f(g);b(document).keydown(function(t){if(!j.is(":visible")||t.altKey||t.ctrlKey){return}if(t.keyCode==37||t.keyCode==39){var u=t.keyCode==37?g:k;u.click();return t.preventDefault()}return true});function q(){if(!j.is(":animated")){h.show();s.show()}}if(o.autohide){j.hover(q,function(){h.fadeOut();s.hide()}).mousemove(q)}var n;this.each(function(){var v=b(this),u=b(this).overlay(),t=u;u.onBeforeLoad(function(){p(v)});u.onClose(function(){r.removeClass(o.activeClass)})});return o.api?n:this}})(jQuery);
|
||||
(function(d){var b=d.tools.overlay;b.effects=b.effects||{};b.effects.apple={version:"1.0.1"};d.extend(b.conf,{start:{absolute:true,top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function c(f){var g=f.offset();return[g.top+f.height()/2,g.left+f.width()/2]}var e=function(n){var k=this.getOverlay(),f=this.getConf(),i=this.getTrigger(),q=this,r=k.outerWidth({margin:true}),m=k.data("img");if(!m){var l=k.css("backgroundImage");if(!l){throw"background-image CSS property not set for overlay"}l=l.substring(l.indexOf("(")+1,l.indexOf(")")).replace(/\"/g,"");k.css("backgroundImage","none");m=d('<img src="'+l+'"/>');m.css({border:0,position:"absolute",display:"none"}).width(r);d("body").append(m);k.data("img",m)}var o=d(window),j=f.start.top||Math.round(o.height()/2),h=f.start.left||Math.round(o.width()/2);if(i){var g=c(i);j=g[0];h=g[1]}if(!f.start.absolute){j+=o.scrollTop();h+=o.scrollLeft()}m.css({top:j,left:h,width:0,zIndex:f.zIndex}).show();m.animate({top:k.css("top"),left:k.css("left"),width:r},f.speed,function(){k.css("zIndex",f.zIndex+1).fadeIn(f.fadeInSpeed,function(){if(q.isOpened()&&!d(this).index(k)){n.call()}else{k.hide()}})})};var a=function(f){var h=this.getOverlay(),i=this.getConf(),g=this.getTrigger(),l=i.start.top,k=i.start.left;h.hide();if(g){var j=c(g);l=j[0];k=j[1]}h.data("img").animate({top:l,left:k,width:0},i.closeSpeed,f)};b.addEffect("apple",e,a)})(jQuery);
|
||||
(function(b){b.tools=b.tools||{};b.tools.expose={version:"1.0.5",conf:{maskId:null,loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,color:"#456",api:false}};function a(){if(b.browser.msie){var f=b(document).height(),e=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f-e<20?e:f]}return[b(window).width(),b(document).height()]}function c(h,g){var e=this,j=b(this),d=null,f=false,i=0;b.each(g,function(k,l){if(b.isFunction(l)){j.bind(k,l)}});b(window).resize(function(){e.fit()});b.extend(this,{getMask:function(){return d},getExposed:function(){return h},getConf:function(){return g},isLoaded:function(){return f},load:function(n){if(f){return e}i=h.eq(0).css("zIndex");if(g.maskId){d=b("#"+g.maskId)}if(!d||!d.length){var l=a();d=b("<div/>").css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:0,zIndex:g.zIndex});if(g.maskId){d.attr("id",g.maskId)}b("body").append(d);var k=d.css("backgroundColor");if(!k||k=="transparent"||k=="rgba(0, 0, 0, 0)"){d.css("backgroundColor",g.color)}if(g.closeOnEsc){b(document).bind("keydown.unexpose",function(o){if(o.keyCode==27){e.close()}})}if(g.closeOnClick){d.bind("click.unexpose",function(o){e.close(o)})}}n=n||b.Event();n.type="onBeforeLoad";j.trigger(n);if(n.isDefaultPrevented()){return e}b.each(h,function(){var o=b(this);if(!/relative|absolute|fixed/i.test(o.css("position"))){o.css("position","relative")}});h.css({zIndex:Math.max(g.zIndex+1,i=="auto"?0:i)});var m=d.height();if(!this.isLoaded()){d.css({opacity:0,display:"block"}).fadeTo(g.loadSpeed,g.opacity,function(){if(d.height()!=m){d.css("height",m)}n.type="onLoad";j.trigger(n)})}f=true;return e},close:function(k){if(!f){return e}k=k||b.Event();k.type="onBeforeClose";j.trigger(k);if(k.isDefaultPrevented()){return e}d.fadeOut(g.closeSpeed,function(){k.type="onClose";j.trigger(k);h.css({zIndex:b.browser.msie?i:null})});f=false;return e},fit:function(){if(d){var k=a();d.css({width:k[0],height:k[1]})}},bind:function(k,l){j.bind(k,l);return e},unbind:function(k){j.unbind(k);return e}});b.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","),function(k,l){e[l]=function(m){return e.bind(l,m)}})}b.fn.expose=function(d){var e=this.eq(typeof d=="number"?d:0).data("expose");if(e){return e}if(typeof d=="string"){d={color:d}}var f=b.extend({},b.tools.expose.conf);d=b.extend(f,d);this.each(function(){e=new c(b(this),d);b(this).data("expose",e)});return d.api?e:this}})(jQuery);
|
||||
@@ -1,493 +0,0 @@
|
||||
/*
|
||||
SortTable
|
||||
version 2
|
||||
7th April 2007
|
||||
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
|
||||
|
||||
Instructions:
|
||||
Download this file
|
||||
Add <script src="sorttable.js"></script> to your HTML
|
||||
Add class="sortable" to any table you'd like to make sortable
|
||||
Click on the headers to sort
|
||||
|
||||
Thanks to many, many people for contributions and suggestions.
|
||||
Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
|
||||
This basically means: do what you want with it.
|
||||
*/
|
||||
|
||||
|
||||
var stIsIE = /*@cc_on!@*/false;
|
||||
|
||||
sorttable = {
|
||||
init: function() {
|
||||
// quit if this function has already been called
|
||||
if (arguments.callee.done) return;
|
||||
// flag this function so we don't do the same thing twice
|
||||
arguments.callee.done = true;
|
||||
// kill the timer
|
||||
if (_timer) clearInterval(_timer);
|
||||
|
||||
if (!document.createElement || !document.getElementsByTagName) return;
|
||||
|
||||
sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
|
||||
|
||||
forEach(document.getElementsByTagName('table'), function(table) {
|
||||
if (table.className.search(/\bsortable\b/) != -1) {
|
||||
sorttable.makeSortable(table);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
makeSortable: function(table) {
|
||||
if (table.getElementsByTagName('thead').length == 0) {
|
||||
// table doesn't have a tHead. Since it should have, create one and
|
||||
// put the first table row in it.
|
||||
the = document.createElement('thead');
|
||||
the.appendChild(table.rows[0]);
|
||||
table.insertBefore(the,table.firstChild);
|
||||
}
|
||||
// Safari doesn't support table.tHead, sigh
|
||||
if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
|
||||
|
||||
if (table.tHead.rows.length != 1) return; // can't cope with two header rows
|
||||
|
||||
// Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
|
||||
// "total" rows, for example). This is B&R, since what you're supposed
|
||||
// to do is put them in a tfoot. So, if there are sortbottom rows,
|
||||
// for backwards compatibility, move them to tfoot (creating it if needed).
|
||||
sortbottomrows = [];
|
||||
for (var i=0; i<table.rows.length; i++) {
|
||||
if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
|
||||
sortbottomrows[sortbottomrows.length] = table.rows[i];
|
||||
}
|
||||
}
|
||||
if (sortbottomrows) {
|
||||
if (table.tFoot == null) {
|
||||
// table doesn't have a tfoot. Create one.
|
||||
tfo = document.createElement('tfoot');
|
||||
table.appendChild(tfo);
|
||||
}
|
||||
for (var i=0; i<sortbottomrows.length; i++) {
|
||||
tfo.appendChild(sortbottomrows[i]);
|
||||
}
|
||||
delete sortbottomrows;
|
||||
}
|
||||
|
||||
// work through each column and calculate its type
|
||||
headrow = table.tHead.rows[0].cells;
|
||||
for (var i=0; i<headrow.length; i++) {
|
||||
// manually override the type with a sorttable_type attribute
|
||||
if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
|
||||
mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
|
||||
if (mtch) { override = mtch[1]; }
|
||||
if (mtch && typeof sorttable["sort_"+override] == 'function') {
|
||||
headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
|
||||
} else {
|
||||
headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
|
||||
}
|
||||
// make it clickable to sort
|
||||
headrow[i].sorttable_columnindex = i;
|
||||
headrow[i].sorttable_tbody = table.tBodies[0];
|
||||
dean_addEvent(headrow[i],"click", function(e) {
|
||||
|
||||
if (this.className.search(/\bsorttable_sorted\b/) != -1) {
|
||||
// if we're already sorted by this column, just
|
||||
// reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted',
|
||||
'sorttable_sorted_reverse');
|
||||
this.removeChild(document.getElementById('sorttable_sortfwdind'));
|
||||
sortrevind = document.createElement('span');
|
||||
sortrevind.id = "sorttable_sortrevind";
|
||||
sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴';
|
||||
this.appendChild(sortrevind);
|
||||
return;
|
||||
}
|
||||
if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
|
||||
// if we're already sorted by this column in reverse, just
|
||||
// re-reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted_reverse',
|
||||
'sorttable_sorted');
|
||||
this.removeChild(document.getElementById('sorttable_sortrevind'));
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
|
||||
this.appendChild(sortfwdind);
|
||||
return;
|
||||
}
|
||||
|
||||
// remove sorttable_sorted classes
|
||||
theadrow = this.parentNode;
|
||||
forEach(theadrow.childNodes, function(cell) {
|
||||
if (cell.nodeType == 1) { // an element
|
||||
cell.className = cell.className.replace('sorttable_sorted_reverse','');
|
||||
cell.className = cell.className.replace('sorttable_sorted','');
|
||||
}
|
||||
});
|
||||
sortfwdind = document.getElementById('sorttable_sortfwdind');
|
||||
if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
|
||||
sortrevind = document.getElementById('sorttable_sortrevind');
|
||||
if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
|
||||
|
||||
this.className += ' sorttable_sorted';
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
|
||||
this.appendChild(sortfwdind);
|
||||
|
||||
// build an array to sort. This is a Schwartzian transform thing,
|
||||
// i.e., we "decorate" each row with the actual sort key,
|
||||
// sort based on the sort keys, and then put the rows back in order
|
||||
// which is a lot faster because you only do getInnerText once per row
|
||||
row_array = [];
|
||||
col = this.sorttable_columnindex;
|
||||
rows = this.sorttable_tbody.rows;
|
||||
for (var j=0; j<rows.length; j++) {
|
||||
row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
|
||||
}
|
||||
/* If you want a stable sort, uncomment the following line */
|
||||
//sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
|
||||
/* and comment out this one */
|
||||
row_array.sort(this.sorttable_sortfunction);
|
||||
|
||||
tb = this.sorttable_tbody;
|
||||
for (var j=0; j<row_array.length; j++) {
|
||||
tb.appendChild(row_array[j][1]);
|
||||
}
|
||||
|
||||
delete row_array;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
guessType: function(table, column) {
|
||||
// guess the type of a column based on its first non-blank row
|
||||
sortfn = sorttable.sort_alpha;
|
||||
for (var i=0; i<table.tBodies[0].rows.length; i++) {
|
||||
text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
|
||||
if (text != '') {
|
||||
if (text.match(/^-?[£$¤]?[\d,.]+%?$/)) {
|
||||
return sorttable.sort_numeric;
|
||||
}
|
||||
// check for a date: dd/mm/yyyy or dd/mm/yy
|
||||
// can have / or . or - as separator
|
||||
// can be mm/dd as well
|
||||
possdate = text.match(sorttable.DATE_RE)
|
||||
if (possdate) {
|
||||
// looks like a date
|
||||
first = parseInt(possdate[1]);
|
||||
second = parseInt(possdate[2]);
|
||||
if (first > 12) {
|
||||
// definitely dd/mm
|
||||
return sorttable.sort_ddmm;
|
||||
} else if (second > 12) {
|
||||
return sorttable.sort_mmdd;
|
||||
} else {
|
||||
// looks like a date, but we can't tell which, so assume
|
||||
// that it's dd/mm (English imperialism!) and keep looking
|
||||
sortfn = sorttable.sort_ddmm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sortfn;
|
||||
},
|
||||
|
||||
getInnerText: function(node) {
|
||||
// gets the text we want to use for sorting for a cell.
|
||||
// strips leading and trailing whitespace.
|
||||
// this is *not* a generic getInnerText function; it's special to sorttable.
|
||||
// for example, you can override the cell text with a customkey attribute.
|
||||
// it also gets .value for <input> fields.
|
||||
|
||||
hasInputs = (typeof node.getElementsByTagName == 'function') &&
|
||||
node.getElementsByTagName('input').length;
|
||||
|
||||
if (node.getAttribute("sorttable_customkey") != null) {
|
||||
return node.getAttribute("sorttable_customkey");
|
||||
}
|
||||
else if (typeof node.textContent != 'undefined' && !hasInputs) {
|
||||
return node.textContent.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else if (typeof node.innerText != 'undefined' && !hasInputs) {
|
||||
return node.innerText.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else if (typeof node.text != 'undefined' && !hasInputs) {
|
||||
return node.text.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else {
|
||||
switch (node.nodeType) {
|
||||
case 3:
|
||||
if (node.nodeName.toLowerCase() == 'input') {
|
||||
return node.value.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
case 4:
|
||||
return node.nodeValue.replace(/^\s+|\s+$/g, '');
|
||||
break;
|
||||
case 1:
|
||||
case 11:
|
||||
var innerText = '';
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
innerText += sorttable.getInnerText(node.childNodes[i]);
|
||||
}
|
||||
return innerText.replace(/^\s+|\s+$/g, '');
|
||||
break;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
reverse: function(tbody) {
|
||||
// reverse the rows in a tbody
|
||||
newrows = [];
|
||||
for (var i=0; i<tbody.rows.length; i++) {
|
||||
newrows[newrows.length] = tbody.rows[i];
|
||||
}
|
||||
for (var i=newrows.length-1; i>=0; i--) {
|
||||
tbody.appendChild(newrows[i]);
|
||||
}
|
||||
delete newrows;
|
||||
},
|
||||
|
||||
/* sort functions
|
||||
each sort function takes two parameters, a and b
|
||||
you are comparing a[0] and b[0] */
|
||||
sort_numeric: function(a,b) {
|
||||
aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
|
||||
if (isNaN(aa)) aa = 0;
|
||||
bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
|
||||
if (isNaN(bb)) bb = 0;
|
||||
return aa-bb;
|
||||
},
|
||||
sort_alpha: function(a,b) {
|
||||
if (a[0]==b[0]) return 0;
|
||||
if (a[0]<b[0]) return -1;
|
||||
return 1;
|
||||
},
|
||||
sort_ddmm: function(a,b) {
|
||||
mtch = a[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; m = mtch[2]; d = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt1 = y+m+d;
|
||||
mtch = b[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; m = mtch[2]; d = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt2 = y+m+d;
|
||||
if (dt1==dt2) return 0;
|
||||
if (dt1<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
sort_mmdd: function(a,b) {
|
||||
mtch = a[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; d = mtch[2]; m = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt1 = y+m+d;
|
||||
mtch = b[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; d = mtch[2]; m = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt2 = y+m+d;
|
||||
if (dt1==dt2) return 0;
|
||||
if (dt1<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
|
||||
shaker_sort: function(list, comp_func) {
|
||||
// A stable sort function to allow multi-level sorting of data
|
||||
// see: http://en.wikipedia.org/wiki/Cocktail_sort
|
||||
// thanks to Joseph Nahmias
|
||||
var b = 0;
|
||||
var t = list.length - 1;
|
||||
var swap = true;
|
||||
|
||||
while(swap) {
|
||||
swap = false;
|
||||
for(var i = b; i < t; ++i) {
|
||||
if ( comp_func(list[i], list[i+1]) > 0 ) {
|
||||
var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
|
||||
swap = true;
|
||||
}
|
||||
} // for
|
||||
t--;
|
||||
|
||||
if (!swap) break;
|
||||
|
||||
for(var i = t; i > b; --i) {
|
||||
if ( comp_func(list[i], list[i-1]) < 0 ) {
|
||||
var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
|
||||
swap = true;
|
||||
}
|
||||
} // for
|
||||
b++;
|
||||
|
||||
} // while(swap)
|
||||
}
|
||||
}
|
||||
|
||||
/* ******************************************************************
|
||||
Supporting functions: bundled here to avoid depending on a library
|
||||
****************************************************************** */
|
||||
|
||||
// Dean Edwards/Matthias Miller/John Resig
|
||||
|
||||
/* for Mozilla/Opera9 */
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("DOMContentLoaded", sorttable.init, false);
|
||||
}
|
||||
|
||||
/* for Internet Explorer */
|
||||
/*@cc_on @*/
|
||||
/*@if (@_win32)
|
||||
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
|
||||
var script = document.getElementById("__ie_onload");
|
||||
script.onreadystatechange = function() {
|
||||
if (this.readyState == "complete") {
|
||||
sorttable.init(); // call the onload handler
|
||||
}
|
||||
};
|
||||
/*@end @*/
|
||||
|
||||
/* for Safari */
|
||||
if (/WebKit/i.test(navigator.userAgent)) { // sniff
|
||||
var _timer = setInterval(function() {
|
||||
if (/loaded|complete/.test(document.readyState)) {
|
||||
sorttable.init(); // call the onload handler
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
|
||||
/* for other browsers */
|
||||
window.onload = sorttable.init;
|
||||
|
||||
// written by Dean Edwards, 2005
|
||||
// with input from Tino Zijdel, Matthias Miller, Diego Perini
|
||||
|
||||
// http://dean.edwards.name/weblog/2005/10/add-event/
|
||||
|
||||
function dean_addEvent(element, type, handler) {
|
||||
if (element.addEventListener) {
|
||||
element.addEventListener(type, handler, false);
|
||||
} else {
|
||||
// assign each event handler a unique ID
|
||||
if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
|
||||
// create a hash table of event types for the element
|
||||
if (!element.events) element.events = {};
|
||||
// create a hash table of event handlers for each element/event pair
|
||||
var handlers = element.events[type];
|
||||
if (!handlers) {
|
||||
handlers = element.events[type] = {};
|
||||
// store the existing event handler (if there is one)
|
||||
if (element["on" + type]) {
|
||||
handlers[0] = element["on" + type];
|
||||
}
|
||||
}
|
||||
// store the event handler in the hash table
|
||||
handlers[handler.$$guid] = handler;
|
||||
// assign a global event handler to do all the work
|
||||
element["on" + type] = handleEvent;
|
||||
}
|
||||
};
|
||||
// a counter used to create unique IDs
|
||||
dean_addEvent.guid = 1;
|
||||
|
||||
function removeEvent(element, type, handler) {
|
||||
if (element.removeEventListener) {
|
||||
element.removeEventListener(type, handler, false);
|
||||
} else {
|
||||
// delete the event handler from the hash table
|
||||
if (element.events && element.events[type]) {
|
||||
delete element.events[type][handler.$$guid];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function handleEvent(event) {
|
||||
var returnValue = true;
|
||||
// grab the event object (IE uses a global event object)
|
||||
event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
|
||||
// get a reference to the hash table of event handlers
|
||||
var handlers = this.events[event.type];
|
||||
// execute each event handler
|
||||
for (var i in handlers) {
|
||||
this.$$handleEvent = handlers[i];
|
||||
if (this.$$handleEvent(event) === false) {
|
||||
returnValue = false;
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
function fixEvent(event) {
|
||||
// add W3C standard event methods
|
||||
event.preventDefault = fixEvent.preventDefault;
|
||||
event.stopPropagation = fixEvent.stopPropagation;
|
||||
return event;
|
||||
};
|
||||
fixEvent.preventDefault = function() {
|
||||
this.returnValue = false;
|
||||
};
|
||||
fixEvent.stopPropagation = function() {
|
||||
this.cancelBubble = true;
|
||||
}
|
||||
|
||||
// Dean's forEach: http://dean.edwards.name/base/forEach.js
|
||||
/*
|
||||
forEach, version 1.0
|
||||
Copyright 2006, Dean Edwards
|
||||
License: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
// array-like enumeration
|
||||
if (!Array.forEach) { // mozilla already supports this
|
||||
Array.forEach = function(array, block, context) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
block.call(context, array[i], i, array);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// generic enumeration
|
||||
Function.prototype.forEach = function(object, block, context) {
|
||||
for (var key in object) {
|
||||
if (typeof this.prototype[key] == "undefined") {
|
||||
block.call(context, object[key], key, object);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// character enumeration
|
||||
String.forEach = function(string, block, context) {
|
||||
Array.forEach(string.split(""), function(chr, index) {
|
||||
block.call(context, chr, index, string);
|
||||
});
|
||||
};
|
||||
|
||||
// globally resolve forEach enumeration
|
||||
var forEach = function(object, block, context) {
|
||||
if (object) {
|
||||
var resolve = Object; // default
|
||||
if (object instanceof Function) {
|
||||
// functions have a "length" property
|
||||
resolve = Function;
|
||||
} else if (object.forEach instanceof Function) {
|
||||
// the object implements a custom forEach method so use that
|
||||
object.forEach(block, context);
|
||||
return;
|
||||
} else if (typeof object == "string") {
|
||||
// the object is a string
|
||||
resolve = String;
|
||||
} else if (typeof object.length == "number") {
|
||||
// the object is array-like
|
||||
resolve = Array;
|
||||
}
|
||||
resolve.forEach(object, block, context);
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
-1
File diff suppressed because one or more lines are too long
@@ -516,7 +516,7 @@ class lehrstunde extends basis_db
|
||||
}
|
||||
|
||||
// Reservierungsdaten ermitteln
|
||||
if ($type!='idList' && $type!='fachbereich')
|
||||
if ($type!='idList' && $type!='fachbereich' && $type!='lva')
|
||||
{
|
||||
// Datenbankabfrage generieren
|
||||
$sql_query_reservierung='SELECT * FROM campus.vw_reservierung';
|
||||
|
||||
@@ -647,25 +647,25 @@ class mitarbeiter extends benutzer
|
||||
{
|
||||
$hasUDF = false;
|
||||
$udf = new UDF();
|
||||
|
||||
|
||||
$qry = "SELECT DISTINCT ON(mitarbeiter_uid) *,
|
||||
tbl_benutzer.aktiv as aktiv,
|
||||
tbl_mitarbeiter.insertamum,
|
||||
tbl_mitarbeiter.insertvon,
|
||||
tbl_mitarbeiter.updateamum,
|
||||
tbl_mitarbeiter.updatevon";
|
||||
|
||||
|
||||
if ($hasUDF = $udf->personHasUDF())
|
||||
{
|
||||
$qry .= ", public.tbl_person.udf_values AS p_udf_values";
|
||||
}
|
||||
|
||||
|
||||
$qry .= " FROM ((public.tbl_mitarbeiter JOIN public.tbl_benutzer ON(mitarbeiter_uid=uid))
|
||||
JOIN public.tbl_person USING(person_id))
|
||||
LEFT JOIN public.tbl_benutzerfunktion USING(uid)
|
||||
LEFT JOIN campus.tbl_resturlaub USING(mitarbeiter_uid)
|
||||
WHERE true";
|
||||
|
||||
|
||||
if($fix=='true')
|
||||
$qry .= " AND fixangestellt=true";
|
||||
if($fix=='false')
|
||||
@@ -740,7 +740,7 @@ class mitarbeiter extends benutzer
|
||||
|
||||
|
||||
$qry.=';';
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
@@ -793,7 +793,7 @@ class mitarbeiter extends benutzer
|
||||
{
|
||||
$obj->p_udf_values = $row->p_udf_values;
|
||||
}
|
||||
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
@@ -1324,5 +1324,102 @@ class mitarbeiter extends benutzer
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Mitarbeiter die uebergeben werden
|
||||
*
|
||||
* @param $uid_arr
|
||||
* @return boolean
|
||||
*/
|
||||
public function getMitarbeiterArray($uid_arr)
|
||||
{
|
||||
if(count($uid_arr)==0)
|
||||
return true;
|
||||
|
||||
$hasUDF = false;
|
||||
$udf = new UDF();
|
||||
|
||||
$qry = "SELECT DISTINCT ON(mitarbeiter_uid) *,
|
||||
tbl_benutzer.aktiv as aktiv,
|
||||
tbl_mitarbeiter.insertamum,
|
||||
tbl_mitarbeiter.insertvon,
|
||||
tbl_mitarbeiter.updateamum,
|
||||
tbl_mitarbeiter.updatevon";
|
||||
|
||||
if ($hasUDF = $udf->personHasUDF())
|
||||
{
|
||||
$qry .= ", public.tbl_person.udf_values AS p_udf_values";
|
||||
}
|
||||
|
||||
$qry .= " FROM ((public.tbl_mitarbeiter JOIN public.tbl_benutzer ON(mitarbeiter_uid=uid))
|
||||
JOIN public.tbl_person USING(person_id))
|
||||
LEFT JOIN public.tbl_benutzerfunktion USING(uid)
|
||||
LEFT JOIN campus.tbl_resturlaub USING(mitarbeiter_uid)
|
||||
WHERE uid in(".$this->db_implode4SQL($uid_arr).")";;
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new mitarbeiter();
|
||||
|
||||
$obj->person_id = $row->person_id;
|
||||
$obj->staatsbuergerschaft = $row->staatsbuergerschaft;
|
||||
$obj->geburtsnation = $row->geburtsnation;
|
||||
$obj->sprache = $row->sprache;
|
||||
$obj->anrede = $row->anrede;
|
||||
$obj->titelpost = $row->titelpost;
|
||||
$obj->titelpre = $row->titelpre;
|
||||
$obj->nachname = $row->nachname;
|
||||
$obj->vorname = $row->vorname;
|
||||
$obj->vornamen = $row->vornamen;
|
||||
$obj->gebdatum = $row->gebdatum;
|
||||
$obj->gebort = $row->gebort;
|
||||
$obj->gebzeit = $row->gebzeit;
|
||||
$obj->anmerkung = $row->anmerkung;
|
||||
$obj->homepage = $row->homepage;
|
||||
$obj->svnr = $row->svnr;
|
||||
$obj->ersatzkennzeichen = $row->ersatzkennzeichen;
|
||||
$obj->familienstand = $row->familienstand;
|
||||
$obj->geschlecht = $row->geschlecht;
|
||||
$obj->anzahlkinder = $row->anzahlkinder;
|
||||
$obj->bnaktiv = $this->db_parse_bool($row->aktiv);
|
||||
$obj->uid = $row->uid;
|
||||
$obj->personalnummer = $row->personalnummer;
|
||||
$obj->telefonklappe = $row->telefonklappe;
|
||||
$obj->kurzbz = $row->kurzbz;
|
||||
$obj->lektor = $this->db_parse_bool($row->lektor);
|
||||
$obj->fixangestellt = $this->db_parse_bool($row->fixangestellt);
|
||||
$obj->bismelden = $this->db_parse_bool($row->bismelden);
|
||||
$obj->stundensatz = $row->stundensatz;
|
||||
$obj->ausbildungcode = $row->ausbildungcode;
|
||||
$obj->ort_kurzbz = $row->ort_kurzbz;
|
||||
$obj->standort_id = $row->standort_id;
|
||||
$obj->anmerkung = $row->anmerkung;
|
||||
$obj->alias = $row->alias;
|
||||
$obj->insertamum = $row->insertamum;
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
|
||||
$obj->urlaubstageprojahr = $row->urlaubstageprojahr;
|
||||
$obj->resturlaubstage = $row->resturlaubstage;
|
||||
|
||||
if ($hasUDF)
|
||||
{
|
||||
$obj->p_udf_values = $row->p_udf_values;
|
||||
}
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -386,7 +386,7 @@ class prestudent extends person
|
||||
tbl_reihungstest.datum='.$this->db_add_param($datum).'
|
||||
AND tbl_rt_person.studienplan_id IN (SELECT studienplan_id FROM public.tbl_prestudentstatus WHERE prestudent_id=tbl_prestudent.prestudent_id)
|
||||
AND EXISTS(SELECT * FROM public.tbl_prestudentstatus JOIN public.tbl_studiensemester USING(studiensemester_kurzbz)
|
||||
WHERE prestudent_id=tbl_prestudent.prestudent_id AND tbl_studiensemester.start>'.$this->db_add_param($datum).')
|
||||
WHERE prestudent_id=tbl_prestudent.prestudent_id AND tbl_studiensemester.ende>'.$this->db_add_param($datum).')
|
||||
) a
|
||||
ORDER BY nachname,vorname';
|
||||
|
||||
@@ -969,7 +969,9 @@ class prestudent extends person
|
||||
|
||||
$qry = 'UPDATE public.tbl_prestudentstatus SET'.
|
||||
' bestaetigtam='.$this->db_add_param(date('Y-m-d')).','.
|
||||
' bestaetigtvon='.$this->db_add_param($user)." ".
|
||||
' bestaetigtvon='.$this->db_add_param($user).", ".
|
||||
' updateamum='.$this->db_add_param(date('Y-m-d H:i:s')).','.
|
||||
' updatevon='.$this->db_add_param($user)." ".
|
||||
' WHERE
|
||||
prestudent_id='.$this->db_add_param($prestudent_id, FHC_INTEGER).'
|
||||
AND status_kurzbz='.$this->db_add_param($status_kurzbz).'
|
||||
|
||||
@@ -144,7 +144,7 @@ function checkZeilenUmbruch()
|
||||
|
||||
$text.= ' <a class="Item" href="semdownhlp.php" >';
|
||||
$text.= $p->t('lehre/semesterplanVorlage');
|
||||
$text.= ' [hml]';
|
||||
$text.= ' [html]';
|
||||
$text.= '</a>';
|
||||
$text.= ' <a class="Item" href="semdownhlp.php?format=doc" >';
|
||||
$text.= '[doc]';
|
||||
|
||||
@@ -168,10 +168,10 @@ $menu=array
|
||||
'Kartenverwaltung'=>array('name'=>'Kartenverwaltung','link'=>'fhausweis/kartenverwaltung.php','target'=>'main'),
|
||||
'KarteZuweisen'=>array('name'=>'Karte zuweisen','link'=>'fhausweis/kartezuweisen.php','target'=>'main'),
|
||||
'Kartentausch'=>array('name'=>'Kartentausch','link'=>'fhausweis/kartentausch.php','target'=>'main'),
|
||||
'Kartenausgabe'=>array('name'=>'Kartenausgabe','link'=>'fhausweis/kartenausgabe.php','target'=>'main'),
|
||||
'Verlaengerung'=>array('name'=>'Verlängerung','link'=>'fhausweis/verlaengerung.php','target'=>'main'),
|
||||
'Suche'=>array('name'=>'Suche','link'=>'fhausweis/search.php','target'=>'main'),
|
||||
'Synchronisation'=>array('name'=>'Syncronisation', 'link'=>'stammdaten/imexport/zutrittskarten/index.html', 'target'=>'main'),
|
||||
'Korrektur'=>array('name'=>'Kartenkorrektur','link'=>'fhausweis/kartenkorrektur.php','target'=>'main')
|
||||
'Kartenruecknahme'=>array('name'=>'Kartenruecknahme','link'=>'fhausweis/kartenruecknahme.php','target'=>'main'),
|
||||
)
|
||||
),
|
||||
'Wartung'=> array
|
||||
|
||||
+75
-44
@@ -33,7 +33,7 @@ class UDF extends basis_db
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the titles (short description) of the UDF related to the table tbl_person
|
||||
*/
|
||||
@@ -41,7 +41,7 @@ class UDF extends basis_db
|
||||
{
|
||||
return $this->_loadTitles($this->_getUDFDefinition($this->loadPersonJsons()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the titles (short description) of the UDF related to the table tbl_prestudent
|
||||
*/
|
||||
@@ -49,49 +49,49 @@ class UDF extends basis_db
|
||||
{
|
||||
return $this->_loadTitles($this->_getUDFDefinition($this->loadPrestudentJsons()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads the UDF definitions related to the table tbl_person
|
||||
*/
|
||||
public function loadPersonJsons()
|
||||
{
|
||||
$jsons = null;
|
||||
|
||||
|
||||
if ($this->existsUDF() && $this->prestudentHasUDF())
|
||||
{
|
||||
$jsons = $this->_loadJsons('public', 'tbl_person');
|
||||
}
|
||||
|
||||
|
||||
return $jsons;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads the UDF definitions related to the table tbl_prestudent
|
||||
*/
|
||||
public function loadPrestudentJsons()
|
||||
{
|
||||
$jsons = null;
|
||||
|
||||
|
||||
if ($this->existsUDF() && $this->prestudentHasUDF())
|
||||
{
|
||||
$jsons = $this->_loadJsons('public', 'tbl_prestudent');
|
||||
}
|
||||
|
||||
|
||||
return $jsons;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the table system.tbl_udf exists
|
||||
*/
|
||||
public function existsUDF()
|
||||
{
|
||||
$existsUDF = false;
|
||||
|
||||
|
||||
$query = 'SELECT COUNT(*) AS count
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = \'system\'
|
||||
AND table_name = \'tbl_udf\'';
|
||||
|
||||
|
||||
if (!$this->db_query($query))
|
||||
{
|
||||
$this->errormsg = 'Error!!!';
|
||||
@@ -106,23 +106,23 @@ class UDF extends basis_db
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $existsUDF;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the column udf_values exists in table tbl_person
|
||||
*/
|
||||
public function personHasUDF()
|
||||
{
|
||||
$personHasUDF = false;
|
||||
|
||||
|
||||
$query = 'SELECT COUNT(*) AS count
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = \'public\'
|
||||
AND table_name = \'tbl_person\'
|
||||
AND column_name = \'udf_values\'';
|
||||
|
||||
|
||||
if (!$this->db_query($query))
|
||||
{
|
||||
$this->errormsg = 'Error!!!';
|
||||
@@ -137,23 +137,23 @@ class UDF extends basis_db
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $personHasUDF;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the column udf_values exists in table tbl_prestudent
|
||||
*/
|
||||
public function prestudentHasUDF()
|
||||
{
|
||||
$prestudentHasUDF = false;
|
||||
|
||||
|
||||
$query = 'SELECT COUNT(*) AS count
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = \'public\'
|
||||
AND table_name = \'tbl_prestudent\'
|
||||
AND column_name = \'udf_values\'';
|
||||
|
||||
|
||||
if (!$this->db_query($query))
|
||||
{
|
||||
$this->errormsg = 'Error!!!';
|
||||
@@ -168,17 +168,17 @@ class UDF extends basis_db
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $prestudentHasUDF;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Concatenates a list of values of a dropdown element to a string
|
||||
*/
|
||||
public function dropdownListValuesToString($listValues, $enum)
|
||||
{
|
||||
$toWrite = '';
|
||||
|
||||
|
||||
foreach ($listValues as $value)
|
||||
{
|
||||
foreach ($enum as $element)
|
||||
@@ -207,10 +207,41 @@ class UDF extends basis_db
|
||||
}
|
||||
$toWrite .= ' ';
|
||||
}
|
||||
|
||||
|
||||
return $toWrite;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a string that represent the value of a UDF using the given value and description
|
||||
*/
|
||||
public function encodeToString($decodedJson, $udfDescription)
|
||||
{
|
||||
$toString = '';
|
||||
$udfName = $udfDescription['name'];
|
||||
|
||||
if (isset($decodedJson[$udfName]))
|
||||
{
|
||||
if (is_string($decodedJson[$udfName]) || is_numeric($decodedJson[$udfName]))
|
||||
{
|
||||
$toString = $decodedJson[$udfName];
|
||||
}
|
||||
else if (is_bool($decodedJson[$udfName]))
|
||||
{
|
||||
$toString = $decodedJson[$udfName] === true ? 'true' : 'false';
|
||||
}
|
||||
else if(is_array($decodedJson[$udfName]) && isset($udfDescription['enum']))
|
||||
{
|
||||
$toString = $this->dropdownListValuesToString($decodedJson[$udfName], $udfDescription['enum']);
|
||||
}
|
||||
}
|
||||
else if ($decodedJson[$udfName] == null)
|
||||
{
|
||||
$toString = '';
|
||||
}
|
||||
|
||||
return $toString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the UDF definitions related to the given schema and table
|
||||
*/
|
||||
@@ -218,7 +249,7 @@ class UDF extends basis_db
|
||||
{
|
||||
$jsons = null;
|
||||
$query = 'SELECT jsons FROM system.tbl_udf WHERE schema = \''.$schema.'\' AND "table" = \''.$table.'\'';
|
||||
|
||||
|
||||
if (!$this->db_query($query))
|
||||
{
|
||||
$this->errormsg = 'Error occurred while loading jsons';
|
||||
@@ -230,17 +261,17 @@ class UDF extends basis_db
|
||||
$jsons = $row->jsons;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $jsons;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sorts the UDF definitions using the proprierty "sort"
|
||||
*/
|
||||
private function _sortJsonSchemas(&$jsonSchemasArray)
|
||||
{
|
||||
usort($jsonSchemasArray, function ($a, $b) {
|
||||
//
|
||||
//
|
||||
if (!isset($a->sort))
|
||||
{
|
||||
$a->sort = 9999;
|
||||
@@ -249,16 +280,16 @@ class UDF extends basis_db
|
||||
{
|
||||
$b->sort = 9999;
|
||||
}
|
||||
|
||||
|
||||
if ($a->sort == $b->sort)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return ($a->sort < $b->sort) ? -1 : 1;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of associative arrays that contains the couple name and title related to an UDF
|
||||
* These data are retrived from the UDF definitions given as parameter
|
||||
@@ -266,7 +297,7 @@ class UDF extends basis_db
|
||||
private function _getUDFDefinition($jsons)
|
||||
{
|
||||
$names = array();
|
||||
|
||||
|
||||
if ($jsons != null && ($jsonsDecoded = json_decode($jsons)) != null)
|
||||
{
|
||||
if (is_object($jsonsDecoded) || is_array($jsonsDecoded))
|
||||
@@ -275,31 +306,31 @@ class UDF extends basis_db
|
||||
{
|
||||
$jsonsDecoded = array($jsonsDecoded);
|
||||
}
|
||||
|
||||
|
||||
$this->_sortJsonSchemas($jsonsDecoded);
|
||||
|
||||
|
||||
foreach($jsonsDecoded as $udfJsonShema)
|
||||
{
|
||||
if (isset($udfJsonShema->name) && isset($udfJsonShema->title))
|
||||
{
|
||||
$tmpArray = array('name' => $udfJsonShema->name, 'title' => $udfJsonShema->title);
|
||||
|
||||
|
||||
if (isset($udfJsonShema->type)
|
||||
&& ($udfJsonShema->type == 'dropdown' || $udfJsonShema->type == 'multipledropdown')
|
||||
&& isset($udfJsonShema->listValues) && isset($udfJsonShema->listValues->enum))
|
||||
{
|
||||
$tmpArray['enum'] = $udfJsonShema->listValues->enum;
|
||||
}
|
||||
|
||||
|
||||
$names[] = $tmpArray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $names;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads UDf titles from phrases
|
||||
*/
|
||||
@@ -307,22 +338,22 @@ class UDF extends basis_db
|
||||
{
|
||||
$titles = array();
|
||||
$in = '';
|
||||
|
||||
|
||||
for($i = 0; $i < count($udfDefinitions); $i++)
|
||||
{
|
||||
$udfDefinition = $udfDefinitions[$i];
|
||||
$in .= '\''.$udfDefinition['title'].'\'';
|
||||
|
||||
|
||||
if ($i < count($udfDefinitions) - 1) $in .= ', ';
|
||||
}
|
||||
|
||||
|
||||
if ($in != '')
|
||||
{
|
||||
$query = 'SELECT pt.text AS title, p.phrase AS phrase
|
||||
FROM system.tbl_phrase p INNER JOIN system.tbl_phrasentext pt USING(phrase_id)
|
||||
WHERE pt.sprache = \''.DEFAULT_LEHREINHEIT_SPRACHE.'\'
|
||||
AND p.phrase IN ('.$in.')';
|
||||
|
||||
|
||||
if (!$this->db_query($query))
|
||||
{
|
||||
$this->errormsg = 'Error occurred while loading jsons';
|
||||
@@ -343,7 +374,7 @@ class UDF extends basis_db
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $titles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+1
-1
@@ -2500,7 +2500,7 @@ class wochenplan extends basis_db
|
||||
|
||||
$UID = 'FH'.$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical.$end_date_time_ical;
|
||||
$Summary = $lehrfach[$idx].' '.$this->std_plan[$i][$j][$idx]->ort.' - '.$lvb;
|
||||
$description = $lehrfach[$idx].'\n'.$this->std_plan[$i][$j][$idx]->lektor.'\n'.$lvb.'\n'.$this->std_plan[$i][$j][$idx]->ort;
|
||||
$description = $lehrfach[$idx].'\n'.$this->std_plan[$i][$j][$idx]->lektor.'\n'.$lvb.'\n'.$this->std_plan[$i][$j][$idx]->ort.(LVPLAN_ANMERKUNG_ANZEIGEN?'\n'.$this->std_plan[$i][$j][$idx]->anmerkung:'');
|
||||
|
||||
$UID = str_replace(',',' ',$UID);
|
||||
$Summary = str_replace(',',' ',$Summary);
|
||||
|
||||
+48
-6
@@ -282,25 +282,25 @@ if(!$result = @$db->db_query("SELECT 1 FROM system.tbl_udf LIMIT 1"))
|
||||
echo '<strong>system.tbl_udf: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>system.tbl_udf table created';
|
||||
|
||||
|
||||
$qry = 'COMMENT ON COLUMN system.tbl_udf.schema IS \'Schema of the table\';';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Adding comment to system.tbl_udf.schema: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Added comment to system.tbl_udf.schema';
|
||||
|
||||
|
||||
$qry = 'COMMENT ON COLUMN system.tbl_udf.table IS \'Table name\';';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Adding comment to system.tbl_udf.table: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Added comment to system.tbl_udf.table';
|
||||
|
||||
|
||||
$qry = 'COMMENT ON COLUMN system.tbl_udf.jsons IS \'JSON schema\';';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Adding comment to system.tbl_udf.jsons: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Added comment to system.tbl_udf.jsons';
|
||||
|
||||
|
||||
$qry = 'GRANT SELECT ON TABLE system.tbl_udf TO web;';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_udf: '.$db->db_last_error().'</strong><br>';
|
||||
@@ -381,13 +381,55 @@ if(!$result = @$db->db_query("SELECT design_uid FROM public.tbl_service LIMIT 1;
|
||||
ALTER TABLE public.tbl_service ADD CONSTRAINT fk_tbl_service_design_uid FOREIGN KEY (design_uid) REFERENCES public.tbl_benutzer (uid) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE public.tbl_service ADD CONSTRAINT fk_tbl_service_betrieb_uid FOREIGN KEY (betrieb_uid) REFERENCES public.tbl_benutzer (uid) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE public.tbl_service ADD CONSTRAINT fk_tbl_service_operativ_uid FOREIGN KEY (operativ_uid) REFERENCES public.tbl_benutzer (uid) ON DELETE RESTRICT ON UPDATE CASCADE;";
|
||||
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_service: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_service: Spalten design_uid,betrieb_uid,operativ_uid hinzugefuegt!<br>';
|
||||
}
|
||||
|
||||
// FOREIGN KEY tbl_phrasentext_sprache_fkey: system.tbl_phrasentext.sprache references public.tbl_sprache.sprache
|
||||
if ($result = @$db->db_query("SELECT conname FROM pg_constraint WHERE conname = 'tbl_phrasentext_sprache_fkey'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "ALTER TABLE system.tbl_phrasentext ADD CONSTRAINT tbl_phrasentext_sprache_fkey FOREIGN KEY (sprache) REFERENCES public.tbl_sprache(sprache) ON UPDATE CASCADE ON DELETE RESTRICT;";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_phrasentext: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>system.tbl_phrasentext: added foreign key on column sprache referenced to public.tbl_sprache(sprache)';
|
||||
}
|
||||
}
|
||||
|
||||
// FOREIGN KEY tbl_phrasentext_orgeinheit_kurzbz_fkey: system.tbl_phrasentext.orgeinheit_kurzbz references public.tbl_organisationseinheit.orgeinheit_kurzbz
|
||||
if ($result = @$db->db_query("SELECT conname FROM pg_constraint WHERE conname = 'tbl_phrasentext_orgeinheit_kurzbz_fkey'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "ALTER TABLE system.tbl_phrasentext ADD CONSTRAINT tbl_phrasentext_orgeinheit_kurzbz_fkey FOREIGN KEY (orgeinheit_kurzbz) REFERENCES public.tbl_organisationseinheit(oe_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT;";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_phrasentext: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>system.tbl_phrasentext: added foreign key on column orgeinheit_kurzbz referenced to public.tbl_organisationseinheit(orgeinheit_kurzbz)';
|
||||
}
|
||||
}
|
||||
|
||||
// FOREIGN KEY tbl_phrasentext_orgform_kurzbz_fkey: system.tbl_phrasentext.orgform_kurzbz references bis.tbl_orgform.orgform_kurzbz
|
||||
if ($result = @$db->db_query("SELECT conname FROM pg_constraint WHERE conname = 'tbl_phrasentext_orgform_kurzbz_fkey'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "ALTER TABLE system.tbl_phrasentext ADD CONSTRAINT tbl_phrasentext_orgform_kurzbz_fkey FOREIGN KEY (orgform_kurzbz) REFERENCES bis.tbl_orgform(orgform_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT;";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_phrasentext: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>system.tbl_phrasentext: added foreign key on column orgform_kurzbz referenced to bis.tbl_orgform(orgform_kurzbz)';
|
||||
}
|
||||
}
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
|
||||
@@ -726,4 +768,4 @@ if (!$result=@$db->db_query($sql_query))
|
||||
}
|
||||
if($error==false)
|
||||
echo '<br>Gegenpruefung fehlerfrei';
|
||||
?>
|
||||
?>
|
||||
|
||||
Regular → Executable
+8
-5
@@ -508,7 +508,8 @@ echo '<BR>Geänderte Datensätze werden geholt.('.date('H:i:s').')<BR>';
|
||||
$message_stpl.='<BR>Geänderte Datensätze werden geholt.('.date('H:i:s').')<BR>';
|
||||
$sql_query="SELECT vw_stundenplandev.*, vw_stundenplan.datum AS old_datum, vw_stundenplan.stunde AS old_stunde,
|
||||
vw_stundenplan.ort_kurzbz AS old_ort_kurzbz, vw_stundenplan.lektor AS old_lektor,
|
||||
vw_stundenplan.uid AS old_uid, vw_stundenplan.titel AS old_titel
|
||||
vw_stundenplan.uid AS old_uid, vw_stundenplan.titel AS old_titel,
|
||||
vw_stundenplan.anmerkung AS old_anmerkung
|
||||
FROM lehre.vw_stundenplandev, lehre.vw_stundenplan
|
||||
WHERE vw_stundenplan.stundenplan_id=vw_stundenplandev.stundenplandev_id AND (
|
||||
vw_stundenplandev.unr!=vw_stundenplan.unr OR
|
||||
@@ -522,11 +523,12 @@ $sql_query="SELECT vw_stundenplandev.*, vw_stundenplan.datum AS old_datum, vw_st
|
||||
vw_stundenplandev.gruppe!=vw_stundenplan.gruppe OR
|
||||
vw_stundenplandev.gruppe_kurzbz!=vw_stundenplan.gruppe_kurzbz OR
|
||||
coalesce(vw_stundenplandev.titel,'')!=coalesce(vw_stundenplan.titel,'') OR
|
||||
vw_stundenplandev.fix!=vw_stundenplan.fix OR
|
||||
vw_stundenplandev.lehreinheit_id!=vw_stundenplan.lehreinheit_id )
|
||||
vw_stundenplandev.fix!=vw_stundenplan.fix OR";
|
||||
if (LVPLAN_ANMERKUNG_ANZEIGEN)
|
||||
$sql_query .= " coalesce(vw_stundenplandev.anmerkung,'')!=coalesce(vw_stundenplan.anmerkung,'') OR";
|
||||
$sql_query .= " vw_stundenplandev.lehreinheit_id!=vw_stundenplan.lehreinheit_id )
|
||||
AND vw_stundenplandev.datum>=".$db->db_add_param($datum_begin)."
|
||||
AND vw_stundenplandev.datum<=".$db->db_add_param($datum_ende)." ".$stgwheredev.";";
|
||||
//vw_stundenplandev.anmerkung!=vw_stundenplan.anmerkung OR --> von kindlm am 16.03.2012 aus obigem SQL entfernt, da nicht relevant fuer tbl_stundenplan und nur fuer intern gedacht
|
||||
|
||||
//echo $sql_query.'<BR>';
|
||||
|
||||
@@ -574,7 +576,8 @@ else
|
||||
$sql_query.=',gruppe_kurzbz=NULL';
|
||||
else
|
||||
$sql_query.=",gruppe_kurzbz=".$db->db_add_param($row->gruppe_kurzbz);
|
||||
//$sql_query.=",titel='$row->titel',anmerkung='$row->anmerkung'"; --> anmerkung auskommentiert vom kindlm am 16.03.2012 da nicht relevant fuer tbl_stundenplan und nur fuer intern gedacht
|
||||
if (LVPLAN_ANMERKUNG_ANZEIGEN) //spalte anmerkung nur syncen, wenn im Config aktiv
|
||||
$sql_query.=",anmerkung=".$db->db_add_param($row->anmerkung);
|
||||
if ($row->titel=='')
|
||||
$sql_query.=',titel=NULL';
|
||||
else
|
||||
|
||||
@@ -23,18 +23,19 @@
|
||||
<property name="absoluteLineLimit" value="150"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
|
||||
|
||||
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
|
||||
|
||||
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
|
||||
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
|
||||
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
|
||||
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
|
||||
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
|
||||
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
|
||||
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
|
||||
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
|
||||
|
||||
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
|
||||
<rule ref="Generic.Commenting.Todo"/>
|
||||
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
|
||||
|
||||
<!--
|
||||
We allow EOL after closing braces
|
||||
@@ -47,20 +48,19 @@
|
||||
|
||||
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
|
||||
|
||||
<rule ref="Generic.PHP.DeprecatedFunctions"/>
|
||||
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
|
||||
<rule ref="Squiz.PHP.Eval"/>
|
||||
<rule ref="Generic.PHP.ForbiddenFunctions"/>
|
||||
<rule ref="Squiz.PHP.NonExecutableCode"/>
|
||||
<rule ref="Generic.PHP.NoSilencedErrors"/>
|
||||
<rule ref="Generic.PHP.ForbiddenFunctions"/>
|
||||
<rule ref="Generic.PHP.DeprecatedFunctions"/>
|
||||
|
||||
<rule ref="Squiz.Scope.MemberVarScope"/>
|
||||
<rule ref="Squiz.Scope.StaticThisUsage"/>
|
||||
|
||||
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
|
||||
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
|
||||
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
|
||||
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
|
||||
|
||||
<!-- Relax some src/* and tests/* rules -->
|
||||
<rule ref="Squiz.Classes.ValidClassName">
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 fhcomplete.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Gui zum aktivieren der Zutrittskarte
|
||||
* Hier wird die neue Karte einmal über den Kartenleser gezogen zum das Ausgabedatum zu setzen
|
||||
*/
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/person.class.php');
|
||||
require_once('../../include/benutzer.class.php');
|
||||
require_once('../../include/student.class.php');
|
||||
require_once('../../include/studiengang.class.php');
|
||||
require_once('../../include/betriebsmittel.class.php');
|
||||
require_once('../../include/betriebsmittelperson.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
$uid = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
|
||||
echo '<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/jquery.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../include/js/jquery.js"></script>
|
||||
<title>Kartentausch</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Zutrittskarte - Ausgabe</h2>';
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/fhausweis', 'suid'))
|
||||
die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
$db = new basis_db();
|
||||
$kartennummer = (isset($_POST['kartennummer'])?$_POST['kartennummer']:'');
|
||||
$action=(isset($_POST['action'])?$_POST['action']:'');
|
||||
|
||||
if ($action == 'kartenausgabe')
|
||||
{
|
||||
$bmp = new betriebsmittelperson();
|
||||
if ($bmp->getKartenzuordnung($kartennummer))
|
||||
{
|
||||
if ($bmp->uid != '')
|
||||
{
|
||||
$karten_user = $bmp->uid;
|
||||
|
||||
$benutzer = new benutzer();
|
||||
if(!$benutzer->load($karten_user))
|
||||
{
|
||||
echo '<span class="error">Fehler beim Laden des Benutzers</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$error=false;
|
||||
//Neue Karte aktivieren
|
||||
$bmp = new betriebsmittelperson();
|
||||
if ($bmp->getKartenzuordnungPerson($benutzer->person_id, $kartennummer))
|
||||
{
|
||||
if ($bmp->ausgegebenam == '')
|
||||
{
|
||||
$bmp->ausgegebenam=date('Y-m-d');
|
||||
$bmp->updateamum = date('Y-m-d H:i:s');
|
||||
$bmp->updatevon = $uid;
|
||||
|
||||
if(!$bmp->save(false))
|
||||
{
|
||||
echo '<span class="error">Fehler beim Tauschen: '.$bmp->errormsg.'</span>';
|
||||
$error=true;
|
||||
}
|
||||
else
|
||||
echo '<span class="ok">Karte wurde erfolgreich aktiviert.</span><br>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="../../content/bild.php?src=person&person_id='.$benutzer->person_id.'"
|
||||
height="100px" width="75px"/>
|
||||
</td>
|
||||
<td>
|
||||
Vorname: '.$benutzer->vorname.'<br>
|
||||
Nachname: '.$benutzer->nachname.'<br>
|
||||
UID: <b>'.$benutzer->uid.'<br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span>Karte wurde bereits am '.$bmp->ausgegebenam.' aktiviert</span>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '
|
||||
<span class="error">
|
||||
Fehler beim Tauschen: Die neue Karte wurde dieser
|
||||
Person noch nicht zugeordnet ('.$benutzer->uid.' '.$kartennummer.')
|
||||
</span>';
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Diese Karte ist derzeit nicht zugewiesen</span>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Diese Karte ist derzeit nicht zugewiesen</span>';
|
||||
}
|
||||
|
||||
echo '<br><hr><br>';
|
||||
}
|
||||
|
||||
echo '
|
||||
Ziehen Sie die neue Karte über den Hitag Kartenleser um die Karte zu aktivieren:
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#kartennummer").val("");
|
||||
$("#kartennummer").focus();
|
||||
});
|
||||
</script>
|
||||
<br><br>
|
||||
<form action="'.$_SERVER['PHP_SELF'].'" METHOD="POST">
|
||||
<input type="hidden" name="action" value="kartenausgabe" />
|
||||
Kartennummer:
|
||||
<input type="text" id="kartennummer" name="kartennummer"/>
|
||||
<input type="submit" name="ausgeben" value="Ausgeben" />
|
||||
</form>
|
||||
';
|
||||
|
||||
echo '</body>
|
||||
</html>';
|
||||
?>
|
||||
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 fhcomplete.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Gui zum aktivieren der Zutrittskarte
|
||||
* Hier wird die neue Karte einmal über den Kartenleser gezogen zum das Ausgabedatum zu setzen
|
||||
*/
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/person.class.php');
|
||||
require_once('../../include/benutzer.class.php');
|
||||
require_once('../../include/student.class.php');
|
||||
require_once('../../include/studiengang.class.php');
|
||||
require_once('../../include/betriebsmittel.class.php');
|
||||
require_once('../../include/betriebsmittelperson.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
$uid = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
|
||||
echo '<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/jquery.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../include/js/jquery.js"></script>
|
||||
<title>Kartentausch</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Zutrittskarte - Ruecknahme</h2>';
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/fhausweis', 'suid'))
|
||||
die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
$db = new basis_db();
|
||||
$kartennummer = (isset($_POST['kartennummer'])?$_POST['kartennummer']:'');
|
||||
$action=(isset($_POST['action'])?$_POST['action']:'');
|
||||
|
||||
if ($action == 'kartenruecknahme')
|
||||
{
|
||||
$bmp = new betriebsmittelperson();
|
||||
if ($bmp->getKartenzuordnung($kartennummer))
|
||||
{
|
||||
if ($bmp->uid != '')
|
||||
{
|
||||
$karten_user = $bmp->uid;
|
||||
|
||||
$benutzer = new benutzer();
|
||||
if(!$benutzer->load($karten_user))
|
||||
{
|
||||
echo '<span class="error">Fehler beim Laden des Benutzers</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$error=false;
|
||||
//Neue Karte aktivieren
|
||||
$bmp = new betriebsmittelperson();
|
||||
if ($bmp->getKartenzuordnungPerson($benutzer->person_id, $kartennummer))
|
||||
{
|
||||
if ($bmp->ausgegebenam != '' && $bmp->retouram == '')
|
||||
{
|
||||
$bmp->retouram=date('Y-m-d');
|
||||
$bmp->updateamum = date('Y-m-d H:i:s');
|
||||
$bmp->updatevon = $uid;
|
||||
|
||||
if(!$bmp->save(false))
|
||||
{
|
||||
echo '<span class="error">Fehler beim Tauschen: '.$bmp->errormsg.'</span>';
|
||||
$error=true;
|
||||
}
|
||||
else
|
||||
echo '<span class="ok">Karte wurde erfolgreich ausgetragen.</span><br>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="../../content/bild.php?src=person&person_id='.$benutzer->person_id.'"
|
||||
height="100px" width="75px"/>
|
||||
</td>
|
||||
<td>
|
||||
Vorname: '.$benutzer->vorname.'<br>
|
||||
Nachname: '.$benutzer->nachname.'<br>
|
||||
UID: <b>'.$benutzer->uid.'<br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span>Karte ist nicht ausgegeben oder wurde bereits retourniert</span>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '
|
||||
<span class="error">
|
||||
Fehler beim Tauschen: Die Karte wurde dieser
|
||||
Person noch nicht zugeordnet ('.$benutzer->uid.' '.$kartennummer.')
|
||||
</span>';
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Diese Karte ist derzeit nicht zugewiesen</span>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Diese Karte ist derzeit nicht zugewiesen</span>';
|
||||
}
|
||||
|
||||
echo '<br><hr><br>';
|
||||
}
|
||||
|
||||
echo '
|
||||
Ziehen Sie die neue Karte über den Hitag Kartenleser um die Karte zu deaktivieren:
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#kartennummer").val("");
|
||||
$("#kartennummer").focus();
|
||||
});
|
||||
</script>
|
||||
<br><br>
|
||||
<form action="'.$_SERVER['PHP_SELF'].'" METHOD="POST">
|
||||
<input type="hidden" name="action" value="kartenruecknahme" />
|
||||
Kartennummer:
|
||||
<input type="text" id="kartennummer" name="kartennummer"/>
|
||||
<input type="submit" name="retournieren" value="Karte austragen" />
|
||||
</form>
|
||||
';
|
||||
|
||||
echo '</body>
|
||||
</html>';
|
||||
?>
|
||||
@@ -34,7 +34,7 @@ if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
@@ -47,9 +47,9 @@ $sql_query="SELECT gruppe_kurzbz FROM public.tbl_gruppe WHERE studiengang_kz=100
|
||||
$result_incgrp=$db->db_query($sql_query);
|
||||
if(!$result_incgrp)
|
||||
die("Keine Incoming-Gruppen gefunden! ".$db->db_last_error());
|
||||
|
||||
$incgrp=(isset($_REQUEST['incgrp'])?$_REQUEST['incgrp']:'');
|
||||
$lehreinheit_id=(isset($_REQUEST['lehreinheit_id'])?$_REQUEST['lehreinheit_id']:'');
|
||||
|
||||
$incgrp=(isset($_REQUEST['incgrp'])?$_REQUEST['incgrp']:'');
|
||||
$lehreinheit_id=(isset($_REQUEST['lehreinheit_id'])?$_REQUEST['lehreinheit_id']:'');
|
||||
$type=(isset($_REQUEST['type'])?$_REQUEST['type']:'');
|
||||
|
||||
?>
|
||||
@@ -66,11 +66,11 @@ $type=(isset($_REQUEST['type'])?$_REQUEST['type']:'');
|
||||
|
||||
<p>
|
||||
Löscht einen Incoming aus <strong>beiden</strong> LV-Plan Tabellen und auch die <strong>Gruppenzuteilung im FAS</strong>.<br/><br/>
|
||||
|
||||
|
||||
Lehreinheit aus der der Incoming gelöscht werden soll:
|
||||
<input type="text" name="lehreinheit_id" size="6" maxlength="10" value="<?php echo $lehreinheit_id; ?>"><br/>
|
||||
</p>
|
||||
<p>Gruppe des Incomings, die gelöscht werden soll:
|
||||
<p>Gruppe des Incomings, die gelöscht werden soll:
|
||||
<select name="incgrp">
|
||||
<option value=NULL>*</option>
|
||||
<?php
|
||||
@@ -104,16 +104,16 @@ if ($type=="save")
|
||||
echo "Auftrag wird ausgefuehrt...<br>";
|
||||
if (!$error)
|
||||
{
|
||||
$sql_query="DELETE FROM lehre.tbl_stundenplandev
|
||||
WHERE lehreinheit_id=".$db->db_add_param($_POST['lehreinheit_id'], FHC_INTEGER)."
|
||||
$sql_query="DELETE FROM lehre.tbl_stundenplandev
|
||||
WHERE lehreinheit_id=".$db->db_add_param($_POST['lehreinheit_id'], FHC_INTEGER)."
|
||||
AND gruppe_kurzbz=".$db->db_add_param($_POST['incgrp']).";
|
||||
|
||||
DELETE FROM lehre.tbl_stundenplan
|
||||
WHERE lehreinheit_id=".$db->db_add_param($_POST['lehreinheit_id'], FHC_INTEGER)."
|
||||
AND gruppe_kurzbz=".$db->db_add_param($_POST['incgrp'], FHC_INTEGER).";
|
||||
|
||||
DELETE FROM lehre.tbl_lehreinheitgruppe
|
||||
WHERE lehreinheit_id=".$db->db_add_param($_POST['lehreinheit_id'])."
|
||||
|
||||
DELETE FROM lehre.tbl_stundenplan
|
||||
WHERE lehreinheit_id=".$db->db_add_param($_POST['lehreinheit_id'], FHC_INTEGER)."
|
||||
AND gruppe_kurzbz=".$db->db_add_param($_POST['incgrp']).";
|
||||
|
||||
DELETE FROM lehre.tbl_lehreinheitgruppe
|
||||
WHERE lehreinheit_id=".$db->db_add_param($_POST['lehreinheit_id'])."
|
||||
AND gruppe_kurzbz=".$db->db_add_param($_POST['incgrp']).";";
|
||||
//echo $sql_query;
|
||||
$result=$db->db_query($sql_query);
|
||||
|
||||
@@ -153,7 +153,7 @@ switch($method)
|
||||
$studienordnungstatus->getstatus();
|
||||
foreach($studienordnungstatus->result as $row_status)
|
||||
{
|
||||
if($row_status->status_kurzbz==$studienordnung->status_kurzbz)
|
||||
if($row_status->status_kurzbz==$studienordnung->status_kurzbz || ($new && $row_status->status_kurzbz == "development"))
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
@@ -233,7 +233,7 @@ if (! $funktion->load ( $kurzbz )) {
|
||||
<link rel="stylesheet" href="../../include/js/tablesort/table.css"
|
||||
type="text/css">
|
||||
<script src="../../include/js/tablesort/table.js" type="text/javascript"></script>
|
||||
<script src="../../include/js/jquery.checkboxes-1.0.7.min.js" type="text/javascript"></script>
|
||||
<script src="../../vendor/rmariuzzo/jquery-checkboxes/dist/jquery.checkboxes-1.0.7.min.js" type="text/javascript"></script>
|
||||
|
||||
<!-- modified 20160707 -->
|
||||
<link href="../../skin/tablesort.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
@@ -521,7 +521,7 @@ if(isset($_GET['excel']))
|
||||
<link rel="stylesheet" href="../../skin/tablesort.css" type="text/css"/>
|
||||
<link href="../../skin/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css">
|
||||
<script src="../../include/js/jquery1.9.min.js" type="text/javascript"></script>
|
||||
<script src="../../include/js/jquery.checkboxes-1.0.7.min.js" type="text/javascript"></script>
|
||||
<script src="../../vendor/rmariuzzo/jquery-checkboxes/dist/jquery.checkboxes-1.0.7.min.js" type="text/javascript"></script>
|
||||
|
||||
<link href="../../skin/jquery.ui.timepicker.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="../../include/js/jquery.ui.timepicker.js" type="text/javascript" ></script>
|
||||
|
||||
Reference in New Issue
Block a user