/[dolibarr]/dolibarr/htdocs/admin/propale.php
ViewVC logotype

Diff of /dolibarr/htdocs/admin/propale.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.31 by eldy, Sat Jun 11 11:11:17 2005 UTC revision 1.32 by eldy, Mon Aug 22 19:40:50 2005 UTC
# Line 23  Line 23 
23   * $Source$   * $Source$
24   */   */
25    
26  /**         \file       htdocs/admin/propale.php  /**
27                \file       htdocs/admin/propale.php
28                  \ingroup    propale                  \ingroup    propale
29                  \brief      Page d'administration/configuration du module Propale                  \brief      Page d'administration/configuration du module Propale
30                  \version    $Revision$                  \version    $Revision$
# Line 40  if (!$user->admin) Line 41  if (!$user->admin)
41    
42  if ($_POST["action"] == 'nbprod')  if ($_POST["action"] == 'nbprod')
43  {  {
44    dolibarr_set_const($db, "PROPALE_NEW_FORM_NB_PRODUCT",$value);      dolibarr_set_const($db, "PROPALE_NEW_FORM_NB_PRODUCT",$value);
45    Header("Location: propale.php");      Header("Location: propale.php");
46  }  }
   
 llxHeader();  
   
   
47  if ($_GET["action"] == 'set')  if ($_GET["action"] == 'set')
48  {  {
49    $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$_GET["value"]."')";      $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$_GET["value"]."')";
50    
51    if ($db->query($sql))      if ($db->query($sql))
52      {      {
53    
54      }      }
55  }  }
56  if ($_GET["action"] == 'del')  if ($_GET["action"] == 'del')
57  {  {
58    $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom='".$_GET["value"]."'";      $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom='".$_GET["value"]."'";
59    
60    if ($db->query($sql))      if ($db->query($sql))
61      {      {
62    
63      }      }
64  }  }
65    
 // positionne la variable pour le test d'affichage de l'icone  
66    
67  $propale_addon_var_pdf = PROPALE_ADDON_PDF;  $propale_addon_var_pdf = $conf->global->PROPALE_ADDON_PDF;
68    
69  if ($_GET["action"] == 'setpdf')  if ($_GET["action"] == 'setpdf')
70  {  {
# Line 90  if ($_GET["action"] == 'setpdf') Line 86  if ($_GET["action"] == 'setpdf')
86      }      }
87  }  }
88    
89  $propale_addon_var = PROPALE_ADDON;  $propale_addon_var = $conf->global->PROPALE_ADDON;
90    
91  if ($_GET["action"] == 'setmod')  if ($_GET["action"] == 'setmod')
92  {  {
93        // \todo Verifier si module numerotation choisi peut etre activé
94        // par appel methode canBeActivated
95    
96    
97    
98          if (dolibarr_set_const($db, "PROPALE_ADDON",$_GET["value"]))          if (dolibarr_set_const($db, "PROPALE_ADDON",$_GET["value"]))
99      {      {
100        // la constante qui a été lue en avant du nouveau set        // la constante qui a été lue en avant du nouveau set
# Line 103  if ($_GET["action"] == 'setmod') Line 104  if ($_GET["action"] == 'setmod')
104  }  }
105    
106    
   
107  /*  /*
108   * Affiche page   * Affiche page
109   */   */
110    
111    $dir = "../includes/modules/propale/";
112    
113    
114    llxHeader('',$langs->trans("PropalSetup"));
115    
116  print_titre($langs->trans("PropalSetup"));  print_titre($langs->trans("PropalSetup"));
117    
 print "<br>";  
118    
119    /*
120     *  Module numérotation
121     */
122    print "<br>";
123  print_titre($langs->trans("ProposalsNumberingModules"));  print_titre($langs->trans("ProposalsNumberingModules"));
124    
125  print "<table class=\"noborder\" width=\"100%\">\n";  print '<table class="noborder" width="100%">';
126  print "<tr class=\"liste_titre\">\n";  print '<tr class="liste_titre">';
127  print "  <td>".$langs->trans("Name")."</td>\n";  print '<td>'.$langs->trans("Name")."</td>\n";
128  print "  <td>".$langs->trans("Description")."</td>\n";  print '<td>'.$langs->trans("Description")."</td>\n";
129  print "  <td>".$langs->trans("Example")."</td>\n";  print '<td nowrap>'.$langs->trans("Example")."</td>\n";
130  print "  <td align=\"center\">".$langs->trans("Activated")."</td>\n";  print '<td align="center" width="60">'.$langs->trans("Activated")."</td>\n";
131  print "</tr>\n";  print '<td nowrap>'.$langs->trans("NextValue")."</td>\n";
132    print '</tr>'."\n";
133    
134  clearstatcache();  clearstatcache();
135    
 $dir = "../includes/modules/propale/";  
136  $handle = opendir($dir);  $handle = opendir($dir);
137  if ($handle)  if ($handle)
138  {  {
139    $var=true;      $var=true;
140    while (($file = readdir($handle))!==false)      while (($file = readdir($handle))!==false)
141      {      {
142        if (substr($file, 0, 12) == 'mod_propale_' && substr($file, strlen($file)-3, 3) == 'php')          if (substr($file, 0, 12) == 'mod_propale_' && substr($file, strlen($file)-3, 3) == 'php')
143          {          {
144            $file = substr($file, 0, strlen($file)-4);              $file = substr($file, 0, strlen($file)-4);
145    
146            require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$file.".php");              require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$file.".php");
147    
148            $modPropale = new $file;              $modPropale = new $file;
149    
150        $var=!$var;              $var=!$var;
151            print "<tr ".$bc[$var].">\n  <td width=\"140\">".$file."</td>";              print "<tr ".$bc[$var].">\n  <td width=\"140\">".$file."</td>";
152            print "\n  <td>".$modPropale->info()."</td>\n";              print "\n  <td>".$modPropale->info()."</td>\n";
153            print "\n  <td>".$modPropale->getExample()."</td>\n";              print "\n  <td nowrap>".$modPropale->getExample()."</td>\n";
154              
155            if ($propale_addon_var == "$file")              if ($propale_addon_var == "$file")
156              {              {
157                print '<td align="center">';                  print '<td align="center">';
158            print img_tick();                  print img_tick();
159                    print '</td>';                  print '</td>';
160              }                  print "\n  <td nowrap>".$modPropale->getNextValue()."</td>\n";
161            else              }
162              {              else
163                    print "<td align=\"center\"><a href=\"propale.php?action=setmod&amp;value=".$file."\">".$langs->trans("Activate")."</a></td>\n";              {
164              }                  print "<td align=\"center\"><a href=\"propale.php?action=setmod&amp;value=".$file."\">".$langs->trans("Activate")."</a></td>\n";
165                                  print "\n  <td nowrap>&nbsp;</td>\n";
166            print "</tr>\n";              }
167          }  
168    
169                print "</tr>\n";
170            }
171      }      }
172    closedir($handle);      closedir($handle);
173  }  }
174  print "</table><br>\n";  print "</table><br>\n";
175    

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26