3.1.1
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
<?php
|
||||
//define('DO_NOT_CHECK_HTTP_REFERER', 1);
|
||||
include_once '../../../inc/includes.php';
|
||||
//include_once '../inc/processmaker.class.php' ;
|
||||
//include_once '../inc/case.class.php' ;
|
||||
|
||||
// check if it is from PM pages
|
||||
if( isset( $_REQUEST['UID'] ) && isset( $_REQUEST['APP_UID'] ) && isset( $_REQUEST['__DynaformName__'] ) ) {
|
||||
@@ -13,14 +10,12 @@ if( isset( $_REQUEST['UID'] ) && isset( $_REQUEST['APP_UID'] ) && isset( $_REQUE
|
||||
$myProcessMaker->login( ) ;
|
||||
|
||||
if( isset( $_REQUEST['form'] ) ) {
|
||||
|
||||
$myProcessMaker->derivateCase( $myCase, $_REQUEST); //, $_SERVER['HTTP_COOKIE'] ) ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ( isset( $_REQUEST['form'] ) && isset( $_REQUEST['form']['BTN_CATCH'] ) && isset( $_REQUEST['form']['APP_UID']) ) {
|
||||
// Claim task management
|
||||
elseif( isset( $_REQUEST['form'] ) && isset( $_REQUEST['form']['BTN_CATCH'] ) && isset( $_REQUEST['form']['APP_UID']) ){
|
||||
// here we are in a Claim request
|
||||
$myCase = new PluginProcessmakerCase ;
|
||||
if( $myCase->getFromDB( $_REQUEST['form']['APP_UID'] ) ) {
|
||||
@@ -32,11 +27,14 @@ elseif( isset( $_REQUEST['form'] ) && isset( $_REQUEST['form']['BTN_CATCH'] ) &&
|
||||
// now manage tasks associated with item
|
||||
$myProcessMaker->claimTask( $myCase->getID(), $_REQUEST['DEL_INDEX'] ) ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// now redirect to item form page
|
||||
//Html::redirect( Toolbox::getItemTypeFormURL($myCase->getField('itemtype')));
|
||||
echo "<html><body><script></script><input id='GLPI_FORCE_RELOAD' type='hidden' value='GLPI_FORCE_RELOAD'/></body></html>" ;
|
||||
$config = PluginProcessmakerConfig::getInstance() ;
|
||||
echo "<html><body><script>";
|
||||
if( isset($config->fields['domain']) && $config->fields['domain'] != '' ) {
|
||||
echo "document.domain='{$config->fields['domain']}';";
|
||||
}
|
||||
echo "</script><input id='GLPI_FORCE_RELOAD' type='hidden' value='GLPI_FORCE_RELOAD'/></body></html>" ;
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,10 @@ switch( $_POST["action"] ) {
|
||||
else { // the case is created before the ticket (used for post-only case creation before ticket creation)
|
||||
$myProcessMaker = new PluginProcessmakerProcessmaker() ;
|
||||
$myProcessMaker->login() ;
|
||||
|
||||
$resultCase = $myProcessMaker->newCase( $_POST['plugin_processmaker_process_id'], array( 'GLPI_ITEM_CAN_BE_SOLVED' => 0, 'GLPI_SELFSERVICE_CREATED' => '1', 'GLPI_URL' => $CFG_GLPI['url_base'].$CFG_GLPI['root_doc']) ) ;
|
||||
$resultCase = $myProcessMaker->newCase( $_POST['plugin_processmaker_process_id'],
|
||||
array( 'GLPI_ITEM_CAN_BE_SOLVED' => 0,
|
||||
'GLPI_SELFSERVICE_CREATED' => '1',
|
||||
'GLPI_URL' => $CFG_GLPI['url_base'].$CFG_GLPI['root_doc']) ) ;
|
||||
if ($resultCase->status_code == 0){
|
||||
// case is created
|
||||
// Must show it...
|
||||
|
||||
@@ -56,6 +56,24 @@ if( isset($_POST["_from_helpdesk"]) && $_POST["_from_helpdesk"] == 1
|
||||
|
||||
}
|
||||
|
||||
if( !function_exists('stripcslashes_deep') ){
|
||||
/**
|
||||
* Strip c slash for variable & array
|
||||
*
|
||||
* @param $value array or string: item to stripslashes (array or string)
|
||||
*
|
||||
* @return stripcslashes item
|
||||
**/
|
||||
function stripcslashes_deep($value) {
|
||||
|
||||
$value = is_array($value) ?
|
||||
array_map('stripcslashes_deep', $value) :
|
||||
stripcslashes($value);
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
if( !function_exists('http_formdata_flat_hierarchy') ) {
|
||||
/**
|
||||
* Summary of http_formdata_flat_hierarchy
|
||||
@@ -118,6 +136,9 @@ if( GLPI_USE_CSRF_CHECK ) {
|
||||
$data['_glpi_csrf_token'] = Session::getNewCSRFToken() ;
|
||||
}
|
||||
|
||||
$data = array_map('Toolbox::unclean_cross_side_scripting_deep', $data);
|
||||
$data = array_map('stripcslashes_deep', $data);
|
||||
|
||||
// need to add files if some are uploaded
|
||||
$files = array() ;
|
||||
$paths = array() ;
|
||||
|
||||
182
hook.php
182
hook.php
@@ -2,19 +2,19 @@
|
||||
|
||||
include_once 'inc/processmaker.class.php';
|
||||
|
||||
|
||||
|
||||
function plugin_processmaker_MassiveActions($type) {
|
||||
global $LANG;
|
||||
|
||||
switch ($type) {
|
||||
case 'PluginProcessmakerProcess' :
|
||||
if( plugin_processmaker_haveRight('config', UPDATE ) )
|
||||
if (plugin_processmaker_haveRight('config', UPDATE )) {
|
||||
return array('plugin_processmaker_taskrefresh' => $LANG['processmaker']['config']['refreshtasklist']);
|
||||
}
|
||||
break;
|
||||
case 'PluginProcessmakerProcess_Profile' :
|
||||
if( plugin_processmaker_haveRight('config', UPDATE ) )
|
||||
if (plugin_processmaker_haveRight('config', UPDATE )) {
|
||||
return array('purge' => $LANG['processmaker']['process']['profile']);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -88,12 +88,10 @@ function plugin_processmaker_install() {
|
||||
ADD COLUMN `comment` TEXT NULL AFTER `date_mod`;
|
||||
RENAME TABLE `glpi_plugin_processmaker_config` TO `glpi_plugin_processmaker_configs`;";
|
||||
$DB->query($query) or die("error creating glpi_plugin_processmaker_configs" . $DB->error());
|
||||
}
|
||||
else
|
||||
if (!TableExists("glpi_plugin_processmaker_configs")) {
|
||||
} else if (!TableExists("glpi_plugin_processmaker_configs")) {
|
||||
$query = " CREATE TABLE `glpi_plugin_processmaker_configs` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(50) NOT NULL,
|
||||
`name` VARCHAR(50) NOT NULL DEFAULT 'ProcessMaker',
|
||||
`pm_server_URL` VARCHAR(250) NOT NULL DEFAULT 'http://localhost/',
|
||||
`pm_workspace` VARCHAR(50) NOT NULL DEFAULT 'workflow',
|
||||
`pm_admin_user` VARCHAR(255) NULL DEFAULT NULL,
|
||||
@@ -104,9 +102,10 @@ function plugin_processmaker_install() {
|
||||
`users_id` INT(11) NULL DEFAULT NULL,
|
||||
`pm_group_guid` VARCHAR(32) NULL DEFAULT NULL,
|
||||
`comment` TEXT NULL,
|
||||
`pm_dbserver_name` VARCHAR(255) NULL DEFAULT NULL,
|
||||
`pm_dbserver_name` VARCHAR(255) NULL DEFAULT 'localhost',
|
||||
`pm_dbserver_user` VARCHAR(255) NULL DEFAULT NULL,
|
||||
`pm_dbserver_passwd` VARCHAR(255) NULL DEFAULT NULL,
|
||||
`domain` VARCHAR(50) NULL DEFAULT '',
|
||||
`maintenance` TINYINT(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
)
|
||||
@@ -116,12 +115,11 @@ function plugin_processmaker_install() {
|
||||
|
||||
$DB->query($query) or die("error creating glpi_plugin_processmaker_configs" . $DB->error());
|
||||
|
||||
// ProcessMaker user creation
|
||||
//$user = new User;
|
||||
//$user->add( array( 'name' => 'ProcessMaker', 'realname' => 'Process', 'firstname' => 'Maker') ) ;
|
||||
|
||||
//// ProcessMaker plugin configuration
|
||||
//$DB->query("INSERT INTO glpi_plugin_processmaker_configs ( id, name, users_id) VALUES ( 1, 'Process Maker 1', ".$user->getID()." );" ) or die("error when inserting default config" . $DB->error());
|
||||
//add a default configuration
|
||||
$query = "
|
||||
INSERT INTO `glpi_plugin_processmaker_configs` (`id`) VALUES (1);
|
||||
";
|
||||
$DB->query( $query ) or die("error creating default record in glpi_plugin_processmaker_configs" . $DB->error());
|
||||
}
|
||||
|
||||
if (!FieldExists("glpi_plugin_processmaker_configs", "pm_dbserver_name" )) {
|
||||
@@ -136,30 +134,23 @@ function plugin_processmaker_install() {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `maintenance` TINYINT(1) NOT NULL DEFAULT '0' AFTER `pm_dbserver_passwd`;
|
||||
;";
|
||||
$DB->query($query) or die("error adding field maintenance to glpi_plugin_processmaker_configs" . $DB->error());
|
||||
}
|
||||
|
||||
if (!FieldExists("glpi_plugin_processmaker_configs", "domain" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `domain` VARCHAR(50) NULL DEFAULT '' AFTER `pm_dbserver_passwd`;
|
||||
";
|
||||
$DB->query($query) or die("error adding field domain to glpi_plugin_processmaker_configs" . $DB->error());
|
||||
}
|
||||
|
||||
if (!FieldExists("glpi_plugin_processmaker_configs", "maintenance" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `maintenance` TINYINT(1) NOT NULL DEFAULT '0' AFTER `domain`;
|
||||
;";
|
||||
$DB->query($query) or die("error adding fields maintenance to glpi_plugin_processmaker_configs" . $DB->error());
|
||||
}
|
||||
|
||||
if( !FieldExists("glpi_plugin_processmaker_configs","pm_admin_user" ) ) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `pm_admin_user` VARCHAR(255) NULL DEFAULT NULL AFTER `pm_workspace`,
|
||||
ADD COLUMN `pm_admin_passwd` VARCHAR(255) NULL DEFAULT NULL AFTER `pm_admin_user`;
|
||||
";
|
||||
$DB->query($query) or die("error adding fields pm_admin_user and pm_admin_passwd to glpi_plugin_processmaker_configs" . $DB->error());
|
||||
}
|
||||
|
||||
|
||||
//if (!TableExists("glpi_plugin_processmaker_profiles")) {
|
||||
// $query = "CREATE TABLE `glpi_plugin_processmaker_profiles` (
|
||||
// `id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
// `profiles_id` INT(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to glpi_profiles (id)',
|
||||
// `process_config` CHAR(1) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
|
||||
// PRIMARY KEY (`id`),
|
||||
// INDEX `profiles_id` (`profiles_id`)
|
||||
// )
|
||||
// COLLATE='utf8_unicode_ci'
|
||||
// ENGINE=InnoDB;" ;
|
||||
// $DB->query($query) or die("error creating glpi_plugin_processmaker_profiles" . $DB->error());
|
||||
//}
|
||||
if (TableExists("glpi_plugin_processmaker_profiles")) {
|
||||
$query = "DROP TABLE `glpi_plugin_processmaker_profiles` ;";
|
||||
$DB->query($query) or die("error dropping glpi_plugin_processmaker_profiles" . $DB->error());
|
||||
@@ -172,7 +163,7 @@ function plugin_processmaker_install() {
|
||||
`itemtype` VARCHAR(10) NOT NULL DEFAULT 'Ticket',
|
||||
`case_num` INT(11) NOT NULL,
|
||||
`case_status` VARCHAR(20) NOT NULL DEFAULT 'DRAFT',
|
||||
`processes_id` INT(11) NULL DEFAULT NULL
|
||||
`processes_id` INT(11) NULL DEFAULT NULL,
|
||||
UNIQUE INDEX `items` (`itemtype`, `items_id`),
|
||||
INDEX `case_status` (`case_status`)
|
||||
)
|
||||
@@ -189,7 +180,7 @@ function plugin_processmaker_install() {
|
||||
";
|
||||
$DB->query($query) or die("error adding column processes_id into glpi_plugin_processmaker_cases" . $DB->error());
|
||||
} else {
|
||||
$flds = $DB::list_fields('glpi_plugin_processmaker_cases') ;
|
||||
$flds = $DB->list_fields('glpi_plugin_processmaker_cases');
|
||||
if (strcasecmp( $flds['processes_id']['Type'], 'varchar(32)' ) == 0) {
|
||||
// required because autoload doesn't work for unactive plugin'
|
||||
include_once(GLPI_ROOT."/plugins/processmaker/inc/process.class.php");
|
||||
@@ -225,7 +216,6 @@ function plugin_processmaker_install() {
|
||||
$DB->query($query) or die("error creating glpi_plugin_processmaker_tasks" . $DB->error());
|
||||
}
|
||||
|
||||
|
||||
if (!TableExists("glpi_plugin_processmaker_users")) {
|
||||
$query = "CREATE TABLE `glpi_plugin_processmaker_users` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
@@ -271,7 +261,6 @@ function plugin_processmaker_install() {
|
||||
$DB->query($query) or die("error renaming 'glpi_users_id' into 'id' to glpi_plugin_processmaker_users" . $DB->error());
|
||||
}
|
||||
|
||||
|
||||
if (!TableExists("glpi_plugin_processmaker_processes")) {
|
||||
$query = "CREATE TABLE `glpi_plugin_processmaker_processes` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
@@ -281,7 +270,7 @@ function plugin_processmaker_install() {
|
||||
`hide_case_num_title` TINYINT(1) NOT NULL DEFAULT '0',
|
||||
`insert_task_comment` TINYINT(1) NOT NULL DEFAULT '0',
|
||||
`comment` TEXT NULL,
|
||||
`task_category_id` INT(11) NULL ,
|
||||
`taskcategories_id` INT(11) NULL ,
|
||||
`itilcategories_id` INT(11) NOT NULL DEFAULT '0',
|
||||
`type` INT(11) NOT NULL DEFAULT '1' COMMENT 'Only used for Tickets',
|
||||
`date_mod` DATETIME NULL DEFAULT NULL,
|
||||
@@ -337,7 +326,6 @@ function plugin_processmaker_install() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!TableExists("glpi_plugin_processmaker_taskcategories")) {
|
||||
$query = "CREATE TABLE `glpi_plugin_processmaker_taskcategories` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
@@ -359,21 +347,6 @@ function plugin_processmaker_install() {
|
||||
|
||||
}
|
||||
|
||||
//// create default TaskCategory if needed
|
||||
//// verify if taskcategory_id is set in config
|
||||
//// required cause autoload don't work for unactive plugin'
|
||||
//include_once(GLPI_ROOT."/plugins/processmaker/inc/config.class.php");
|
||||
//$config = new PluginProcessmakerConfig ;
|
||||
//$config->getFromDB( 1 ) ;
|
||||
//$pmCategory = $config->fields['taskcategories_id'] ;
|
||||
//if( !$pmCategory ) {
|
||||
// // add main category into config and glpi_taskcategories
|
||||
// $taskCat = new TaskCategory;
|
||||
// $pmCategory = $taskCat->add( array( 'is_recursive' => 1, 'name' => 'Process Maker', 'comment' => 'Is top category for Process Maker tasks. Name can be changed if desired.' ) ) ;
|
||||
// if( $pmCategory )
|
||||
// $config->update( array( 'id' => $config->getID(), 'taskcategories_id' => $pmCategory ) ) ;
|
||||
//}
|
||||
|
||||
if (!TableExists("glpi_plugin_processmaker_crontaskactions")) {
|
||||
$query = "CREATE TABLE `glpi_plugin_processmaker_crontaskactions` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
@@ -417,7 +390,6 @@ function plugin_processmaker_install() {
|
||||
$DB->query($query) or die("error creating glpi_plugin_processmaker_caselinks" . $DB->error());
|
||||
}
|
||||
|
||||
|
||||
if (!TableExists("glpi_plugin_processmaker_caselinkactions")) {
|
||||
$query = "CREATE TABLE `glpi_plugin_processmaker_caselinkactions` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
@@ -433,20 +405,21 @@ function plugin_processmaker_install() {
|
||||
$DB->query($query) or die("error creating glpi_plugin_processmaker_caselinkactions" . $DB->error());
|
||||
}
|
||||
|
||||
|
||||
// no longer used since 2.6
|
||||
//$myProcessMaker = new PluginProcessmakerProcessmaker() ;
|
||||
//$myProcessMaker->login(true) ; // to force admin login
|
||||
|
||||
//// verify if group 'GLPI Requesters' exists in config, if not will create it in PM and add GUID in config
|
||||
//$pmGroup = $config->fields['pm_group_guid'] ;
|
||||
//if( !$pmGroup ) {
|
||||
// $pmres = $myProcessMaker->createGroup( "GLPI Users" ) ;
|
||||
// if( $pmres->status_code == 0 )
|
||||
// $config->update( array( 'id' => $config->getID(), 'pm_group_guid' => $pmres->groupUID ) ) ;
|
||||
//if( !TableExists('glpi_plugin_processmaker_selfservicedrafts')){
|
||||
// $query = "CREATE TABLE `glpi_plugin_processmaker_selfservicedrafts` (
|
||||
// `id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
// `users_id` INT(11) NOT NULL,
|
||||
// `plugin_processmaker_processes_id` INT(11) NOT NULL,
|
||||
// `url` TEXT NOT NULL,
|
||||
// PRIMARY KEY (`id`),
|
||||
// INDEX `users_id` (`users_id`)
|
||||
// )
|
||||
// COLLATE='utf8_general_ci'
|
||||
// ENGINE=InnoDB
|
||||
// ;" ;
|
||||
// $DB->query($query) or die("error creating glpi_plugin_processmaker_selfservicedrafts" . $DB->error());
|
||||
//}
|
||||
|
||||
|
||||
// To be called for each task managed by the plugin
|
||||
// task in class
|
||||
CronTask::Register('PluginProcessmakerProcessmaker', 'pmusers', DAY_TIMESTAMP, array( 'state' => CronTask::STATE_DISABLE, 'mode' => CronTask::MODE_EXTERNAL));
|
||||
@@ -454,34 +427,18 @@ function plugin_processmaker_install() {
|
||||
CronTask::Register('PluginProcessmakerProcessmaker', 'pmorphancases', DAY_TIMESTAMP, array('param' => 10, 'state' => CronTask::STATE_DISABLE, 'mode' => CronTask::MODE_EXTERNAL));
|
||||
CronTask::Register('PluginProcessmakerProcessmaker', 'pmtaskactions', MINUTE_TIMESTAMP, array('state' => CronTask::STATE_DISABLE, 'mode' => CronTask::MODE_EXTERNAL));
|
||||
|
||||
|
||||
// required because autoload doesn't work for unactive plugin'
|
||||
include_once(GLPI_ROOT."/plugins/processmaker/inc/profile.class.php");
|
||||
PluginProcessmakerProfile::createAdminAccess($_SESSION['glpiactiveprofile']['id']);
|
||||
|
||||
// since version 3.0
|
||||
// needs to update rights values
|
||||
// 'r' -> READ
|
||||
// 'w' -> UPDATE
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// to migrate rights!!!!
|
||||
// TODO
|
||||
//$query = "UPDATE glpi_plugin_processmaker_profiles SET process_config=".READ." WHERE process_config='r';" ;
|
||||
//$DB->query($query) or die("error updating profiles" . $DB->error());
|
||||
//$query = "UPDATE glpi_plugin_processmaker_profiles SET process_config=".UPDATE." WHERE process_config='w';" ;
|
||||
//$DB->query($query) or die("error updating profiles" . $DB->error());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function plugin_processmaker_uninstall() {
|
||||
global $DB;
|
||||
|
||||
|
||||
CronTask::Unregister('PluginProcessmakerProcessmaker');
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -513,8 +470,6 @@ function plugin_processmaker_getAddSearchOptions($itemtype) {
|
||||
// => array('table' => 'glpi_plugin_processmaker_ticketcase',
|
||||
// 'linkfield' => 'ticket_id'));
|
||||
|
||||
|
||||
|
||||
//$sopt[1001]['joinparams']['jointype'] = "itemtype_id";
|
||||
//$sopt[1001]['pfields_type'] = ;
|
||||
}
|
||||
@@ -544,7 +499,8 @@ function plugin_processmaker_addLeftJoin($type,$ref_table,$new_table,$linkfield,
|
||||
|
||||
/**
|
||||
* Summary of plugin_pre_item_update_processmaker
|
||||
* @param CommonITILObject $parm
|
||||
* @param CommonITILObject $parm is an object
|
||||
* @return void
|
||||
*/
|
||||
function plugin_pre_item_update_processmaker(CommonITILObject $parm) {
|
||||
global $DB;
|
||||
@@ -560,8 +516,6 @@ function plugin_pre_item_update_processmaker(CommonITILObject $parm) {
|
||||
$locPM->login();
|
||||
|
||||
// case is existing for this item
|
||||
// $technicians = PluginProcessmakerProcessmaker::getItemUsers( $itemType, $itemId, 2 ) ; // 2 for technicians
|
||||
|
||||
// beware to empty injection when not modified!!!
|
||||
$locVar = array( );
|
||||
foreach ($parm->input as $key => $val) {
|
||||
@@ -586,17 +540,18 @@ function plugin_pre_item_update_processmaker(CommonITILObject $parm) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// $locVar['GLPI_TICKET_TECHNICIAN_GLPI_ID']=$technicians[0]['glpi_id'];
|
||||
// $locVar['GLPI_TICKET_TECHNICIAN_PM_ID']=$technicians[0]['pm_id'];
|
||||
|
||||
$pmResponse = $locPM->sendVariables( $locCase->getID(), $locVar);
|
||||
//$locCase->sendVariables( $locVar ) ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Summary of plugin_item_update_processmaker_satisfaction
|
||||
* inject satisfaction survey into case
|
||||
* @param mixed $parm is the object
|
||||
*/
|
||||
function plugin_item_update_processmaker_satisfaction($parm) {
|
||||
global $DB, $GLOBALS;
|
||||
|
||||
@@ -604,23 +559,19 @@ function plugin_item_update_processmaker_satisfaction($parm) {
|
||||
if ($locCase->getCaseFromItemTypeAndItemId( 'Ticket', $parm->fields['tickets_id'] )) {
|
||||
// case is existing for this item
|
||||
|
||||
|
||||
|
||||
$locPM = new PluginProcessmakerProcessmaker;
|
||||
$locPM->login();
|
||||
|
||||
$pmResponse = $locPM->sendVariables( $locCase->getID(), array(
|
||||
'GLPI_SATISFACTION_QUALITY' => $parm->fields['satisfaction'],
|
||||
'GLPI_SATISFACTION_RESPONSETIME' => $parm->fields['responsetime'],
|
||||
'GLPI_SATISFACTION_FRIENDLINESS' => $parm->fields['friendliness']
|
||||
'GLPI_SATISFACTION_QUALITY' => $parm->fields['satisfaction']
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
function plugin_pre_item_update_processmaker_followup($parm) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Summary of plugin_pre_item_purge_processmaker
|
||||
* @param mixed $parm is the object
|
||||
*/
|
||||
function plugin_pre_item_purge_processmaker ( $parm ) {
|
||||
|
||||
if ($parm->getType() == 'Ticket_User' && is_array( $parm->fields ) && isset( $parm->fields['type'] ) && $parm->fields['type'] == 2) {
|
||||
@@ -634,6 +585,10 @@ function plugin_pre_item_purge_processmaker ( $parm ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of plugin_item_purge_processmaker
|
||||
* @param mixed $parm is the object
|
||||
*/
|
||||
function plugin_item_purge_processmaker($parm) {
|
||||
global $DB;
|
||||
|
||||
@@ -662,6 +617,7 @@ function plugin_item_purge_processmaker($parm) {
|
||||
// need to get info on the thread of the GLPI current user
|
||||
// we must retreive currentGLPI user from this array
|
||||
$GLPICurrentPMUserId = PluginProcessmakerUser::getPMUserId( $parm->fields['users_id'] );
|
||||
if (isset( $caseInfo->currentUsers ) && is_array( $caseInfo->currentUsers )) {
|
||||
foreach ($caseInfo->currentUsers as $caseUser) {
|
||||
if ($caseUser->userId == $GLPICurrentPMUserId && in_array( $caseUser->delThreadStatus, array('DRAFT', 'OPEN', 'PAUSE' ) )) {
|
||||
$pmResponse = $locPM->reassignCase( $locCase->getID(), $caseUser->delIndex, $GLPICurrentPMUserId, $technicians[0]['pm_id'] );
|
||||
@@ -686,6 +642,7 @@ function plugin_item_purge_processmaker($parm) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -735,11 +692,13 @@ function plugin_item_update_processmaker_tasks($parm){
|
||||
|
||||
// Must check the condition
|
||||
$casevariables = array();
|
||||
|
||||
$matches = array();
|
||||
if (preg_match_all( "/@@(\w+)/u", $targetTask['sourcecondition'], $matches )) {
|
||||
$casevariables = $matches[1];
|
||||
}
|
||||
//foreach( $targetTask['targetactions'] as $actionvalue ){
|
||||
$targetTask['targetactions'] = array(); // empty array by default
|
||||
foreach ($DB->request( 'glpi_plugin_processmaker_caselinkactions', 'plugin_processmaker_caselinks_id = '.$targetTask['id']) as $actionvalue) {
|
||||
$targetTask['targetactions'][$actionvalue['name']] = $actionvalue['value'];
|
||||
if (preg_match_all( "/@@(\w+)/u", $actionvalue['value'], $matches )) {
|
||||
@@ -762,7 +721,6 @@ function plugin_item_update_processmaker_tasks($parm){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ask for those case variables
|
||||
$myProcessMaker = new PluginProcessmakerProcessmaker();
|
||||
$myProcessMaker->login( );
|
||||
@@ -774,7 +732,6 @@ function plugin_item_update_processmaker_tasks($parm){
|
||||
}
|
||||
$targetTask['sourcecondition'] = str_replace( array_keys($infoForTasks), $infoForTasks, $targetTask['sourcecondition'] );
|
||||
|
||||
|
||||
if (eval( "return ".$targetTask['sourcecondition'].";" )) {
|
||||
// look at each linked ticket if a case is attached and then if a task like $val is TO_DO
|
||||
// then will try to routeCase for each tasks in $val
|
||||
@@ -799,7 +756,7 @@ function plugin_item_update_processmaker_tasks($parm){
|
||||
foreach ($externalapplication['params'] as $paramname => $variable) {
|
||||
$externalapplicationparams[$paramname] = eval( "return ".str_replace( array_keys($infoForTasks), $infoForTasks, $variable)." ;" );
|
||||
}
|
||||
$externalapplicationparams['callback']=$CFG_GLPI['root_doc']."/plugins/processmaker/ajax/asynchronousdatas.php";
|
||||
$externalapplicationparams['callback']="http://".$_SERVER['SERVER_NAME' ].$CFG_GLPI['root_doc']."/plugins/processmaker/ajax/asynchronousdatas.php";
|
||||
$ch = curl_init();
|
||||
$externalapplication['url'] = eval( "return '".str_replace( array_keys($infoForTasks), $infoForTasks, $externalapplication['url'])."' ;" ); // '???
|
||||
curl_setopt($ch, CURLOPT_URL, $externalapplication['url'] );
|
||||
@@ -820,9 +777,10 @@ function plugin_item_update_processmaker_tasks($parm){
|
||||
$taskCase = $myProcessMaker->taskCase( $srcCaseId );
|
||||
foreach ($taskCase as $task) {
|
||||
// search for target task guid
|
||||
if( $task->guid == $targetTask['targettask_guid'] )
|
||||
if ($task->guid == $targetTask['targettask_guid']) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$postdatas['APP_UID'] = $srcCaseId;
|
||||
$postdatas['DEL_INDEX'] = $task->delegate;
|
||||
@@ -848,7 +806,7 @@ function plugin_item_update_processmaker_tasks($parm){
|
||||
// {"url":"http://arsupd201.ar.ray.group:8000/search_by_userid/","params":{"user":"@@USER_ID","system":"GPP","list":"@@ROLE_LIST"}}
|
||||
// url is the URL to be called
|
||||
|
||||
$externalapplicationparams['record_id'] = $cronaction->getID();
|
||||
$externalapplicationparams['id'] = $cronaction->getID();
|
||||
|
||||
$externalapplicationparams = json_encode( $externalapplicationparams, JSON_HEX_APOS | JSON_HEX_QUOT);
|
||||
//$externalapplicationparams = http_formdata_flat_hierarchy( $externalapplicationparams ) ;
|
||||
@@ -856,9 +814,15 @@ function plugin_item_update_processmaker_tasks($parm){
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $externalapplicationparams);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($externalapplicationparams)));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
|
||||
|
||||
// curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1 ) ;
|
||||
// curl_setopt($ch, CURLOPT_PROXY, "fry07689.fr.ray.group:8888");
|
||||
|
||||
$response = curl_exec ($ch);
|
||||
|
||||
//Toolbox::logDebug( $response ) ;
|
||||
|
||||
curl_close ($ch);
|
||||
}
|
||||
// }
|
||||
|
||||
@@ -330,17 +330,11 @@ class PluginProcessmakerCase extends CommonDBTM {
|
||||
// normally there is only one task
|
||||
$task = getItemForItemtype( $row['itemtype'] ) ;
|
||||
$task->getFromDB( $row['items_id'] ) ;
|
||||
$user = new User; // pseudo-group
|
||||
$user->getFromDB( $task->fields['users_id_tech'] ) ;
|
||||
// check if this pseudo-group can be found in the current user's groups
|
||||
foreach($DB->request("SELECT id FROM ".getTableForItemType( 'Group' )." WHERE name = '".$user->fields['name']."'") as $grp ){
|
||||
// normally there is only one record
|
||||
if( isset($_SESSION['glpigroups']) && !in_array( $grp['id'], $_SESSION['glpigroups'] ) ) {
|
||||
// check if this group can be found in the current user's groups
|
||||
if( !isset($_SESSION['glpigroups']) || !in_array( $task->fields['groups_id_tech'], $_SESSION['glpigroups'] ) ) {
|
||||
$hide_claim_button=true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
echo "<div id='task-".$caseUser->delIndex."'>";
|
||||
// to load users for task re-assign only when task is not to be 'claimed'
|
||||
|
||||
@@ -53,6 +53,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
|
||||
* @return array the modified $input array
|
||||
**/
|
||||
function prepareInputForUpdate($input) {
|
||||
global $CFG_GLPI;
|
||||
|
||||
if( !isset($input["maintenance"]) ) {
|
||||
$input["maintenance"] = 0 ;
|
||||
@@ -82,10 +83,40 @@ class PluginProcessmakerConfig extends CommonDBTM {
|
||||
$input['pm_admin_passwd'] = '';
|
||||
}
|
||||
|
||||
$input['domain'] = self::getCommonDomain( $CFG_GLPI['url_base'], $input['pm_server_URL'] ) ;
|
||||
|
||||
return $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of getCommonDomain
|
||||
* @param mixed $url1
|
||||
* @param mixed $url2
|
||||
* @return string the common domain part of the given urls
|
||||
*/
|
||||
static function getCommonDomain($url1, $url2) {
|
||||
$domain = '';
|
||||
try {
|
||||
$glpi = explode( "/", $url1) ;
|
||||
$glpi = explode( ".", $glpi[2] );
|
||||
$pm = explode( "/", $url2) ;
|
||||
$pm = explode( ".", $pm[2] );
|
||||
$cglpi = array_pop( $glpi ) ;
|
||||
$cpm = array_pop( $pm) ;
|
||||
while( $cglpi && $cpm && $cglpi == $cpm ) {
|
||||
$domain = $cglpi.($domain==''?'':'.'.$domain) ;
|
||||
$cglpi = array_pop( $glpi ) ;
|
||||
$cpm = array_pop( $pm ) ;
|
||||
}
|
||||
if( $domain != '' ) {
|
||||
return $domain ;
|
||||
}
|
||||
} catch(Exception $e) {}
|
||||
return '';
|
||||
}
|
||||
|
||||
static function showConfigForm($item) {
|
||||
global $LANG, $PM_DB;
|
||||
global $LANG, $PM_DB, $CFG_GLPI;
|
||||
|
||||
$ui_theme = array(
|
||||
'glpi_classic' => 'glpi_classic',
|
||||
@@ -101,6 +132,38 @@ class PluginProcessmakerConfig extends CommonDBTM {
|
||||
echo "<input size='50' type='text' name='pm_server_URL' value='".$config->fields['pm_server_URL']."'>" ;
|
||||
echo "</td></tr>\n";
|
||||
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
echo "<td>" . $LANG['processmaker']['config']['domain'] . "</td>";
|
||||
echo "<td><font color='red'><div name='domain'>".$config->fields['domain']."</div></font>";
|
||||
|
||||
echo Html::scriptBlock("
|
||||
function setCommonDomain() {
|
||||
var domain = '';
|
||||
try {
|
||||
var glpi= '".$CFG_GLPI['url_base']."'.split('/')[2].split('.') ;
|
||||
var pm = $('input[name=pm_server_URL]').val().split('/')[2].split('.');
|
||||
var cglpi = glpi.pop() ;
|
||||
var cpm = pm.pop() ;
|
||||
while( cglpi && cpm && cglpi == cpm ) {
|
||||
domain = cglpi + (domain==''?'':'.' + domain) ;
|
||||
cglpi = glpi.pop() ;
|
||||
cpm = pm.pop() ;
|
||||
}
|
||||
if( domain != '' ) {
|
||||
$('div[name=domain]').text(domain) ;
|
||||
$('div[name=domain]').parent().attr('color', 'green');
|
||||
return;
|
||||
}
|
||||
} catch(ex) {}
|
||||
$('div[name=domain]').text('".$LANG['processmaker']['config']['domain-error']."') ;
|
||||
$('div[name=domain]').parent().attr('color', 'red');
|
||||
};
|
||||
$('input[name=pm_server_URL]').on('keyup', setCommonDomain ) ;
|
||||
setCommonDomain() ;
|
||||
");
|
||||
echo "</td></tr>\n";
|
||||
|
||||
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
echo "<td >".$LANG['processmaker']['config']['workspace']."</td><td >";
|
||||
echo "<input type='text' name='pm_workspace' value='".$config->fields['pm_workspace']."'>" ;
|
||||
@@ -120,8 +183,11 @@ class PluginProcessmakerConfig extends CommonDBTM {
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
echo "<td >".$LANG['processmaker']['config']['connectionstatus']."</td><td >";
|
||||
$pm = new PluginProcessmakerProcessmaker ;
|
||||
$ret = $pm->login(true);
|
||||
if( $ret ) {
|
||||
//$pmconnected=false ; // by default
|
||||
if( $config->fields['pm_server_URL'] != ''
|
||||
&& $config->fields['pm_workspace'] != ''
|
||||
&& $config->fields["pm_admin_user"] != ''
|
||||
&& ($pm->login(true))) {
|
||||
echo "<font color='green'>".__('Test successful');
|
||||
} else {
|
||||
echo "<font color='red'>".__('Test failed')."<br>".print_r($pm->lasterror,true);
|
||||
@@ -163,26 +229,31 @@ class PluginProcessmakerConfig extends CommonDBTM {
|
||||
array('value' => $config->fields['pm_theme']));
|
||||
echo "</td></tr>";
|
||||
|
||||
$taskCatogrie = new TaskCategory;
|
||||
$taskCatogrie->getFromDB( $config->fields['taskcategories_id'] ) ;
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
echo "<td >".$LANG['processmaker']['config']['main_task_category']."</td><td >";
|
||||
echo "<a href='".Toolbox::getItemTypeFormURL( 'TaskCategory' )."?id=". $config->fields['taskcategories_id']."'>".str_replace(" ", " ", $taskCatogrie->fields['name']);
|
||||
if ($_SESSION["glpiis_ids_visible"]) {
|
||||
echo " (".$config->fields['taskcategories_id'].")";
|
||||
}
|
||||
echo "</a>" ;
|
||||
TaskCategory::dropdown(array('name' => 'taskcategories_id',
|
||||
'display_emptychoice' => true,
|
||||
'value' => $config->fields['taskcategories_id']));
|
||||
echo "</td></tr>\n";
|
||||
|
||||
$taskUser = new User;
|
||||
$taskUser->getFromDB( $config->fields['users_id'] ) ;
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
echo "<td >".$LANG['processmaker']['config']['taskwriter']."</td><td >";
|
||||
echo "<a href='".Toolbox::getItemTypeFormURL( 'User' )."?id=". $config->fields['users_id']."'>".str_replace(" ", " ", $taskUser->getName());
|
||||
if ($_SESSION["glpiis_ids_visible"]) {
|
||||
echo " (".$config->fields['users_id'].")";
|
||||
}
|
||||
echo "</a>" ;
|
||||
$rand = mt_rand() ;
|
||||
User::dropdown(array('name' => 'users_id',
|
||||
'display_emptychoice' => true,
|
||||
'right' => 'all',
|
||||
'rand' => $rand,
|
||||
'value' => $config->fields['users_id']));
|
||||
|
||||
// this code adds the + sign to the form
|
||||
echo "<img alt='' title=\"".__s('Add')."\" src='".$CFG_GLPI["root_doc"].
|
||||
"/pics/add_dropdown.png' style='cursor:pointer; margin-left:2px;'
|
||||
onClick=\"".Html::jsGetElementbyID('add_dropdown'.$rand).".dialog('open');\">";
|
||||
echo Ajax::createIframeModalWindow('add_dropdown'.$rand,
|
||||
User::getFormURL(),
|
||||
array('display' => false));
|
||||
// end of + sign
|
||||
|
||||
echo "</td></tr>\n";
|
||||
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
@@ -201,17 +272,6 @@ class PluginProcessmakerConfig extends CommonDBTM {
|
||||
|
||||
echo "</td></tr>\n";
|
||||
|
||||
//echo "<tr class='tab_bg_1'>";
|
||||
//echo "<td >".$LANG['processmaker']['config']['comments']."";
|
||||
//echo "</td><td rowspan='5' >";
|
||||
//echo "<textarea cols='60' rows='5' name='comment' >".$config->fields['comment']."</textarea>";
|
||||
//echo "</td></tr>\n";
|
||||
|
||||
//echo "<tr></tr>";
|
||||
//echo "<tr></tr>";
|
||||
//echo "<tr></tr>";
|
||||
//echo "<tr></tr>";
|
||||
|
||||
echo "<tr><td colspan='4' class='center b'>".__('Maintenance')."</td></tr>";
|
||||
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
|
||||
@@ -12,11 +12,15 @@
|
||||
|
||||
function __construct() {
|
||||
$config = PluginProcessmakerConfig::getInstance() ;
|
||||
if( $config->fields['pm_dbserver_name'] != ''
|
||||
&& $config->fields['pm_dbserver_user'] != ''
|
||||
&& $config->fields['pm_workspace'] != '' ) {
|
||||
$this->dbhost = $config->fields['pm_dbserver_name'] ;
|
||||
$this->dbuser = $config->fields['pm_dbserver_user'] ;
|
||||
$this->dbpassword = Toolbox::decrypt($config->fields['pm_dbserver_passwd'], GLPIKEY);
|
||||
$this->dbdefault = "wf_".$config->fields['pm_workspace'] ;
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
|
||||
|
||||
$this->pmAdminSession = false ;
|
||||
unset($_SESSION["pluginprocessmaker"]["session"]) ;
|
||||
Toolbox::logDebug( "Processmaker Plugin: Soap problem: ". print_r( $locSession, true ) );
|
||||
Toolbox::logDebug( "Processmaker Plugin: $admin_or_user - Soap problem: ". print_r( $locSession, true ) );
|
||||
$this->lasterror = $locSession ;
|
||||
return false ;
|
||||
}
|
||||
@@ -957,7 +957,11 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
|
||||
* 0 : nothing to do
|
||||
*/
|
||||
static function cronPMTaskActions($task) {
|
||||
global $DB, $CFG_GLPI;
|
||||
global $DB, $CFG_GLPI, $PM_DB;
|
||||
|
||||
if (!isset($PM_DB)) {
|
||||
$PM_DB = new PluginProcessmakerDB ;
|
||||
}
|
||||
|
||||
$actionCode = 0; // by default
|
||||
$error = false ;
|
||||
@@ -1678,6 +1682,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
|
||||
$input['is_private'] = 0 ;
|
||||
$input['actiontime'] = 0 ;
|
||||
$input['state'] = 1 ; // == TO_DO
|
||||
$input['users_id_tech'] = 0; // by default as it can't be empty
|
||||
if( $techId ) {
|
||||
$input['users_id_tech'] = $techId;
|
||||
} elseif( $groups_id_tech ) {
|
||||
@@ -1847,6 +1852,11 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
|
||||
public function solveTask( $caseId, $delIndex, $options=array() ) {
|
||||
global $DB, $CFG_GLPI ;
|
||||
|
||||
// change current glpi_currenttime to be sure that date_mode for solved task will not be identical than date_mode of the newly started task
|
||||
$start_date = new DateTime( $_SESSION["glpi_currenttime"] ) ;
|
||||
$official_date_time = $_SESSION["glpi_currenttime"] ;
|
||||
$_SESSION["glpi_currenttime"] = $start_date->sub(new DateInterval("PT1S"))->format("Y-m-d H:i:s") ;
|
||||
|
||||
$default_options = array(
|
||||
'txtToAppend' => '',
|
||||
'notif' => true,
|
||||
@@ -1889,6 +1899,10 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
|
||||
$glpi_task->update( $params ) ;
|
||||
$CFG_GLPI["use_mailing"]= $donotif;
|
||||
}
|
||||
|
||||
// restore current glpi time
|
||||
$_SESSION["glpi_currenttime"] = $official_date_time ;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2468,6 +2482,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
|
||||
$locItem->fields['due_date'] = "";
|
||||
}
|
||||
|
||||
|
||||
$resultCase = $this->newCase( $processId,
|
||||
array('GLPI_ITEM_CAN_BE_SOLVED' => 0,
|
||||
'GLPI_TICKET_ID' => $itemId,
|
||||
@@ -2482,9 +2497,9 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
|
||||
'GLPI_ITEM_IMPACT' => $locItem->fields['impact'],
|
||||
'GLPI_ITEM_PRIORITY' => $locItem->fields['priority'],
|
||||
'GLPI_TICKET_GLOBAL_VALIDATION' => $locItem->fields['global_validation'] ,
|
||||
'GLPI_TICKET_TECHNICIAN_GLPI_ID' => $userId, //$technicians[0]['glpi_id'],
|
||||
'GLPI_URL' => $CFG_GLPI['url_base'].$CFG_GLPI['root_doc'],
|
||||
'GLPI_TICKET_TECHNICIAN_PM_ID' => PluginProcessmakerUser::getPMUserId( $userId ) //$technicians[0]['pm_id']
|
||||
'GLPI_TICKET_TECHNICIAN_GLPI_ID' => $userId,
|
||||
'GLPI_TICKET_TECHNICIAN_PM_ID' => PluginProcessmakerUser::getPMUserId( $userId ),
|
||||
'GLPI_URL' => $CFG_GLPI['url_base'].$CFG_GLPI['root_doc']
|
||||
) ) ;
|
||||
|
||||
if ($resultCase->status_code === 0){
|
||||
|
||||
@@ -94,6 +94,11 @@ class PluginProcessmakerTask extends CommonITILTask
|
||||
$events = array() ;
|
||||
if( isset($params['start']) ) {
|
||||
$params['begin'] = '2000-01-01 00:00:00';
|
||||
if ($params['type'] == 'group') {
|
||||
$params['who_group'] = $params['who'];
|
||||
$params['whogroup'] = $params['who'];
|
||||
$params['who'] = 0 ;
|
||||
}
|
||||
$ret = CommonITILTask::genericPopulatePlanning( 'TicketTask', $params ) ;
|
||||
|
||||
foreach( $ret as $key => $event ) {
|
||||
|
||||
@@ -63,10 +63,10 @@ function onTaskFrameLoad(event, delIndex, hideClaimButton, csrf) {
|
||||
|
||||
// if task resumé, then hide the form part
|
||||
//debugger;
|
||||
var form_resume = locContentDocument.getElementsByName('cases_Resume');
|
||||
if (form_resume.length > 0 && form_resume[0].style.display != 'none') {
|
||||
form_resume[0].style.display = 'none';
|
||||
}
|
||||
//var form_resume = locContentDocument.getElementsByName('cases_Resume');
|
||||
//if (form_resume.length > 0 && form_resume[0].style.display != 'none') {
|
||||
// form_resume[0].style.display = 'none';
|
||||
//}
|
||||
|
||||
// then look if btnGLPISendRequest exists,
|
||||
var locElt = locContentDocument.getElementById('form[btnGLPISendRequest]');
|
||||
|
||||
17
js/domain.js.php
Normal file
17
js/domain.js.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
define('GLPI_ROOT','../../..');
|
||||
include (GLPI_ROOT."/inc/includes.php");
|
||||
header("Content-type: application/javascript");
|
||||
|
||||
$config = PluginProcessmakerConfig::getInstance() ;
|
||||
if( isset($config->fields['domain']) && $config->fields['domain'] != '' ) {
|
||||
echo "
|
||||
//debugger;
|
||||
var d = document,
|
||||
g = d.createElement('script'),
|
||||
s = d.getElementsByTagName('script')[0];
|
||||
g.type = 'text/javascript';
|
||||
g.text = 'document.domain = \'".$config->fields['domain']."\';';
|
||||
s.parentNode.insertBefore(g, s);
|
||||
" ;
|
||||
}
|
||||
@@ -30,12 +30,7 @@ $LANG['processmaker']['process']['profile']="Delete permanently";
|
||||
$LANG['processmaker']['config']['name']="Name";
|
||||
$LANG['processmaker']['config']['setup']="ProcessMaker setup";
|
||||
$LANG['processmaker']['config']['mysql']="SQL server setup";
|
||||
$LANG['processmaker']['config']['URL']="Server URL";
|
||||
//$LANG['processmaker']['config']['db_server']="mySQL server";
|
||||
//$LANG['processmaker']['config']['db_user']="mySQL user";
|
||||
//$LANG['processmaker']['config']['db_password']="mySQL password (leave blank if unchanged)";
|
||||
//$LANG['processmaker']['config']['admin_user']="PM administrator user";
|
||||
//$LANG['processmaker']['config']['admin_password']="PM administrator password (leave blank if unchanged)";
|
||||
$LANG['processmaker']['config']['URL']="Server URL (must be in same domain than GLPI)";
|
||||
$LANG['processmaker']['config']['workspace']="Workspace Name";
|
||||
$LANG['processmaker']['config']['admin']['user']="Server administrator name";
|
||||
$LANG['processmaker']['config']['admin']['password']="Server administrator password";
|
||||
@@ -51,6 +46,8 @@ $LANG['processmaker']['config']['undermaintenance']="Under maintenance, please t
|
||||
$LANG['processmaker']['config']['empty_pm_group_name']="To select group, input ProcessMaker config first!";
|
||||
$LANG['processmaker']['config']['test']="Test";
|
||||
$LANG['processmaker']['config']['connectionstatus']="Connection status";
|
||||
$LANG['processmaker']['config']['domain']="Common domain with GLPI";
|
||||
$LANG['processmaker']['config']['domain-error']="None!";
|
||||
|
||||
$LANG['processmaker']['item']['tab']="Process - Case";
|
||||
$LANG['processmaker']['item']['cancelledcase']="Status: Cancelled";
|
||||
@@ -90,6 +87,7 @@ $LANG['processmaker']['item']['case']['casechangeloghistory']='Change log histor
|
||||
|
||||
$LANG['processmaker']['item']['error'][11]="Error creating case!";
|
||||
$LANG['processmaker']['item']['error'][14]="Can't create case: no rights for it!";
|
||||
$LANG['processmaker']['item']['error'][100]=$LANG['processmaker']['item']['error'][11];
|
||||
|
||||
$LANG['processmaker']['item']['preventsolution'][1]="A 'Case' is running!";
|
||||
$LANG['processmaker']['item']['preventsolution'][2]="You must manage it first (see 'Process - Case' tab)!";
|
||||
|
||||
@@ -30,12 +30,7 @@ $LANG['processmaker']['process']['profile']="Effacer définitivement";
|
||||
$LANG['processmaker']['config']['name']="Nom";
|
||||
$LANG['processmaker']['config']['setup']="Configuration du serveur ProcessMaker";
|
||||
$LANG['processmaker']['config']['mysql']="Configuration du serveur SQL";
|
||||
$LANG['processmaker']['config']['URL']="URL du serveur";
|
||||
//$LANG['processmaker']['config']['db_server']="Serveur mySQL";
|
||||
//$LANG['processmaker']['config']['db_user']="Utilisateur mySQL";
|
||||
//$LANG['processmaker']['config']['db_password']="Mot de passe mySQL (vide si inchangé)";
|
||||
//$LANG['processmaker']['config']['admin_user']="Administrateur de PM";
|
||||
//$LANG['processmaker']['config']['admin_password']="Mot de passed de l'administrateur de PM (vide si inchangé)";
|
||||
$LANG['processmaker']['config']['URL']="URL du serveur (doit être dans le même domaine que GLPI)";
|
||||
$LANG['processmaker']['config']['workspace']="Nom du Workspace";
|
||||
$LANG['processmaker']['config']['admin']['user']="Non de l'administreur du server ProcessMaker";
|
||||
$LANG['processmaker']['config']['admin']['password']="Mot de passe de l'administrateur du serveur ProcessMaker";
|
||||
@@ -51,6 +46,8 @@ $LANG['processmaker']['config']['undermaintenance']="En maintenance, veuillez r
|
||||
$LANG['processmaker']['config']['empty_pm_group_name']="Pour sélectionner un groupe, renseigner d'abord la config de ProcessMaker !";
|
||||
$LANG['processmaker']['config']['test']="Test";
|
||||
$LANG['processmaker']['config']['connectionstatus']="Status de la connexion";
|
||||
$LANG['processmaker']['config']['domain']="Domaine utilisé";
|
||||
$LANG['processmaker']['config']['domain-error']="Aucun !";
|
||||
|
||||
$LANG['processmaker']['item']['tab']="Processus - Cas";
|
||||
$LANG['processmaker']['item']['cancelledcase']="Statut : Annulé";
|
||||
@@ -90,6 +87,7 @@ $LANG['processmaker']['item']['case']['casechangeloghistory']='Historique évolu
|
||||
|
||||
$LANG['processmaker']['item']['error'][11]="Erreur à la création du cas !";
|
||||
$LANG['processmaker']['item']['error'][14]="Impossible de créer le cas : pas de droits pour cela !";
|
||||
$LANG['processmaker']['item']['error'][100]=$LANG['processmaker']['item']['error'][11];
|
||||
|
||||
$LANG['processmaker']['item']['preventsolution'][1]="Un 'Cas' est en cours !";
|
||||
$LANG['processmaker']['item']['preventsolution'][2]="Vous devez d'abord le terminer (voir onglet 'Processus - Cas') !";
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</authors>
|
||||
<versions>
|
||||
<version>
|
||||
<num>3.1.0</num>
|
||||
<num>3.1.1</num>
|
||||
<compatibility>9.1</compatibility>
|
||||
</version>
|
||||
</versions>
|
||||
|
||||
@@ -72,7 +72,6 @@ function plugin_init_processmaker() {
|
||||
$PLUGIN_HOOKS['pre_item_update']['processmaker'] = array(
|
||||
'Ticket' => 'plugin_pre_item_update_processmaker'
|
||||
);
|
||||
// , 'TicketFollowup' => 'plugin_pre_item_update_processmaker_followup'
|
||||
|
||||
$PLUGIN_HOOKS['item_update']['processmaker'] = array(
|
||||
'TicketSatisfaction' => 'plugin_item_update_processmaker_satisfaction',
|
||||
@@ -99,6 +98,7 @@ function plugin_init_processmaker() {
|
||||
'Ticket_User' => 'plugin_item_purge_processmaker'
|
||||
) ;
|
||||
|
||||
$PLUGIN_HOOKS['add_javascript']['processmaker'] = array("js/domain.js.php");
|
||||
$url = explode("/", $_SERVER['PHP_SELF']);
|
||||
$pageName = explode("?", array_pop($url));
|
||||
switch($pageName[0]) {
|
||||
@@ -106,9 +106,8 @@ function plugin_init_processmaker() {
|
||||
case "helpdesk.public.php":
|
||||
//$plug = new Plugin;
|
||||
//if( !$plug->isActivated('rayusermanagementticket') )
|
||||
$PLUGIN_HOOKS['add_javascript']['processmaker'] = "js/helpdesk.public.js.php";
|
||||
$PLUGIN_HOOKS['add_javascript']['processmaker'][] = "js/helpdesk.public.js.php";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$PLUGIN_HOOKS['use_massive_action']['processmaker'] = 1;
|
||||
@@ -124,7 +123,7 @@ function plugin_version_processmaker(){
|
||||
global $LANG;
|
||||
|
||||
return array ('name' => 'Process Maker',
|
||||
'version' => '3.1.0',
|
||||
'version' => '3.1.1',
|
||||
'author' => 'Olivier Moron',
|
||||
'homepage' => '',
|
||||
'minGlpiVersion' => '9.1');
|
||||
|
||||
Reference in New Issue
Block a user