Debug v16
This commit is contained in:
parent
2b5b9957c3
commit
e9d5ba5de3
@ -68,6 +68,19 @@ $hookmanager->initHooks(array('intracommcard', 'globalcard'));
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
$permissiontoread = $user->rights->intracommreport->read;
|
||||||
|
$permissiontoadd = $user->rights->intracommreport->write;
|
||||||
|
$permissiontodelete = $user->rights->intracommreport->delete;
|
||||||
|
|
||||||
|
// Security check (enable the most restrictive one)
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
if (empty($conf->intracommreport->enabled)) accessforbidden();
|
||||||
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -80,7 +93,7 @@ if ($reshook < 0) {
|
|||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->intracommreport->delete && $action == 'confirm_delete' && $confirm == 'yes') {
|
if ($permissiontodelete && $action == 'confirm_delete' && $confirm == 'yes') {
|
||||||
$result = $object->delete($id, $user);
|
$result = $object->delete($id, $user);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
if (!empty($backtopage)) {
|
if (!empty($backtopage)) {
|
||||||
@ -95,7 +108,7 @@ if ($user->rights->intracommreport->delete && $action == 'confirm_delete' && $co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add' && $user->rights->intracommreport->write) {
|
if ($action == 'add' && $permissiontoadd) {
|
||||||
$object->label = trim($label);
|
$object->label = trim($label);
|
||||||
$object->type = trim($exporttype);
|
$object->type = trim($exporttype);
|
||||||
$object->type_declaration = $type_declaration;
|
$object->type_declaration = $type_declaration;
|
||||||
|
|||||||
@ -124,7 +124,6 @@ class IntracommReport extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getXML($mode = 'O', $type = 'introduction', $period_reference = '')
|
public function getXML($mode = 'O', $type = 'introduction', $period_reference = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc;
|
||||||
|
|
||||||
/**************Construction de quelques variables********************/
|
/**************Construction de quelques variables********************/
|
||||||
@ -437,7 +436,8 @@ class IntracommReport extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getNextDeclarationNumber()
|
public function getNextDeclarationNumber()
|
||||||
{
|
{
|
||||||
$resql = $this->db->query('SELECT MAX(numero_declaration) as max_declaration_number FROM '.MAIN_DB_PREFIX.$this->table_element." WHERE exporttype='".$this->db->escape($this->exporttype)."'");
|
$sql = 'SELECT MAX(numero_declaration) as max_declaration_number FROM '.MAIN_DB_PREFIX.$this->table_element." WHERE exporttype='".$this->db->escape($this->exporttype)."'";
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$res = $this->db->fetch_object($resql);
|
$res = $this->db->fetch_object($resql);
|
||||||
}
|
}
|
||||||
@ -463,7 +463,6 @@ class IntracommReport extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function generateXMLFile()
|
public function generateXMLFile()
|
||||||
{
|
{
|
||||||
|
|
||||||
$name = $this->periode.'.xml';
|
$name = $this->periode.'.xml';
|
||||||
$fname = sys_get_temp_dir().'/'.$name;
|
$fname = sys_get_temp_dir().'/'.$name;
|
||||||
$f = fopen($fname, 'w+');
|
$f = fopen($fname, 'w+');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user