Ejemplo n.º 1
0
 function applyChange()
 {
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         foreach (glob('build/wsChanges/*.php', GLOB_BRACE) as $restOp) {
             include $restOp;
             if (!empty($operationInfo)) {
                 ob_start();
                 $rdo = registerWSAPI($operationInfo);
                 $out = ob_get_contents();
                 ob_end_clean();
                 $this->sendMsg($out);
                 if ($rdo) {
                     $this->sendMsg("Registered WS Operation: <b>" . $operationInfo['name'] . "</b><br>");
                 } else {
                     $this->sendMsg("WS Operation: <b>" . $operationInfo['name'] . "</b> already registered<br>");
                 }
             }
         }
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         //$this->markApplied();  // => Continuous
     }
     $this->finishExecution();
 }
Ejemplo n.º 2
0
 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     if ($event_type == 'module.postinstall') {
         // TODO Handle post installation actions
         $this->setModuleSeqNumber('configure', $modulename, 'glb-', '0000001');
         // register webservice functionality
         require_once 'include/Webservices/Utils.php';
         $operationInfo = array('name' => 'SearchGlobalVar', 'include' => 'modules/GlobalVariable/SearchGlobalVarws.php', 'handler' => 'cbws_SearchGlobalVar', 'prelogin' => 0, 'type' => 'GET', 'parameters' => array(array('name' => 'gvname', 'type' => 'string'), array('name' => 'defaultvalue', 'type' => 'string'), array('name' => 'gvmodule', 'type' => 'string')));
         $rdo = registerWSAPI($operationInfo);
         if ($rdo) {
             echo 'Registered WS Operation: <b>' . $operationInfo['name'] . '</b><br>';
         } else {
             echo 'WS Operation: <b>' . $operationInfo['name'] . '</b> already registered<br>';
         }
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                             // TODO Handle actions after this module is updated.
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
<?php

/*********************************************************************************
 * Copyright 2012-2014 JPL TSolucio, S.L.  --  This file is a part of coreBOS.
 * You can copy, adapt and distribute the work under the "Attribution-NonCommercial-ShareAlike"
 * Vizsage Public License (the "License"). You may not use this file except in compliance with the
 * License. Roughly speaking, non-commercial users may share and modify this code, but must give credit
 * and share improvements. However, for proper details please read the full License, available at
 * http://vizsage.com/license/Vizsage-License-BY-NC-SA.html and the handy reference for understanding
 * the full license at http://vizsage.com/license/Vizsage-Deed-BY-NC-SA.html. Unless required by
 * applicable law or agreed to in writing, any software distributed under the License is distributed
 * on an  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and limitations under the
 * License terms of Creative Commons Attribution-NonCommercial-ShareAlike 3.0 (the License).
 ********************************************************************************/
include_once 'vtlib/Vtiger/Module.php';
// Copy module/include language files
foreach (glob('build/wsChanges/*.php', GLOB_BRACE) as $restOp) {
    include $restOp;
    if (!empty($operationInfo)) {
        $rdo = registerWSAPI($operationInfo);
        if ($rdo) {
            echo "Register WS Operation: <b>" . $operationInfo['name'] . "</b><br>";
        } else {
            echo "WS Operation: <b>" . $operationInfo['name'] . "</b> already registered<br>";
        }
    }
}