Skip to content

Commit 3c387f4

Browse files
author
Stanislav
committed
added update method allowing to set up the db schema without module uninstalling
1 parent d8354d1 commit 3c387f4

File tree

1 file changed

+22
-37
lines changed

1 file changed

+22
-37
lines changed

os2web_cp_service.module

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,11 @@ define('DEFAULT_CASE_FILE_LIMIT', 50);//number of files to handle at once
1212
* Implements hook_init().
1313
*/
1414
function os2web_cp_service_init() {
15-
16-
// Proper Libraries API support.
17-
$qtip_path = NULL;
18-
if (function_exists('libraries_get_path')) {
19-
$qtip_path = libraries_get_path('qtip');
20-
if (!empty($qtip_path)) {
21-
$qtip_path .= '/jquery.qtip-1.0.0-rc3.min.js';
22-
}
23-
}
24-
if (!$qtip_path) {
25-
$qtip_path = drupal_get_path('module', 'os2web_cp_service') . '/js/jquery.qtip-1.0.0-rc3.min.js';
15+
16+
// Menu Minipanels us using qTip. Only add qTip js if module doesnt exits.
17+
if (!module_exists('menu_minipanels')) {
18+
drupal_add_js(drupal_get_path('module', 'os2web_cp_service') . '/js/jquery.qtip-1.0.0-rc3.min.js');
2619
}
27-
drupal_add_js($qtip_path);
2820

2921
drupal_add_js(drupal_get_path('module', 'os2web_cp_service') . '/js/os2web_cp_service.js');
3022
drupal_add_css(drupal_get_path('module', 'os2web_cp_service') . '/css/os2web_cp_service.css');
@@ -48,6 +40,12 @@ function os2web_cp_service_menu() {
4840
'page arguments' => array(4),
4941
'access callback' => TRUE,
5042
);
43+
//to delete
44+
$items['os2web/cp_cron'] = array(
45+
'type' => MENU_CALLBACK,
46+
'page callback' => 'os2web_cp_service_cron',
47+
'access callback' => TRUE,
48+
);
5149

5250
return $items;
5351
}
@@ -75,6 +73,8 @@ function os2web_cp_service_handler() {
7573
*/
7674
function os2web_gf_service_handler($file_id) {
7775
if ($url = variable_get('os2web_cp_service_cp_document_fileurl')) {
76+
variable_set('os2web_cp_service_cp_document_fileurl', 'http://10.1.1.118/Traen%20Publishing%20File%20Service%20-%20Sydjurs.dk/Download.aspx');
77+
7878
$username = variable_get('os2web_cp_service_endpoint_user');
7979
$password = variable_get('os2web_cp_service_endpoint_password');
8080
if (!empty($username) && !empty($password)) {
@@ -148,14 +148,14 @@ function os2web_gf_service_handler($file_id) {
148148
function os2web_cp_service_alter_configuration($key, $value) {
149149
switch ($key) {
150150
case 'FileServiceURL':
151-
variable_set('os2web_cp_service_cp_document_fileurl', $value);
151+
return variable_set('os2web_cp_service_cp_document_fileurl', $value);
152+
152153
break;
153154
}
154-
return TRUE;
155155
}
156156

157157
/**
158-
* Service function for creating a case.x
158+
* Service function for creating a case.
159159
*
160160
* @param array $data
161161
* Structured array with data for the Case.
@@ -890,28 +890,6 @@ function os2web_cp_service_get_extension_from_mime($mime) {
890890
return array_pop($pieces);
891891
}
892892

893-
/**
894-
* Implements hook_os2web_help().
895-
*/
896-
function os2web_cp_service_os2web_help($sections) {
897-
898-
// List of content.
899-
$sections['list_of_content'] = t('<a href="#os2web_cp_service">Case Publishing Service</a><br />');
900-
901-
// Content types.
902-
$sections['contenttype'] = t('<p><b>CP Case:</b> A CP case is a contenttype which mostly are used by the automatic publishing system.<br /><i><a href="@url" target="_blank">See the advanced documentation of OS2web Case Publishing Service</a></i></p>', array('@url' => url('admin/help/os2web_borger_dk')));
903-
$sections['contenttype'] .= t('<p><b>CP Document:</b> A CP document is a contenttype which mostly are used by the automatic publishing system.<br /><i><a href="@url" target="_blank">See the advanced documentation of OS2web Case Publishing Service</a></i></p>', array('@url' => url('admin/help/os2web_borger_dk')));
904-
905-
// General about OS2web CP Service.
906-
$sections['os2web_cp_service'] = t('<h2 id="os2web_cp_service">Case Publishing System</h2>');
907-
$sections['os2web_cp_service'] .= t('<p><b>Description</b><br />The Case Publishing service handles incomming requests from an acadre esdh system. By now it is made to publish cases and documents.</p>');
908-
$sections['os2web_cp_service'] .= t('<p><i>If enabled, a search page is located at <a href="@url" target="_blank">/aaben-indsigt</a></i></p>', array('@url' => '/aaben-indsigt'));
909-
$sections['os2web_cp_service'] .= t('<p><b>CP Approved Rules:</b>(<i>taxonomy</i>) <a href="@url" target="_blank">Edit the approved rules from acadre</a> to allow them to be published. If they arent approved, they will be saved as an unpublished page. The approved rules are the triggered rule.</p>', array('@url' => url('admin/help/os2web_borger_dk')));
910-
$sections['os2web_cp_service'] .= t('<p><b>Imported fields:</b> Edit the fields of a <a href="@case" target="_blank">CP Case</a> or a <a href="@doc" target="_blank">CP Document</a> to allow other fields from the webservice to be importet. Name the field the same as the title of the field from the webservice, and it will be linked up. Currently it will handle taxonomy_term_references. All other types are handled as a text field.</p>', array('@case' => url('admin/structure/types/manage/os2web-cp-service-cp-case/fields'), '@doc' => url('admin/structure/types/manage/os2web-cp-service-cp-doc/fields')));
911-
$sections['os2web_cp_service'] .= t('<p><b>Configuration:</b> Setup the authentification user and password at the <a href="@url" target="_blank">OS2web Settings Page</a>. These credentials are used to authenticate to the file download service. This file download is recieved as a webservice call from your provider.<br />See the <a href="@wsdl" target="_blank">WSDL file</a> for further weservice documentation</p>', array('@url' => url('admin/help/os2web_borger_dk'), '@wsdl' => url('os2web/service/cp/v1/?wsdl')));
912-
return $sections;
913-
914-
}
915893
/**
916894
* Schedules a document for pdf to html conversion by adding the document's to database table.
917895
*
@@ -1116,4 +1094,11 @@ function _os2web_cp_service_update_case_metadata($file_id, $case_nid, $path_to_p
11161094
unlink($path_to_pdf);
11171095
}
11181096
}
1097+
}
1098+
1099+
/**
1100+
* Update method installing the module's database without a need to uninstall/install it.
1101+
*/
1102+
function os2web_cp_service_update_7100(){
1103+
drupal_install_schema('os2web_cp_service');
11191104
}

0 commit comments

Comments
 (0)