* * 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. */ /** \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="ASC"; if (! $sortfield) $sortfield="label"; $ecmdir = new ECMDirectory($db); if (! empty($_REQUEST["section"])) { $result=$ecmdir->fetch($_REQUEST["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='
| ';
//print_fiche_titre($langs->trans("ECMManualOrg"));
print ' "; //print $langs->trans("ECMManualOrgDesc"); print ' | ';
//print_fiche_titre($langs->trans("ECMAutoOrg"));
print ' "; //print $langs->trans("ECMAutoOrgDesc"); print ' |
| '.$langs->trans("ECMSectionAuto").' | '; print ''.$langs->trans("Description").' | '; print ''.$langs->trans("ECMNbOfDocsSmall").' | '; print ''; print ' '; print ' | '; print '||
| '; print img_picto('','object_dir').' '; print ''; print $val['label']; print ''; print " | \n"; // Description print ''.$val['desc'].' | '; print '? | '; print '';
$htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].' '; $htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMAutoOrg").' '; $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$langs->trans("ECMTypeAuto"); print $form->textwithhelp('',$htmltooltip,1,0); print ' | ';
print "||
| '.$langs->trans("ECMSectionManual").' | '; print ''.$langs->trans("Description").' | '; print ''.$langs->trans("ECMNbOfDocsSmall"); print ''.img_picto($langs->trans("Refresh"),'refresh').''; print ' | '; print ''; if ($user->rights->ecm->setup) { print ''.img_picto($langs->trans("ECMNewSection"),'edit_add').''; } else { print ' '; } print ' | '; print '||
| '; print str_repeat(' ',$val['level']-1); print $ecmdirstatic->getNomUrl(1); print " | \n"; // Description print ''.dolibarr_trunc($val['description'],32).' | '; // Nb of docs //print ''.$obj->cachenbofdoc.' | '; print ''.$val['cachenbofdoc'].' | '; print '';
$userstatic->id=$val['fk_user_c'];
$userstatic->nom=$val['login_c'];
$htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].' '; $htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMManualOrg").' '; $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$userstatic->getNomUrl(1).' '; $htmltooltip.=''.$langs->trans("ECMCreationDate").': '.dolibarr_print_date($val['date_c'],"dayhour"); print $form->textwithhelp('',$htmltooltip,1,0); print " | |
| '.$langs->trans("ECMNoDirecotyYet").' | |||||