*/ /** \file htdoc/ecm/index.php \ingroup ecm \brief Main page for ECM section area \version $Id$ \author Laurent Destailleur */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/ecmdirectory.class.php"); // Load traductions files $langs->load("ecm"); $langs->load("companies"); $langs->load("other"); $langs->load("users"); $langs->load("orders"); $langs->load("propal"); $langs->load("bills"); $langs->load("contracts"); // Load permissions $user->getrights('ecm'); // Get parameters $socid = isset($_GET["socid"])?$_GET["socid"]:''; $section=$_GET["section"]; if (! $section) $section='misc'; $upload_dir = $conf->ecm->dir_output.'/'.$section; $page=$_GET["page"]; $sortorder=$_GET["sortorder"]; $sortfield=$_GET["sortfield"]; $limit = $conf->liste_limit; $offset = $limit * $page ; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="label"; $ecmdir = new ECMDirectory($db); if (! empty($_GET["section"])) { $result=$ecmdir->fetch($_GET["section"]); if (! $result > 0) { dolibarr_print_error($db,$ecmdir->error); exit; } } /******************************************************************* * ACTIONS * * Put here all code to do according to value of "action" parameter ********************************************************************/ // Action ajout d'un produit ou service if ($_POST["action"] == 'add' && $user->rights->ecm->setup) { $ecmdir->ref = $_POST["ref"]; $ecmdir->label = $_POST["label"]; $ecmdir->description = $_POST["desc"]; $id = $ecmdir->create($user); if ($id > 0) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { $mesg='
Error '.$langs->trans($ecmdir->error).'
'; $_GET["action"] = "create"; } } // Suppression fichier if ($_POST['action'] == 'confirm_deletesection' && $_POST['confirm'] == 'yes') { $result=$ecmdir->delete($user); $mesg = '
'.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'
'; } /******************************************************************* * PAGE * * Put here all code to do according to value of "action" parameter ********************************************************************/ llxHeader(); $form=new Form($db); $ecmdirstatic = new ECMDirectory($db); $userstatic = new User($db); if (! $_GET["action"] || $_GET["action"] == 'delete_section') { //*********************** // List //*********************** print_fiche_titre($langs->trans("ECMArea")); print $langs->trans("ECMAreaDesc")."
"; print $langs->trans("ECMAreaDesc2")."
"; print "
\n"; print ''; print '
'; //print_fiche_titre($langs->trans("ECMManualOrg")); print '
'; print ''; print ""; print ''; print "'; print ''; print "'; print ''; print "
'.$langs->trans("ECMSearchByKeywords").'
".$langs->trans("Title").':
".$langs->trans("Keyword").':

"; //print $langs->trans("ECMManualOrgDesc"); print '
'; //print_fiche_titre($langs->trans("ECMAutoOrg")); print '
'; print ''; print ""; print ''; $buthtml=''; $butshown=0; if ($conf->societe->enabled) { print "'.($butshown?'':$buthtml).''; $butshown=1; } if ($conf->contrat->enabled) { print "'.($butshown?'':$buthtml).''; $butshown=1; } if ($conf->propal->enabled) { print "'.($butshown?'':$buthtml).''; $butshown=1; } if ($conf->commande->enabled) { print "'.($butshown?'':$buthtml).''; $butshown=1; } if ($conf->facture->enabled) { print "'.($butshown?'':$buthtml).''; $butshown=1; } print "
'.$langs->trans("ECMSearchByEntity").'
".$langs->trans("ThirdParty").':
".$langs->trans("Contrat").':
".$langs->trans("Proposal").':
".$langs->trans("Order").':
".$langs->trans("Invoice").':

"; //print $langs->trans("ECMAutoOrgDesc"); print '
'; } // End of page $db->close(); llxFooter('$Date$ - $Revision$'); ?>