From 28ca4e7e6b93f77b7d4a4e75a7e4b0c08682c451 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2009 06:00:28 +0000 Subject: [PATCH] Remove commercial module and 2 TODOs. --- htdocs/comm/action/document.php | 6 ++--- htdocs/comm/action/rapport/index.php | 4 ++++ htdocs/document.php | 22 +++++++++---------- .../includes/modules/action/rapport.pdf.php | 2 +- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index ea125a2ae49..cc25ee03b86 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -71,7 +71,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) /* * Creation repertoire si n'existe pas */ - $upload_dir = $conf->commercial->dir_actions.'/'.dol_sanitizeFileName($objectid); + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); if (! is_dir($upload_dir)) create_exdir($upload_dir); if (is_dir($upload_dir)) @@ -95,7 +95,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) */ if ($_GET["action"] == 'delete') { - $upload_dir = $conf->commercial->dir_actions.'/'.dol_sanitizeFileName($objectid); + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); $file = $upload_dir . '/' . urldecode($_GET['urlfile']); dol_delete_file($file); } @@ -113,7 +113,7 @@ if ($objectid > 0) $act = new ActionComm($db); if ($act->fetch($objectid)) { - $upload_dir = $conf->commercial->dir_actions.'/'.dol_sanitizeFileName($objectid); + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); $company=new Societe($db); $company->fetch($act->societe->id); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 8d86ef0365b..7c27ef1e551 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -54,6 +54,10 @@ if ($_GET["action"] == 'builddoc') { $cat = new CommActionRapport($db, $_GET["month"], $_GET["year"]); $result=$cat->generate($_GET["id"]); + if ($result < 0) + { + $mesg=$cat->error; + } } diff --git a/htdocs/document.php b/htdocs/document.php index 36af47f2a4d..7358d4ea708 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -272,24 +272,24 @@ if ($modulepart) // Wrapping pour les actions if ($modulepart == 'actions') { - $user->getrights('commercial'); - //if ($user->rights->commercial->actions->lire || eregi('^specimen',$original_file)) // TODO: revoir les droits car pas clair - //{ + $user->getrights('agenda'); + if ($user->rights->agenda->myactions->read || eregi('^specimen',$original_file)) + { $accessallowed=1; - //} - $original_file=$conf->actions->dir_output.'/'.$original_file; + } + $original_file=$conf->agenda->dir_output.'/'.$original_file; //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'"; } // Wrapping pour les actions if ($modulepart == 'actionsreport') { - $user->getrights('commercial'); - //if ($user->rights->commercial->actions->lire || eregi('^specimen',$original_file)) // TODO: revoir les droits car pas clair - //{ - $accessallowed=1; - //} - $original_file = $conf->actions->dir_temp."/".$original_file; + $user->getrights('agenda'); + if ($user->rights->agenda->allactions->read || eregi('^specimen',$original_file)) + { + $accessallowed=1; + } + $original_file = $conf->agenda->dir_temp."/".$original_file; //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'"; } diff --git a/htdocs/includes/modules/action/rapport.pdf.php b/htdocs/includes/modules/action/rapport.pdf.php index 8e7c1506700..362fc3a1a78 100644 --- a/htdocs/includes/modules/action/rapport.pdf.php +++ b/htdocs/includes/modules/action/rapport.pdf.php @@ -86,7 +86,7 @@ class CommActionRapport $outputlangs->setPhpLang(); - $dir = $conf->commercial->dir_actions_temp."/"; + $dir = $conf->agenda->dir_temp."/"; $file = $dir . "actions-".$this->month."-".$this->year.".pdf"; if (! file_exists($dir))