Jump to content

Quelles modifs ont été faite dans mon PRESTASHOP?


Recommended Posts

Bonjour et bonne année a tous.

Jusqu'à présent, je notais, sur supports sur plus ou moins volatiles, toutes les modifications que je faisais sur mon site.

Donc ai eu cette Idée.
J'ai crée un nommée table Développement
Puis j'ai créé ce fichier PHP AdminDev.php que j'ai mis Dans la partie /admin/cp/
La partie lecture fonctionne bien, mais les parties Création / Modifications / Suppressions me posent soucis.

Si quelqu'un pouvait m'indiquer le Pb, je le ou la remercie d'avance.

Le code source et tuto d'installation seront, bien sur, mis la disposition de tout le monde.

Table SQL
---------

--
-- Structure de la table `ps_developpement`
--

CREATE TABLE IF NOT EXISTS `ps_developpement` (
 `id_developpement` int(11) NOT NULL AUTO_INCREMENT,
 `numero` int(10) NOT NULL,
 `date` datetime NOT NULL DEFAULT '2009-01-01 00:00:00',
 `modifications` text NOT NULL,
 PRIMARY KEY (`id_developpement`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
[/Code]




[size=3] Source PHP [/size]
----------

[code]
<?php

//                 @version 0.1

include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php');

class AdminDev extends AdminTab
{
    /** @var array profiles list */
   private $profilesArray = array();

   public function __construct()
   {
           global $cookie;

        $this->table = 'developpement';
        $this->className = 'AdminDev';
        $this->lang = false;
        $this->edit = true;
        $this->delete = true;

               $this->fieldsDisplay = array(
       'id_developpement' => array('title' => $this->l('id_developpement'), 'align' => 'center', 'width' => 25),
               'date' => array('title' => $this->l('Date'), 'width' => 130),
       'modifications' => array('title' => $this->l('Modifications'), 'width' => 380));

               parent::__construct();
       }

   public function displayForm()
   {
       global $currentIndex, $cookie;

       $obj = $this->loadObject(true);
       $profiles = Profile::getProfiles(intval($cookie->id_lang));

       echo '
       <form action="'.$currentIndex.'&submitAdd;'.$this->table.'=1&token;='.$this->token.'" method="post" enctype="multipart/form-data" class="width2">
       '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'


'.$this->l('Nouvelle modification.').'
'.
                               'Table = ' . $this->table . '

                               Id = ' . $obj->id . '



'.$this->l('Date:').'   

                   <input type="text" size="33" name="Date" value="'.htmlentities($this->getFieldValue($obj, 'date'), ENT_COMPAT, 'UTF-8').'" ;  />
                                       <input type="image" src='.'../img/admin/calendar_2.png'.'>



'.$this->l('Modification:').' 

                   <textarea  cols="100" rows="20"  name="Modifications" value="'.htmlentities($this->getFieldValue($obj, 'modifications'), ENT_COMPAT, 'UTF-8').'" style="text-transform: capitalize;" />
                                           </TEXTAREA>


                               <input type="submit" value="'.$this->l('   Sauver   ').'" name="submitAdd'.$this->table.'" class="button" />


       </form>';
   }
}
?>




Voila ce que cela donne pour l'instant.

A +

16570_eboO8tqr8hPprhhXNZSx_t

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...