Changeset 6901 for extensions/GrumPluginClasses
- Timestamp:
- Sep 13, 2010, 10:05:20 PM (14 years ago)
- Location:
- extensions/GrumPluginClasses
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php
r6894 r6901 3 3 class name: GCPRequestBuilder 4 4 class version : 1.1.0 5 plugin version : 3. 1.05 plugin version : 3.2.0 6 6 date : 2010-09-08 7 7 … … 90 90 * - getWhere 91 91 * - getJoin 92 * - getImageId (used for multirecord requests only)92 * - getImageId 93 93 * 94 94 * Retrieving the results … … 102 102 * is builded, but it is used only when retrieving the results for 103 103 * multirecord tables) 104 * - formatData 104 105 * 105 106 * 106 * Example 1 : single record request 107 * --------------------------------- 108 * Consider the table "tableA" like this 109 * 110 * - (*) imageId 111 * - att1 112 * - att2 113 * The primary key is the 'imageId' attribute 114 * => for one imageId, you can only have ZERO or ONE record 115 * 116 * getSelect returns : "tableA.att1, tableA.att2" 117 * getFrom returns : "tableA" 118 * getWhere returns : "tableA.att1 = zzzz" 119 * getJoin returns : "tableA.imageId = pit.id" 120 * getFilter returns : "" 121 * 122 * 123 * Example 2 : multi records request 124 * --------------------------------- 107 * Example 108 * ------- 125 109 * Consider the table "tableA" like this 126 110 * … … 137 121 * getSelect returns : "tableA.att1, tableA.att2" 138 122 * getFrom returns : "tableA" 139 * getWhere returns : "tableA. att1 = zzzz AND tableA.att1 = xxxx"140 * getJoin returns : "tableA.i d = pit.id"141 * getFilter returns : " "123 * getWhere returns : "tableA.localId= xxxx AND tableA.att1 = zzzz" 124 * getJoin returns : "tableA.imageId = pit.id" 125 * getFilter returns : "tableA.localId= xxxx" 142 126 * 143 127 */ … … 402 386 $tablef= new GPCTables(self::$tables); 403 387 $tablef->create($tablesDef); 388 389 return(true); 390 } 391 392 /** 393 * update the tables needed by RequestBuilder (used during the gpc process 394 * activation) 395 */ 396 static public function updateTables($pluginPreviousRelease) 397 { 398 $tablesCreate=array(); 399 $tablesUpdate=array(); 400 401 switch($pluginPreviousRelease) 402 { 403 case '03.01.00': 404 $tablesCreate[]= 405 "CREATE TABLE `".self::$tables['temp']."` ( 406 `requestId` char(30) NOT NULL, 407 `imageId` mediumint(8) unsigned NOT NULL, 408 PRIMARY KEY (`request`,`id`) 409 ) 410 CHARACTER SET utf8 COLLATE utf8_general_ci"; 411 412 $tablesUpdate[self::$tables['request']]['filter']= 413 "ADD COLUMN `filter` text NOT NULL default '' "; 414 break; 415 } 416 417 $tablef=new GPCTables(self::$tables); 418 419 if(count($tablesCreate)>0) $tablef->create($tablesCreate); 420 if(count($tablesUpdate)>0) $tablef->updateTablesFields($tablesUpdate); 404 421 405 422 return(true); -
extensions/GrumPluginClasses/gpc_install.class.inc.php
r6235 r6901 46 46 public function install() 47 47 { 48 $this->initConfig(); 49 $this->loadConfig(); 50 $this->config['installed']=GPC_VERSION2; 51 $this->saveConfig(); 52 48 53 $result=GPCRequestBuilder::createTables(); 49 54 return($result); … … 70 75 public function activate() 71 76 { 77 global $template, $user; 78 79 $this->initConfig(); 80 $this->loadConfig(); 81 82 /* 83 * if there is no version information available, assume the previous 84 * installed release of the plugin is 3.1.0 85 */ 86 if(!isset($this->config['installed'])) $this->config['installed']='03.01.00'; 87 88 /* 89 switch($this->config['installed']) 90 { 91 case '03.01.00': 92 GPCRequestBuilder::updateTables($this->config['installed']); 93 break; 94 } 95 */ 96 GPCRequestBuilder::updateTables($this->config['installed']); 97 98 99 $this->config['installed']=GPC_VERSION2; //update the installed release number 100 $this->saveConfig(); 72 101 } 73 102
Note: See TracChangeset
for help on using the changeset viewer.