New: Ajout module ECM
This commit is contained in:
parent
1042bcfb44
commit
8dfcdf8632
@ -53,7 +53,7 @@ class modMyModule extends DolibarrModules
|
||||
// Key text used to identify module (for permission, menus, etc...)
|
||||
$this->rights_class = 'mymodule';
|
||||
|
||||
// Family can be 'crm','financial','hr','projects','product','technic','other'
|
||||
// Family can be 'crm','financial','hr','projects','product','ecm','technic','other'
|
||||
// It is used to group modules in module setup page
|
||||
$this->family = "projects";
|
||||
// Module title used if translation string 'ModuleXXXName' not found (XXX is value MyModule)
|
||||
|
||||
@ -294,9 +294,10 @@ $familylib=array(
|
||||
'products'=>$langs->trans("ModuleFamilyProducts"),
|
||||
'hr'=>$langs->trans("ModuleFamilyHr"),
|
||||
'projects'=>$langs->trans("ModuleFamilyProjects"),
|
||||
'other'=>$langs->trans("ModuleFamilyOther"),
|
||||
'technic'=>$langs->trans("ModuleFamilyTechnic"),
|
||||
'financial'=>$langs->trans("ModuleFamilyFinancial"),
|
||||
'ecm'=>$langs->trans("ModuleFamilyECM"),
|
||||
'technic'=>$langs->trans("ModuleFamilyTechnic"),
|
||||
'other'=>$langs->trans("ModuleFamilyOther")
|
||||
);
|
||||
foreach ($orders as $key => $value)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -15,15 +15,12 @@
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/admin/system/dolibarr.php
|
||||
\brief Fichier page info systemes Dolibarr
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
@ -93,6 +90,8 @@ $db->begin();
|
||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/";
|
||||
$handle=opendir($dir);
|
||||
$modules = array();
|
||||
$modules_names = array();
|
||||
$modules_files = array();
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
|
||||
@ -101,12 +100,12 @@ while (($file = readdir($handle))!==false)
|
||||
|
||||
if ($modName)
|
||||
{
|
||||
include_once("../../includes/modules/$file");
|
||||
include_once(DOL_DOCUMENT_ROOT."/includes/modules/".$file);
|
||||
$objMod = new $modName($db);
|
||||
|
||||
$modules[$objMod->numero]=$objMod;
|
||||
$modules_names[$objMod->numero]=$objMod->name;
|
||||
|
||||
$modules_files[$objMod->numero]=$file;
|
||||
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
||||
}
|
||||
}
|
||||
@ -127,7 +126,10 @@ foreach($sortorder as $numero=>$name)
|
||||
$idperms="";
|
||||
$var=!$var;
|
||||
// Module
|
||||
print "<tr $bc[$var]><td width=\"300\" nowrap=\"nowrap\">".img_object("",$picto[$numero]).' '.$modules[$numero]->getName()."</td>";
|
||||
print "<tr $bc[$var]><td width=\"300\" nowrap=\"nowrap\">";
|
||||
$alt=$name.' - '.$modules_files[$numero];
|
||||
print img_object($alt,$picto[$numero]).' '.$modules[$numero]->getName();
|
||||
print "</td>";
|
||||
// Version
|
||||
print '<td>'.$modules[$numero]->getVersion().'</td>';
|
||||
// Id
|
||||
|
||||
@ -15,22 +15,18 @@
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/param/index.php
|
||||
\ingroup compta
|
||||
\brief Page acceuil zone paramétrage comptabilité
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("admin");
|
||||
$langs->load("bills");
|
||||
|
||||
/*
|
||||
|
||||
@ -31,7 +31,6 @@ require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||
if (!$user->rights->prelevement->bons->lire)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
if ($_GET["action"] == "set" && $user->rights->prelevement->bons->configurer)
|
||||
{
|
||||
|
||||
@ -338,7 +338,9 @@ class Conf
|
||||
$this->fckeditor->dir_output=DOL_DATA_ROOT."/fckeditor";
|
||||
// Module etiquette
|
||||
$this->label->enabled=defined("MAIN_MODULE_LABEL")?MAIN_MODULE_LABEL:0;
|
||||
|
||||
// Module ECM
|
||||
$this->ecm->enabled=defined("MAIN_MODULE_ECM")?MAIN_MODULE_ECM:0;
|
||||
$this->ecm->dir_output=DOL_DATA_ROOT."/ecm";
|
||||
|
||||
/*
|
||||
* Modification de quelques variable de conf en fonction des Constantes
|
||||
|
||||
288
htdocs/ecm/docmine.php
Normal file
288
htdocs/ecm/docmine.php
Normal file
@ -0,0 +1,288 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdoc/google/index.php
|
||||
\ingroup google
|
||||
\brief Main google area page
|
||||
\version $Id$
|
||||
\author Laurent Destailleur
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
|
||||
// Load traductions files
|
||||
$langs->load("ecm");
|
||||
$langs->load("companies");
|
||||
$langs->load("other");
|
||||
|
||||
// Load permissions
|
||||
$user->getrights('ecm');
|
||||
|
||||
// Get parameters
|
||||
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||
|
||||
// Permissions
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
$section=$_GET["section"];
|
||||
if (! $section) $section='misc';
|
||||
$upload_dir = $conf->ecm->dir_output.'/'.$section;
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* ACTIONS
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
|
||||
// Envoie fichier
|
||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
||||
{
|
||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||
|
||||
if (is_dir($upload_dir))
|
||||
{
|
||||
$result = doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']);
|
||||
if ($result == 1)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
}
|
||||
else if (!$result)
|
||||
{
|
||||
// Echec transfert (fichier d?passant la limite ?)
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
// print_r($_FILES);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fichier infect? par un virus
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Suppression fichier
|
||||
if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
|
||||
{
|
||||
$file = $upload_dir . "/" . urldecode($_GET["urlfile"]);
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* PAGE
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
print_fiche_titre($langs->trans("DocsMine"));
|
||||
print "<br>";
|
||||
|
||||
//$head = societe_prepare_head($societe);
|
||||
|
||||
|
||||
//dolibarr_fiche_head($head, 'document', $societe->nom);
|
||||
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression d'une ligne produit
|
||||
*/
|
||||
if ($_GET['action'] == 'delete_file')
|
||||
{
|
||||
$form->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
// Construit liste des fichiers
|
||||
clearstatcache();
|
||||
$totalsize=0;
|
||||
$filearray=array();
|
||||
$errorlevel=error_reporting();
|
||||
error_reporting(0);
|
||||
$handle=opendir($upload_dir);
|
||||
error_reporting($errorlevel);
|
||||
if ($handle)
|
||||
{
|
||||
$i=0;
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
{
|
||||
$filearray[$i]->name=$file;
|
||||
$filearray[$i]->size=filesize($upload_dir."/".$file);
|
||||
$filearray[$i]->date=filemtime($upload_dir."/".$file);
|
||||
$totalsize+=$filearray[$i]->size;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
// print '<div class="error">'.$langs->trans("ErrorCanNotReadDir",$upload_dir).'</div>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
// Nbre fichiers
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>';
|
||||
|
||||
//Total taille
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
*/
|
||||
|
||||
|
||||
if ($mesg) { print $mesg."<br>"; }
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/docmine.php');
|
||||
|
||||
// Affiche liste des documents existant
|
||||
print_titre($langs->trans("AttachedFiles"));
|
||||
|
||||
/**
|
||||
* TODO Mettre cette section dans une zone AJAX
|
||||
*/
|
||||
$modulepart='ecm';
|
||||
$url=$_SERVER["PHP_SELF"];
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
$param='&socid='.$socid;
|
||||
print_liste_field_titre($langs->trans("Document"),$_SERVER["PHP_SELF"],"name","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Size"),$_SERVER["PHP_SELF"],"size","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"date","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
function compare_file($a, $b)
|
||||
{
|
||||
global $sortorder;
|
||||
global $sortfield;
|
||||
|
||||
$sortorder=strtoupper($sortorder);
|
||||
|
||||
if ($sortorder == 'ASC') { $retup=-1; $retdown=1; }
|
||||
else { $retup=1; $retdown=-1; }
|
||||
|
||||
if ($sortfield == 'name')
|
||||
{
|
||||
if ($a->name == $b->name) return 0;
|
||||
return ($a->name < $b->name) ? $retup : $retdown;
|
||||
}
|
||||
if ($sortfield == 'date')
|
||||
{
|
||||
if ($a->date == $b->date) return 0;
|
||||
return ($a->date < $b->date) ? $retup : $retdown;
|
||||
}
|
||||
if ($sortfield == 'size')
|
||||
{
|
||||
if ($a->size == $b->size) return 0;
|
||||
return ($a->size < $b->size) ? $retup : $retdown;
|
||||
}
|
||||
}
|
||||
|
||||
usort($filearray,"compare_file");
|
||||
|
||||
$var=true;
|
||||
foreach($filearray as $key => $file)
|
||||
{
|
||||
if (!is_dir($dir.$file->name) && substr($file->name, 0, 1) <> '.' && substr($file->name, 0, 3) <> 'CVS')
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&type=application/binary&file='.urlencode($prefix.$file->name).'">'.$file->name.'</a>';
|
||||
print "</td>\n";
|
||||
print '<td align="right">'.$file->size.' '.$langs->trans("bytes").'</td>';
|
||||
print '<td align="center">'.dolibarr_print_date($file->date,"dayhour").'</td>';
|
||||
print '<td align="center">';
|
||||
echo '<a href="'.$url.'?socid='.$socid.'&action=delete_file&urlfile='.urlencode($file->name).'">'.img_delete().'</a>';
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
print "</table>";
|
||||
// Fin de zone Ajax
|
||||
|
||||
|
||||
print "<br><br>";
|
||||
|
||||
// Courriers
|
||||
// Les courriers sont des documents speciaux generes par des scripts
|
||||
// situes dans scripts/courrier.
|
||||
// Voir Rodo
|
||||
if ($conf->global->MAIN_MODULE_EDITEUR)
|
||||
{
|
||||
$filearray=array();
|
||||
$errorlevel=error_reporting();
|
||||
error_reporting(0);
|
||||
$handle=opendir($courrier_dir);
|
||||
error_reporting($errorlevel);
|
||||
if ($handle)
|
||||
{
|
||||
$i=0;
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
{
|
||||
$filearray[$i]=$file;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Courriers").'</td><td align="right">'.$langs->trans("Size").'</td><td align="center">'.$langs->trans("Date").'</td></tr>';
|
||||
|
||||
$var=true;
|
||||
foreach($filearray as $key => $file)
|
||||
{
|
||||
if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
$loc = "courrier/".get_exdir($socid);
|
||||
echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart=societe&type=application/binary&file='.urlencode($loc.'/'.$file).'">'.$file.'</a>';
|
||||
print "</td>\n";
|
||||
|
||||
print '<td align="right">'.filesize($courrier_dir."/".$file). ' '.$langs->trans("bytes").'</td>';
|
||||
print '<td align="center">'.dolibarr_print_date(filemtime($courrier_dir."/".$file),"dayhour").'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// End of page
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
168
htdocs/ecm/docother.php
Normal file
168
htdocs/ecm/docother.php
Normal file
@ -0,0 +1,168 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdoc/google/index.php
|
||||
\ingroup google
|
||||
\brief Main google area page
|
||||
\version $Id$
|
||||
\author Laurent Destailleur
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
|
||||
// Load traductions files
|
||||
$langs->load("ecm");
|
||||
$langs->load("companies");
|
||||
$langs->load("other");
|
||||
|
||||
// Load permissions
|
||||
$user->getrights('ecm');
|
||||
|
||||
// Get parameters
|
||||
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||
|
||||
// Permissions
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
$section=$_GET["section"];
|
||||
if (! $section) $section='misc';
|
||||
$upload_dir = $conf->ecm->dir_output.'/'.$section;
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* ACTIONS
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
|
||||
// Envoie fichier
|
||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
||||
{
|
||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||
|
||||
if (is_dir($upload_dir))
|
||||
{
|
||||
$result = doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']);
|
||||
if ($result == 1)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
}
|
||||
else if (!$result)
|
||||
{
|
||||
// Echec transfert (fichier d?passant la limite ?)
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
// print_r($_FILES);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fichier infect? par un virus
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Suppression fichier
|
||||
if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
|
||||
{
|
||||
$file = $upload_dir . "/" . urldecode($_GET["urlfile"]);
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* PAGE
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
print_fiche_titre($langs->trans("Documents"));
|
||||
|
||||
//$head = societe_prepare_head($societe);
|
||||
|
||||
|
||||
//dolibarr_fiche_head($head, 'document', $societe->nom);
|
||||
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression d'une ligne produit
|
||||
*/
|
||||
if ($_GET['action'] == 'delete_file')
|
||||
{
|
||||
$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
// Construit liste des fichiers
|
||||
clearstatcache();
|
||||
$totalsize=0;
|
||||
$filearray=array();
|
||||
$errorlevel=error_reporting();
|
||||
error_reporting(0);
|
||||
$handle=opendir($upload_dir);
|
||||
error_reporting($errorlevel);
|
||||
if ($handle)
|
||||
{
|
||||
$i=0;
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
{
|
||||
$filearray[$i]->name=$file;
|
||||
$filearray[$i]->size=filesize($upload_dir."/".$file);
|
||||
$filearray[$i]->date=filemtime($upload_dir."/".$file);
|
||||
$totalsize+=$filearray[$i]->size;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
// print '<div class="error">'.$langs->trans("ErrorCanNotReadDir",$upload_dir).'</div>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
// Nbre fichiers
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>';
|
||||
|
||||
//Total taille
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
*/
|
||||
|
||||
|
||||
if ($mesg) { print $mesg."<br>"; }
|
||||
|
||||
|
||||
print $langs->trans("FeatureNotYetAvailable");
|
||||
|
||||
// End of page
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
104
htdocs/ecm/index.php
Normal file
104
htdocs/ecm/index.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdoc/google/index.php
|
||||
\ingroup google
|
||||
\brief Main google area page
|
||||
\version $Id$
|
||||
\author Laurent Destailleur
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
|
||||
// Load traductions files
|
||||
$langs->load("ecm");
|
||||
$langs->load("companies");
|
||||
$langs->load("other");
|
||||
|
||||
// Load permissions
|
||||
$user->getrights('ecm');
|
||||
|
||||
// Get parameters
|
||||
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||
|
||||
// Permissions
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
$section=$_GET["section"];
|
||||
if (! $section) $section='misc';
|
||||
$upload_dir = $conf->ecm->dir_output.'/'.$section;
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* ACTIONS
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
|
||||
// Envoie fichier
|
||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
||||
{
|
||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||
|
||||
if (is_dir($upload_dir))
|
||||
{
|
||||
$result = doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']);
|
||||
if ($result == 1)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
}
|
||||
else if (!$result)
|
||||
{
|
||||
// Echec transfert (fichier d?passant la limite ?)
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
// print_r($_FILES);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fichier infect? par un virus
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Suppression fichier
|
||||
if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
|
||||
{
|
||||
$file = $upload_dir . "/" . urldecode($_GET["urlfile"]);
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* PAGE
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
print_fiche_titre($langs->trans("ECMArea"));
|
||||
|
||||
|
||||
|
||||
|
||||
// End of page
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
35
htdocs/ecm/pre.inc.php
Normal file
35
htdocs/ecm/pre.inc.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/ecm/pre.inc.php
|
||||
\ingroup ecm
|
||||
\brief File to manage left menu for ecm module
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require ("../main.inc.php");
|
||||
|
||||
$user->getrights('ecm');
|
||||
|
||||
function llxHeader($head = "", $title="", $help_url='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
$langs->load("ecm");
|
||||
$langs->load("bills");
|
||||
$langs->load("propal");
|
||||
|
||||
top_menu($head, $title);
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/ecm/index.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("MenuECM"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/ecm/docmine.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsMine"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsThirdParties"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsInvoices"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsProposals"));
|
||||
|
||||
left_menu($menu->liste, $help_url);
|
||||
}
|
||||
?>
|
||||
@ -116,7 +116,7 @@ class MenuLeft {
|
||||
{
|
||||
$langs->load("users");
|
||||
|
||||
if($user->admin)
|
||||
if ($user->admin)
|
||||
{
|
||||
$langs->load("admin");
|
||||
|
||||
@ -707,7 +707,6 @@ class MenuLeft {
|
||||
{
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
$langs->load("admin");
|
||||
$langs->load("projects");
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/comm/clients.php?leftmenu=projects", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
@ -730,7 +729,6 @@ class MenuLeft {
|
||||
|
||||
if ($conf->mailing->enabled)
|
||||
{
|
||||
$langs->load("admin");
|
||||
$langs->load("mails");
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire);
|
||||
|
||||
@ -708,7 +708,6 @@ class MenuLeft {
|
||||
|
||||
if ($conf->mailing->enabled)
|
||||
{
|
||||
$langs->load("admin");
|
||||
$langs->load("mails");
|
||||
/*
|
||||
$newmenu->add(DOL_URL_ROOT."/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire);
|
||||
|
||||
@ -320,7 +320,7 @@ class MenuTop {
|
||||
// Members
|
||||
if ($conf->adherent->enabled)
|
||||
{
|
||||
$langs->load("members");
|
||||
// $langs->load("members"); Added in main file to increase
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members")
|
||||
@ -353,7 +353,9 @@ class MenuTop {
|
||||
// Define idsel
|
||||
if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $idsel='id="sel" ';
|
||||
else $idsel='';
|
||||
print '<td class="tmenu"><a class="tmenu" '.$idsel.'href="'.$url.'"'.($this->atarget?" target=$this->atarget":"").'>'.$tabMenu[$i]['titre'].'</a></td>';
|
||||
print '<td class="tmenu"><a class="tmenu" '.$idsel.'href="'.$url.'"'.($this->atarget?" target=$this->atarget":"").'>';
|
||||
print $tabMenu[$i]['titre'];
|
||||
print '</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -288,7 +288,7 @@ class MenuTop {
|
||||
// Members
|
||||
if ($conf->adherent->enabled)
|
||||
{
|
||||
$langs->load("members");
|
||||
// $langs->load("members"); Added in main file to increase
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members")
|
||||
|
||||
@ -200,70 +200,70 @@ class DolibarrModules
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Retourne le nom traduit du module si la traduction existe dans admin.lang,
|
||||
sinon le nom defini par defaut dans le module.
|
||||
\return string Nom du module traduit
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("admin");
|
||||
|
||||
if ($langs->trans("Module".$this->numero."Name") != ("Module".$this->numero."Name"))
|
||||
{
|
||||
// Si traduction du nom du module existe
|
||||
return $langs->trans("Module".$this->numero."Name");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si traduction du nom du module n'existe pas, on prend definition en dur dans module
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
/**
|
||||
\brief Retourne le nom traduit du module si la traduction existe dans admin.lang,
|
||||
sinon le nom defini par defaut dans le module.
|
||||
\return string Nom du module traduit
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("admin");
|
||||
|
||||
if ($langs->trans("Module".$this->numero."Name") != ("Module".$this->numero."Name"))
|
||||
{
|
||||
// Si traduction du nom du module existe
|
||||
return $langs->trans("Module".$this->numero."Name");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si traduction du nom du module n'existe pas, on prend definition en dur dans module
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Retourne la description traduite du module si la traduction existe dans admin.lang,
|
||||
sinon la description definie par defaut dans le module.
|
||||
\return string Nom du module traduit
|
||||
*/
|
||||
function getDesc()
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("admin");
|
||||
|
||||
if ($langs->trans("Module".$this->numero."Desc") != ("Module".$this->numero."Desc"))
|
||||
{
|
||||
// Si traduction de la description du module existe
|
||||
return $langs->trans("Module".$this->numero."Desc");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si traduction de la description du module n'existe pas, on prend definition en dur dans module
|
||||
return $this->description;
|
||||
}
|
||||
}
|
||||
/**
|
||||
\brief Retourne la description traduite du module si la traduction existe dans admin.lang,
|
||||
sinon la description definie par defaut dans le module.
|
||||
\return string Nom du module traduit
|
||||
*/
|
||||
function getDesc()
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("admin");
|
||||
|
||||
if ($langs->trans("Module".$this->numero."Desc") != ("Module".$this->numero."Desc"))
|
||||
{
|
||||
// Si traduction de la description du module existe
|
||||
return $langs->trans("Module".$this->numero."Desc");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si traduction de la description du module n'existe pas, on prend definition en dur dans module
|
||||
return $this->description;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Retourne la version du module.
|
||||
Pour les modules a l'etat 'experimental', retourne la traduction de 'experimental'
|
||||
Pour les modules 'dolibarr', retourne la version de Dolibarr
|
||||
Pour les autres modules, retourne la version du module
|
||||
\return string Version du module
|
||||
*/
|
||||
function getVersion()
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("admin");
|
||||
|
||||
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
|
||||
elseif ($this->version == 'development') return $langs->trans("VersionDevelopment");
|
||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
||||
elseif ($this->version) return $this->version;
|
||||
else return $langs->trans("VersionUnknown");
|
||||
}
|
||||
/**
|
||||
\brief Retourne la version du module.
|
||||
Pour les modules a l'etat 'experimental', retourne la traduction de 'experimental'
|
||||
Pour les modules 'dolibarr', retourne la version de Dolibarr
|
||||
Pour les autres modules, retourne la version du module
|
||||
\return string Version du module
|
||||
*/
|
||||
function getVersion()
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("admin");
|
||||
|
||||
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
|
||||
elseif ($this->version == 'development') return $langs->trans("VersionDevelopment");
|
||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
||||
elseif ($this->version) return $this->version;
|
||||
else return $langs->trans("VersionUnknown");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -279,7 +279,6 @@ class DolibarrModules
|
||||
$sql .= " WHERE numero=".$this->numero." AND active = 1";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -294,7 +293,6 @@ class DolibarrModules
|
||||
$this->db->free($resql);
|
||||
}
|
||||
|
||||
|
||||
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
|
||||
elseif ($this->version == 'development') return $langs->trans("VersionDevelopment");
|
||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
||||
|
||||
@ -101,7 +101,7 @@ class modECM extends DolibarrModules
|
||||
|
||||
$this->menu[$r]=array('fk_menu'=>0,
|
||||
'type'=>'top',
|
||||
'titre'=>'ECM',
|
||||
'titre'=>'MenuECM(dotnoloadlang)',
|
||||
'mainmenu'=>'ecm',
|
||||
'leftmenu'=>'',
|
||||
'url'=>'/ecm/index.php',
|
||||
|
||||
@ -174,6 +174,7 @@ ModuleFamilyOther=Other
|
||||
ModuleFamilyTechnic=Tools or System Modules
|
||||
ModuleFamilyExperimental=Experimental modules
|
||||
ModuleFamilyFinancial=Financial Modules (Accountancy/Treasury)
|
||||
ModuleFamilyECM=ECM
|
||||
MenuHandlers=Menu handlers
|
||||
MenuAdmin=Menu editor
|
||||
ThisIsProcessToFollow=This is setup to process:
|
||||
@ -271,6 +272,10 @@ Module2200Name=Droit de pr
|
||||
Module2200Desc=Gestion du droit de prêts
|
||||
Module2300Name=Menus
|
||||
Module2300Desc=Menus' management
|
||||
Module2400Name=Agenda
|
||||
Module2400Desc=Agenda and actions management
|
||||
Module2500Name=Electronic Content Management
|
||||
Module2500Desc=Save and share documents
|
||||
Permission11=Read invoices
|
||||
Permission12=Create invoices
|
||||
Permission13=Modify invoices
|
||||
|
||||
7
htdocs/langs/en_US/ecm.lang
Normal file
7
htdocs/langs/en_US/ecm.lang
Normal file
@ -0,0 +1,7 @@
|
||||
# Dolibarr language file - en_US - ecm
|
||||
MenuECM=Documents
|
||||
DocsMine=My documents
|
||||
DocsThirdParties=Documents third parties
|
||||
DocsInvoices=Documents invoices
|
||||
DocsProposals=Documents proposals
|
||||
ECMArea=Electronic Content Management area
|
||||
@ -411,6 +411,7 @@ TotalWoman=Total
|
||||
TotalMan=Total
|
||||
YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this list from menu setup - dictionnary
|
||||
Color=Color
|
||||
MenuECM=Documents
|
||||
# Week day
|
||||
Monday=Monday
|
||||
Tuesday=Tuesday
|
||||
|
||||
@ -173,6 +173,7 @@ ModuleFamilyOther=Autre
|
||||
ModuleFamilyTechnic=Modules outils ou système
|
||||
ModuleFamilyExperimental=Modules expérimentaux (ne pas utiliser en production)
|
||||
ModuleFamilyFinancial=Modules financiers (Compta/trésorerie)
|
||||
ModuleFamilyECM=GED
|
||||
MenuHandlers=Gestionnaires menu
|
||||
MenuAdmin=Edition menu
|
||||
ThisIsProcessToFollow=Voici la procédure à suivre:
|
||||
@ -270,6 +271,10 @@ Module2200Name=Droit de pr
|
||||
Module2200Desc=Gestion du droit de prêts
|
||||
Module2300Name=Menus
|
||||
Module2300Desc=Administration des menus par base de données
|
||||
Module2400Name=Agenda
|
||||
Module2400Desc=Gestion de l'agenda et des actions
|
||||
Module2500Name=Gestion Electronique de Document
|
||||
Module2500Desc=Permet de stocker et administrer une base de documents
|
||||
Permission11=Consulter les factures
|
||||
Permission12=Créer les factures
|
||||
Permission13=Modifier les factures
|
||||
|
||||
7
htdocs/langs/fr_FR/ecm.lang
Normal file
7
htdocs/langs/fr_FR/ecm.lang
Normal file
@ -0,0 +1,7 @@
|
||||
# Dolibarr language file - fr_FR - ecm
|
||||
MenuECM=Documents
|
||||
DocsMine=Mes documents
|
||||
DocsThirdParties=Documents tiers
|
||||
DocsInvoices=Documents factures
|
||||
DocsProposals=Documents propositions
|
||||
ECMArea=Espace Gestion de documents
|
||||
@ -413,6 +413,7 @@ TotalWoman=Totale
|
||||
TotalMan=Total
|
||||
YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeurs depuis le menu configuration - dictionnaires
|
||||
Color=Couleur
|
||||
MenuECM=Documents
|
||||
# Week day
|
||||
Monday=Lundi
|
||||
Tuesday=Mardi
|
||||
|
||||
@ -523,7 +523,15 @@ class Menubase
|
||||
|
||||
if ($this->verifConstraint($objm->rowid))
|
||||
{
|
||||
$langs->load($objm->langs);
|
||||
$title=$objm->titre;
|
||||
if (! eregi('\(dotnoloadlang\)$',$title))
|
||||
{
|
||||
if (! empty($objm->langs)) $langs->load($objm->langs);
|
||||
}
|
||||
else
|
||||
{
|
||||
$title=eregi_replace('\(dotnoloadlang\)$','',$title);
|
||||
}
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == $objm->mainmenu)
|
||||
@ -540,14 +548,14 @@ class Menubase
|
||||
eval($str);
|
||||
}
|
||||
|
||||
if(eregi("/",$objm->titre))
|
||||
if(eregi("/",$title))
|
||||
{
|
||||
$tab_titre = explode("/",$objm->titre);
|
||||
$tab_titre = explode("/",$title);
|
||||
$chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$chaine = $langs->trans($objm->titre);
|
||||
$chaine = $langs->trans($title);
|
||||
}
|
||||
|
||||
$tabMenu[$b]['rowid'] = $objm->rowid;
|
||||
|
||||
@ -751,7 +751,7 @@ function top_menu($head, $title="", $target="")
|
||||
* Si la constante MAIN_NEED_UPDATE est definie (par le script de migration sql en general), c'est que
|
||||
* les donnees ont besoin d'un remaniement. Il faut passer le update.php
|
||||
*/
|
||||
if (isset($conf->global->MAIN_NEED_UPDATE) && $conf->global->MAIN_NEED_UPDATE)
|
||||
if (! empty($conf->global->MAIN_NEED_UPDATE))
|
||||
{
|
||||
$langs->load("admin");
|
||||
print '<div class="fiche">'."\n";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* ***************************************************************************
|
||||
* Copyright (C) 2001 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2005 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2008 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -21,6 +21,7 @@
|
||||
/**
|
||||
\file htdocs/translate.class.php
|
||||
\brief Fichier de la classe de traduction
|
||||
\author Eric Seigne
|
||||
\author Laurent Destailleur
|
||||
\version $Id$
|
||||
*/
|
||||
@ -153,7 +154,15 @@ class Translate {
|
||||
*/
|
||||
function Load($domain,$alt=0)
|
||||
{
|
||||
if (! empty($this->tab_loaded[$domain])) { return; } // Le fichier de ce domaine est deja charge
|
||||
// Check parameters
|
||||
if (empty($domain))
|
||||
{
|
||||
dolibarr_syslog("Tranlsate::Load ErrorWrongParameters",LOG_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check cache
|
||||
if (! empty($this->tab_loaded[$domain])) { return; } // Le fichier de ce domaine est deja charge
|
||||
|
||||
// Repertoire de traduction
|
||||
$scandir = $this->dir."/".$this->defaultlang;
|
||||
@ -168,15 +177,15 @@ class Translate {
|
||||
elseif (eregi('^en',$this->defaultlang) && $this->defaultlang != 'en_US') $scandiralt = $this->dir."/en_US";
|
||||
else $scandiralt = $this->dir."/en_US";
|
||||
|
||||
$file_lang = $scandiralt . "/$domain.lang";
|
||||
$file_lang = $scandiralt . "/".$domain.".lang";
|
||||
$filelangexists=is_file($file_lang);
|
||||
$alt=1;
|
||||
}
|
||||
|
||||
dolibarr_syslog("Translate::Load read file ".$file_lang);
|
||||
|
||||
if ($filelangexists)
|
||||
{
|
||||
//dolibarr_syslog("Translate::Load read file ".$file_lang);
|
||||
|
||||
// Enable cache of lang file in session (faster but need more memory)
|
||||
// Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file)
|
||||
$enablelangcacheinsession=false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user