1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Changeset 4471

Show
Ignore:
Timestamp:
06/18/12 09:03:10 (12 months ago)
Author:
oscim
Message:

coquille

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/catalog/admin/includes/modules/pages/products.php

    r4433 r4471  
    2525 
    2626  /** 
    27     @def FILENAME current page  
     27    @def FILENAME current page 
    2828  */ 
    2929  const FILENAME = FILENAME_PRODUCTS; 
    3030  /** 
    31     @var int current id  
     31    @var int current id 
    3232  */ 
    3333  public static $Id; 
     
    174174                */ 
    175175                self::$allfields = array( 
    176                                                                                         'p.products_id' => array(  
    177                                                                                                                                 'sort'=>true,  
    178                                                                                                                                 'alias'=>'id',  
     176                                                                                        'p.products_id' => array( 
     177                                                                                                                                'sort'=>true, 
     178                                                                                                                                'alias'=>'id', 
    179179                                                                                                                                'text'=>__('products table heading id'), 
    180                                                                                                                                 'width'=>'2%',  
     180                                                                                                                                'width'=>'2%', 
    181181                                                                                                                                'class'=>'tcenter', 
    182182                                                                                                                                'default'=>true, 
    183                                                                                                         ),  
    184                                                                                         'p.products_image' => array(  
    185                                                                                                                                 'sort'=>true,  
    186                                                                                                                                 'alias'=>'image',  
     183                                                                                                        ), 
     184                                                                                        'p.products_image' => array( 
     185                                                                                                                                'sort'=>true, 
     186                                                                                                                                'alias'=>'image', 
    187187                                                                                                                                'text'=>__('products table heading image'), 
    188                                                                                                         ),  
    189                                                                                         'pd.products_name' => array(  
    190                                                                                                                                 'sort'=>true,  
    191                                                                                                                                 'alias'=>'title',  
     188                                                                                                        ), 
     189                                                                                        'pd.products_name' => array( 
     190                                                                                                                                'sort'=>true, 
     191                                                                                                                                'alias'=>'title', 
    192192                                                                                                                                'text'=>__('products table heading name'), 
    193193                                                                                                                                'default'=>true, 
    194                                                                                                                                 'width'=>'18%',  
    195                                                                                                         ),  
    196                                                                                         'p.products_model' => array(  
    197                                                                                                                                 'sort'=>true,  
    198                                                                                                                                 'alias'=>'model',  
     194                                                                                                                                'width'=>'18%', 
     195                                                                                                        ), 
     196                                                                                        'p.products_model' => array( 
     197                                                                                                                                'sort'=>true, 
     198                                                                                                                                'alias'=>'model', 
    199199                                                                                                                                'text'=>__('products table heading modele'), 
    200                                                                                                         ),  
     200                                                                                                        ), 
    201201                                                                                        ); 
    202202                        /* DEB  Datatype RootListing categorie */ 
    203203                        if( DataTypes::is_active('categorie')) { 
    204                                 self::$allfields['cat.categories_id']= array(  
    205                                                                                                                                 'sort'=>true,  
    206                                                                                                                                 'alias'=>'categories_id',  
     204                                self::$allfields['cat.categories_id']= array( 
     205                                                                                                                                'sort'=>true, 
     206                                                                                                                                'alias'=>'categories_id', 
    207207                                                                                                                                'text'=>__('products table heading categories id'), 
    208                                                                                                                                 'width'=>'6%',  
    209                                                                                                         ); 
    210                                 self::$allfields['catd.categories_name']= array(  
    211                                                                                                                                 'sort'=>true,  
    212                                                                                                                                 'alias'=>'cat_title',  
     208                                                                                                                                'width'=>'6%', 
     209                                                                                                        ); 
     210                                self::$allfields['catd.categories_name']= array( 
     211                                                                                                                                'sort'=>true, 
     212                                                                                                                                'alias'=>'cat_title', 
    213213                                                                                                                                'text'=>__('products table heading categories'), 
    214                                                                                                                                 'width'=>'12%',  
     214                                                                                                                                'width'=>'12%', 
    215215                                                                                                                                'default'=>true, 
    216216                                                                                                        ); 
     
    220220                        /* DEB  Datatype RootListing manufacturer */ 
    221221                        if( DataTypes::is_active('manufacturer')) { 
    222                                 self::$allfields['p.manufacturers_id']= array(  
    223                                                                                                                                 'sort'=>true,  
    224                                                                                                                                 'alias'=>'manufacturers_id',  
     222                                self::$allfields['p.manufacturers_id']= array( 
     223                                                                                                                                'sort'=>true, 
     224                                                                                                                                'alias'=>'manufacturers_id', 
    225225                                                                                                                                'text'=>__('products table heading manufacturers id'), 
    226                                                                                                         );  
    227                                 self::$allfields['m.manufacturers_name']= array(  
    228                                                                                                                                 'sort'=>true,  
    229                                                                                                                                 'alias'=>'manuf_title',  
     226                                                                                                        ); 
     227                                self::$allfields['m.manufacturers_name']= array( 
     228                                                                                                                                'sort'=>true, 
     229                                                                                                                                'alias'=>'manuf_title', 
    230230                                                                                                                                'text'=>__('products table heading manufacturers'), 
    231                                                                                                                                 'width'=>'12%',  
    232                                                                                                         );  
     231                                                                                                                                'width'=>'12%', 
     232                                                                                                        ); 
    233233                        } 
    234234                        /* END  Datatype RootListing manufacturer */ 
     
    237237                        /* DEB  Datatype RootListing featured */ 
    238238                        if( DataTypes::is_active('featured')) { 
    239                                 self::$allfields['fada.featured_id']= array(  
    240                                                                                                                                 'sort'=>true,  
    241                                                                                                                                 'alias'=>'featured_id',  
     239                                self::$allfields['fada.featured_id']= array( 
     240                                                                                                                                'sort'=>true, 
     241                                                                                                                                'alias'=>'featured_id', 
    242242                                                                                                                                'text'=>__('products table heading featured id'), 
    243                                                                                                         );  
    244                                 self::$allfields['fad.featured_title']= array(  
    245                                                                                                                                 'sort'=>true,  
    246                                                                                                                                 'alias'=>'featured',  
     243                                                                                                        ); 
     244                                self::$allfields['fad.featured_title']= array( 
     245                                                                                                                                'sort'=>true, 
     246                                                                                                                                'alias'=>'featured', 
    247247                                                                                                                                'text'=>__('products table heading featured'), 
    248                                                                                                                                 'width'=>'12%',  
    249                                                                                                         );  
     248                                                                                                                                'width'=>'12%', 
     249                                                                                                        ); 
    250250                        } 
    251251                        /* END  Datatype RootListing featured */ 
    252252 
    253                         self::$allfields['p.products_weight']= array(  
    254                                                                                                                                 'sort'=>true,  
    255                                                                                                                                 'alias'=>'weight',  
     253                        self::$allfields['p.products_weight']= array( 
     254                                                                                                                                'sort'=>true, 
     255                                                                                                                                'alias'=>'weight', 
    256256                                                                                                                                'text'=>__('products table heading weight'), 
    257257                                                                                                                                'default'=>true, 
    258                                                                                                         );  
    259  
    260                         self::$allfields['p.products_price']= array(  
    261                                                                                                                                 'sort'=>true,  
    262                                                                                                                                 'alias'=>'price',  
     258                                                                                                        ); 
     259 
     260                        self::$allfields['p.products_price']= array( 
     261                                                                                                                                'sort'=>true, 
     262                                                                                                                                'alias'=>'price', 
    263263                                                                                                                                'text'=>__('products table heading price'), 
    264                                                                                                         );  
     264                                                                                                        ); 
    265265/* 
    266                         self::$allfields['p.products_price']= array(  
    267                                                                                                                                 'sort'=>false,  
    268                                                                                                                                 'alias'=>'price_ttx',  
     266                        self::$allfields['p.products_price']= array( 
     267                                                                                                                                'sort'=>false, 
     268                                                                                                                                'alias'=>'price_ttx', 
    269269                                                                                                                                'text'=>__('products table heading price taxe'), 
    270270                                                                                                        ); */ 
    271271 
    272                         self::$allfields['p.products_tax_class_id']= array(  
    273                                                                                                                                 'sort'=>true,  
    274                                                                                                                                 'alias'=>'taxe_id',  
     272                        self::$allfields['p.products_tax_class_id']= array( 
     273                                                                                                                                'sort'=>true, 
     274                                                                                                                                'alias'=>'taxe_id', 
    275275                                                                                                                                'text'=>__('products table heading taxe id'), 
    276276                                                                                                        ); 
    277277 
    278278                        if(_cst_bool('STOCK_CHECK')) { 
    279                                 self::$allfields['p.products_quantity']= array(  
    280                                                                                                                                 'sort'=>true,  
    281                                                                                                                                 'alias'=>'quantity',  
     279                                self::$allfields['p.products_quantity']= array( 
     280                                                                                                                                'sort'=>true, 
     281                                                                                                                                'alias'=>'quantity', 
    282282                                                                                                                                'text'=>__('products table heading quantity'), 
    283                                                                                                         );  
    284                                 self::$allfields['p.track_stock']= array(  
    285                                                                                                                                 'sort'=>true,  
    286                                                                                                                                 'alias'=>'track_stock',  
     283                                                                                                        ); 
     284                                self::$allfields['p.track_stock']= array( 
     285                                                                                                                                'sort'=>true, 
     286                                                                                                                                'alias'=>'track_stock', 
    287287                                                                                                                                'text'=>__('products table heading track_stock'), 
    288                                                                                                         );  
     288                                                                                                        ); 
    289289                        } 
    290290 
    291                         self::$allfields['p.products_date_added']= array(  
    292                                                                                                                                 'sort'=>true,  
    293                                                                                                                                 'alias'=>'added',  
     291                        self::$allfields['p.products_date_added']= array( 
     292                                                                                                                                'sort'=>true, 
     293                                                                                                                                'alias'=>'added', 
    294294                                                                                                                                'text'=>__('products table heading date_added'), 
    295                                                                                                         );  
    296                         self::$allfields['p.products_last_modified']=  array(  
    297                                                                                                                                 'sort'=>true,  
    298                                                                                                                                 'alias'=>'modified',  
     295                                                                                                        ); 
     296                        self::$allfields['p.products_last_modified']=  array( 
     297                                                                                                                                'sort'=>true, 
     298                                                                                                                                'alias'=>'modified', 
    299299                                                                                                                                'text'=>__('products table heading last modified'), 
    300300                                                                                                        ); 
    301                         self::$allfields['p.products_date_available']=  array(  
    302                                                                                                                                 'sort'=>true,  
    303                                                                                                                                 'alias'=>'available',  
     301                        self::$allfields['p.products_date_available']=  array( 
     302                                                                                                                                'sort'=>true, 
     303                                                                                                                                'alias'=>'available', 
    304304                                                                                                                                'text'=>__('products table heading available'), 
    305                                                                                                         );  
    306                         self::$allfields['p.products_status']=  array(  
    307                                                                                                                                 'sort'=>true,  
    308                                                                                                                                 'alias'=>'status',  
     305                                                                                                        ); 
     306                        self::$allfields['p.products_status']=  array( 
     307                                                                                                                                'sort'=>true, 
     308                                                                                                                                'alias'=>'status', 
    309309                                                                                                                                'text'=>__('products table heading status'), 
    310                                                                                                                                 'width'=>'5%',  
     310                                                                                                                                'width'=>'5%', 
    311311                                                                                                                                'default'=>true, 
    312                                                                                                         );  
    313                                                                                          
     312                                                                                                        ); 
     313 
    314314 
    315315 
    316316                /** 
    317                         @remarks Construct all list , fields , th/td  
     317                        @remarks Construct all list , fields , th/td 
    318318                */ 
    319319                self::$InitInfo['theader']['listing']=array( 
     
    331331                $listfield = '  cat.categories_id, '; 
    332332 
    333                 // put in  
     333                // put in 
    334334                if(isset($_SESSION['filters'][__CLASS__]['allfields'])) 
    335335                        $_SESSION['filters']['allfields'] = $_SESSION['filters'] [__CLASS__]['allfields']; 
     
    385385 
    386386                /** 
    387                         @remarks  filter based on language  
     387                        @remarks  filter based on language 
    388388                */ 
    389389                if(isset($_SESSION['filters'][__CLASS__]['language_id'])) 
     
    394394 
    395395                /** 
    396                         @remarks  filter based on categorie  
     396                        @remarks  filter based on categorie 
    397397                */ 
    398398                if( DataTypes::is_active('categorie')) { 
     
    423423 
    424424                /** 
    425                         @remarks  filter based on featured  
     425                        @remarks  filter based on featured 
    426426                */ 
    427427                if( DataTypes::is_active('featured')) { 
     
    442442 
    443443                /** 
    444                         @remarks  filter based on featured  
     444                        @remarks  filter based on featured 
    445445                */ 
    446446                if( DataTypes::is_active('manufacturer')) { 
     
    461461 
    462462                /** 
    463                         @remarks  filter based on subtype products   
     463                        @remarks  filter based on subtype products 
    464464                */ 
    465465                if(isset($_SESSION['filters'][__CLASS__]['subtype'])) 
     
    473473                                $list_type .=$key.','; 
    474474                else{ 
    475                         $allcats = categorieUtility::get_category_tree(array('datatype'=>MGabCont::CallSt('GetClassDatatype'),'language_id'=>$new_languages_id , 'exclude'=>array('0'))); 
     475                $allcats = tep_get_status_array('product'); 
    476476                        foreach($allcats as $row) 
    477477                                $list_type .=$row['id'].','; 
     
    490490                $array = array(); 
    491491                        foreach($_SESSION['filters']['expected'] as $key=>$row) 
    492                                 $array[] = $key;  
     492                                $array[] = $key; 
    493493 
    494494                if((!in_array('publied', $array) && in_array('nopublied', $array) )|| isset($_GET['expected']) ){ 
     
    499499                elseif(in_array('publied', $array) && !in_array('nopublied', $array) ) 
    500500                        self::$InitInfo['adjust']['sWhere'] .=" AND products_date_available  IS NULL  "; 
    501                  
     501 
    502502 
    503503 
     
    512512                $array = array(); 
    513513                        foreach($_SESSION['filters']['status'] as $key=>$row) 
    514                                 $array[] = $key;  
     514                                $array[] = $key; 
    515515 
    516516                if(in_array('publied', $array) && !in_array('nopublied', $array) ) 
     
    521521 
    522522                /** 
    523                         @remarks Put detail for listing methode  
     523                        @remarks Put detail for listing methode 
    524524                */ 
    525525                self::$InitInfo['adjust']['languages_id'] = $new_languages_id; 
     
    630630 
    631631                        /** 
    632                                 @remarks specific save in session value filters  
     632                                @remarks specific save in session value filters 
    633633                        */ 
    634634                        case 'filters': 
     
    686686 
    687687                        /** 
    688                                 @remarks specific Ajax call  
     688                                @remarks specific Ajax call 
    689689                        */ 
    690690                        case 'setflag': 
     
    701701 
    702702                        /** 
    703                                 @remarks specific multi action  
     703                                @remarks specific multi action 
    704704                        */ 
    705705                        case 'multi': 
     
    790790                                        $products_id = tep_db_prepare_input($_POST['products_id']); 
    791791                                        $categories_id = tep_db_prepare_input($_POST['categories_id']); 
    792                                         $type = 'duplicate';  
     792                                        $type = 'duplicate'; 
    793793 
    794794                                        if( ($pid = sqlproduct::copyto(array('id'=>$products_id ,'catid'=>$categories_id ,'type'=>$type))) && $pid > 0 ){ 
     
    812812                                $res = tep_get_status_array('product',0,'status_name'); 
    813813 
    814                                 // if one type, create auto and redirect  
     814                                // if one type, create auto and redirect 
    815815                                if(count($res)==1) 
    816816                                        tep_redirect(tep_href_link(self::FILENAME, 'action=insert&pID=')); 
     
    914914                                        $res=sqlproduct::Specimen(); 
    915915 
    916                                 self::$Info= new objectInfo($res);  
     916                                self::$Info= new objectInfo($res); 
    917917 
    918918                                //! descative gestion de stock, si stock composé avec attributes 
     
    954954 
    955955 
    956                                 $query_raw = "select ".$adjust->listfields.", p.products_id as id FROM " . TABLE_PRODUCTS . " p ".  
     956                                $query_raw = "select ".$adjust->listfields.", p.products_id as id FROM " . TABLE_PRODUCTS . " p ". 
    957957                                                                                        " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON(p.products_id = pd.products_id and pd.language_id = '" . (int)$adjust->languages_id . "') "; 
    958958 
     
    963963                                } 
    964964 
    965                                 if( DataTypes::is_active('manufacturer'))  
     965                                if( DataTypes::is_active('manufacturer')) 
    966966                                        $query_raw .=   " LEFT JOIN " . TABLE_MANUFACTURERS . " m ON( m.manufacturers_id=p.manufacturers_id ) "; 
    967967 
     
    11991199 
    12001200                                        if( ! DataTypes::is_active('categorie')) { 
    1201                                                 /// complete cats list  
     1201                                                /// complete cats list 
    12021202                                                $objres=$DB->query("SELECT categories_name FROM " . TABLE_CATEGORIES . " c,  " . TABLE_CATEGORIES_DESCRIPTION . " cd , " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c    WHERE c.categories_id=cd.categories_id AND cd.language_id = '" . (int)$languages_id . "' AND c.categories_id=p2c.categories_id and products_id='".$item['id']."' AND c.categories_id <> '".$item['categories_id']."' "); 
    12031203                                                $rescat=$objres->fetchAllAssoc(); 
     
    12101210 
    12111211                                        if( ! DataTypes::is_active('featured')) { 
    1212                                                 /// complete cats list  
     1212                                                /// complete cats list 
    12131213//                                              $objres=$DB->query("SELECT categories_name FROM " . TABLE_FEATURED . " f,  " . TABLE_CATEGORIES_DESCRIPTION . " cd , " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c    WHERE c.categories_id=cd.categories_id AND cd.language_id = '" . (int)$languages_id . "' AND c.categories_id=p2c.categories_id and products_id='".$item['id']."' AND c.categories_id <> '".$item['categories_id']."' "); 
    12141214//                                              $rescat=$objres->fetchAllAssoc(); 
    1215 //  
     1215// 
    12161216//                                              foreach($rescat as $cat) 
    12171217//                                                      $item['cat_title'] .=','.$cat['categories_name']; 
    1218 //  
     1218// 
    12191219//                                              if(strlen($item['cat_title'])>25)$item['cat_title']= substr($item['cat_title'],0 ,20).'...'; 
    12201220