Conjunto 66a2dec en sipes
- Fecha y hora:
- 20/09/2016 09:11:20 (hace 8 años)
- Branches:
- stable, version-3.0
- Children:
- 3959b2a
- Parents:
- 42ac972
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
0.3-modules/sipesonapre/sipesonapre.module
re32e12b r66a2dec 115 115 $rows = array(); 116 116 } 117 if ($type == 'cvs') {117 elseif ($type == 'cvs') { 118 118 $cadena = '"PROY_PROY_ID"' . $cell_separator . '"FUENTE_ID"' . $cell_separator . '"MONTO"' . $row_separator; 119 119 } 120 if ($type == 'data') {120 elseif ($type == 'data') { 121 121 $arreglo = array(); 122 122 } … … 135 135 $row_nid = array('data' => $nid,); 136 136 } 137 if ($type == 'cvs') {137 elseif ($type == 'cvs') { 138 138 $texto_base = '"' . $nid . '"' . $cell_separator; 139 139 } 140 if ($type == 'other') {140 elseif ($type == 'data') { 141 141 $datos_other = array(); 142 $arreglo[$nid] = array();143 142 } 144 143 foreach($fuentes_fin as $id => $valor) { … … 150 149 $rows[] = $row; 151 150 } 152 if ($type == 'cvs') {151 elseif ($type == 'cvs') { 153 152 $cadena .= $texto_base . '"' . $id . '"' . $cell_separator . '"' . $valor . '"' . $row_separator; 154 153 } 155 if ($type == 'other') {156 $ arreglo[$nid][$id] = array(157 'PROY_PROY_ID' => $nid,158 'FUENTE_ID' => $id,159 'MONTO' => $valor,160 );154 elseif ($type == 'data') { 155 $item = new stdClass(); 156 $item->PROY_PROY_ID = $nid; 157 $item->FUENTE_ID = $id; 158 $item->MONTO = $valor; 159 $arreglo[] = $item; 161 160 } 162 161 } … … 169 168 return theme('table', $header, $rows, array('id' => 'fuentes_proy')); 170 169 } 171 if ($type == 'cvs') {170 elseif ($type == 'cvs') { 172 171 $filename = 'fuentes_proyectos_' . time() . '.csv'; 173 172 if (variable_get('onapre_encode_ISO_8859_1', FALSE)) { … … 182 181 exit(); 183 182 } 184 if ($type == 'other') {183 elseif ($type == 'data') { 185 184 return $arreglo; 186 185 } … … 216 215 } 217 216 217 /** 218 * Implementation of hook_services_resources(). 219 */ 220 function sipesonapre_services_resources() { 221 $resources['sipesonapre'] = array(); 222 $resources['sipesonapre']['retrieve'] = array( 223 'help' => 'Retrieves Fuentes Proyectos ONAPRE.', 224 'callback' => 'sipesonapre_retrieve', 225 'access callback' => 'sipesonapre_access', 226 'access arguments' => array('view'), 227 'access arguments append' => TRUE, 228 ); 229 230 return $resources; 231 } 232 233 /** 234 * Check the access permission to a given views. 235 * 236 * @param $op 237 * String. The operation that's going to be performed. 238 * @param $args 239 * Array. The arguments that will be passed to the callback. 240 * @return 241 * Boolean. TRUE if the user is allowed to load the given view. 242 */ 243 function sipesonapre_access($op = 'view') { 244 return user_access('consultar onapre'); 245 } 246 247 /** 248 * Callback for retrieving fuentes onapre. 249 * 250 * 251 * @return 252 * Array. The views return. 253 */ 254 function sipesonapre_retrieve() { 255 $result = _sipesonapre_get_fuentes($nid = 0, 'data'); 256 return $result; 257 }
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.