Commit c76d12b6 authored by Jean-Paul Saman's avatar Jean-Paul Saman

import of helpdesk module version 0.8

parents
This diff is collapsed.
2009-07-16 - Field "Hours worked" added to helpdesk item edit form. Can be used to log spent time when creating new item
2009-07-20 - permissions related updates
2009-07-22 - notification system redesigned to be more flexible and to minimize emails sent:
- only one email is sent when tasklog modified status/calltype/etc.
- unified email format for tasklogs and ticket modifications emails
- if ticket is created and remain Unassigned email is sent
to an address defined in helpdesk configuration in case of email notification required
- added configuration radioboxes to choose whether watchers / requestor
are notified about all logs or only about status changes (incl. requestor change & calltype change)
- emails are not sent to current user
- if ticket is created by an user from non-helpdesk company, the user is filled-in as requestor
- localization applied on notification texts ( I hope everywhere )
2009-07-24 - when adding watchers notifications were not send always correctly. Unified with another notification emails.
\ No newline at end of file
This diff is collapsed.
<?php
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly');
}
global $AppUI;
/*
* This is a horrible ugly hack.. we need to rethink how we do contact lookups, etc.
*
*/
$contact_id = (int) w2PgetParam( $_POST, 'contact_id', 0 );
$helpdesk = new CHelpDesk();
echo $helpdesk->lookup_contact($contact_id);
die();
<?php /* HELPDESK $Id$ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$del = w2PgetParam($_POST, 'del', 0);
$isNotNew = $_POST['task_log_id'];
$perms = &$AppUI->acl();
if ($del) {
if (!$perms->checkModule('task_log', 'delete')) {
$AppUI->redirect(ACCESS_DENIED);
}
} elseif ($isNotNew) {
if (!$perms->checkModule('task_log', 'edit')) {
$AppUI->redirect(ACCESS_DENIED);
}
} else {
if (!$perms->checkModule('task_log', 'add')) {
$AppUI->redirect(ACCESS_DENIED);
}
}
$obj = new CTask_Log();
if (!$obj->bind($_POST)) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
$redir='m=helpdesk&a=view&tab=0&item_id=' . $obj->task_log_help_desk_id;
$AppUI->setMsg('Task Log');
if ($del) {
if (($msg = $obj->delete())) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
} else {
$AppUI->setMsg('deleted', UI_MSG_ALERT);
}
}
$AppUI->redirect($redir);
This diff is collapsed.
<?php /* HELPDESK $Id: export.php v 0.1*/
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly');
}
include_once 'helpdesk.functions.php';
//KZHAO 10-24-2006
global $HELPDESK_CONFIG, $w2Pconfig;
$item_id = (int) w2PgetParam($_GET, 'item_id', 0);
// Pull data
$q = new w2p_Database_Query;
$q->addQuery('*');
$q->addTable('helpdesk_items');
$q->addWhere('item_id = ' . $item_id);
$hditem = $q->loadHash();
// Check permissions for this record
if ($item_id) {
// Already existing item
$canEdit = $perms->checkModule($m, 'edit') && hditemEditable($hditem);
} else {
echo "Cannot find the item id!";
return;
}
if (!$canEdit) {
$AppUI->redirect(ACCESS_DENIED);
}
//KZHAO 10-24-2006
//Load helpdesk item
$org_hditem = new CHelpDesk();
$org_hditem->load( $item_id );
//Check required information before export
if (!@$hditem["item_project_id"]) {
$AppUI->setMsg( "Project must be specified for this item before exporting to task!" , UI_MSG_ERROR );
$AppUI->redirect("m=helpdesk&a=view&item_id=$item_id");
}
//KZHAO 7-10-2007
// Item with associated task cannot be exported
if (@$hditem["item_task_id"]) {
$AppUI->setMsg( "Item with associated task cannot be exported to another task!" , UI_MSG_ERROR );
$AppUI->redirect("m=helpdesk&a=view&item_id=$item_id");
}
//KZHAO 10-24-2006
// Check status
if ($ist[@$hditem["item_status"]]=="Closed") {
$AppUI->setMsg( "Closed helpdesk items cannot be exported to tasks!" , UI_MSG_ERROR );
$AppUI->redirect("m=helpdesk&a=view&item_id=$item_id");
}
if (!@$hditem["item_assigned_to"] && $HELPDESK_CONFIG['default_assigned_to_current_user']) {
@$hditem["item_assigned_to"] = $AppUI->user_id;
@$hditem["item_status"] = 1;
}
if (!@$hditem["item_company_id"] && $HELPDESK_CONFIG['default_company_current_company']) {
@$hditem["item_company_id"] = $AppUI->user_company;
}
// Setup the title block
$df = $AppUI->getPref('SHDATEFORMAT');
$tf = $AppUI->getPref('TIMEFORMAT');
$item_date = new w2p_Utilities_Date( $hditem["item_created"] );
$deadline_date = new w2p_Utilities_Date( $hditem["item_deadline"] );
$tc = $item_date->format( "$df $tf" );
$dateNow = new w2p_Utilities_Date();
$dateNowSQL = $dateNow->format( FMT_DATETIME_MYSQL );
$newTask = new CTask();
$ref_task ="This task was created from Helpdesk item #".$item_id.".\n";
$ref_task.= "-----------------------\n";
if (@$hditem["item_priority"]==0 || @$hditem["item_priority"]==2) {
$taskPrio=0;
} elseif (@$hditem["item_priority"]==1) {
$taskPrio=-1;
} else {
$taskPrio=1;
}
$hditem["item_deadline"] = (isset($hditem["item_deadline"])) ? $hditem["item_deadline"] : $dateNowSQL;
$taskInfo= array( "task_id"=>0,
"task_name"=> @$hditem["item_title"],
"task_project"=> @$hditem["item_project_id"],
"task_start_date"=> $dateNowSQL,
"task_end_date"=>@$hditem["item_deadline"],
"task_priority"=>$taskPrio,
"task_owner"=> $AppUI->user_id,
"task_creator"=>$AppUI->user_id,
"task_description"=> $ref_task.@$hditem["item_summary"],
"task_contacts" => @$hditem["item_requestor_id"],
"task_related_url"=> $w2Pconfig['base_url']."/index.php?m=helpdesk&a=view&item_id=".$item_id
);
echo "<br><br>";
$result= $newTask->bind( $taskInfo);
if (!$result) {
$AppUI->setMsg( $newTask->getError(), UI_MSG_ERROR );
$AppUI->redirect();
}
$result = $newTask->store();
if (is_array($result)) {
$AppUI->setMsg( $msg, UI_MSG_ERROR );
$AppUI->redirect(); // Store failed don't continue?
} else {
$ref_hd ="This helpdesk item has been exported to task #".$newTask->task_id.".\n";
$ref_hd.="Link: ".$w2Pconfig['base_url']."/index.php?m=tasks&a=view&task_id=".$newTask->task_id."\n";
$ref_hd.="---------------------------\n";
$org_hditem->item_status=2;
$org_hditem->item_updated=$dateNowSQL;
$org_hditem->item_summary=$ref_hd.$org_hditem->item_summary;
$result = $org_hditem->store();
if (is_array($result)) {
$AppUI->setMsg( $msg, UI_MSG_ERROR );
$AppUI->redirect();
}
$newTask->updateAssigned($hditem["item_assigned_to"], array($hditem["item_assigned_to"] => 100));
$AppUI->setMsg( 'Task added!', UI_MSG_OK);
$AppUI->redirect("m=helpdesk&a=view&item_id=$item_id&tab=0");
}
-- Upgrade script for helpdesk module
-- Use this script only if you have already installed helpdesk module into dotproject.
-- Kang 12/19/2006
-- The LinuxBox Corp. www.linuxbox.com
-- Ann Arbor, MI
ALTER TABLE helpdesk_items ADD item_updated datetime DEFAULT NULL;
ALTER TABLE helpdesk_items ADD item_deadline datetime DEFAULT NULL;
This diff is collapsed.
This diff is collapsed.
<?php /* TASKS $Id: helpdesk_tab.view.files.php 5771 2008-07-15 14:41:58Z merlinyoda $ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
GLOBAL $AppUI, $project_id, $task_id, $helpdesk_id, $deny, $canRead, $canEdit, $w2Pconfig, $cfObj, $m, $obj;
global $allowed_folders_ary, $denied_folders_ary, $limited;
$cfObj = new CFileFolder();
$allowed_folders_ary = $cfObj->getAllowedRecords($AppUI->user_id);
$denied_folders_ary = $cfObj->getDeniedRecords($AppUI->user_id);
$limited = ((count( $allowed_folders_ary ) < $cfObj->countFolders()) ? true : false);
if (!$limited) {
$canEdit = true;
} elseif ($limited && array_key_exists($folder, $allowed_folders_ary)) {
$canEdit = true;
} else {
$canEdit = false;
}
$showProject = false;
if (getPermission('files', 'edit')) {
echo ('<a href="./index.php?m=files&a=addedit&project_id=' . $project_id . '&file_helpdesk_item=' . $helpdesk_id
. '&file_task=' . $task_id . '">' . $AppUI->_('Attach a file') . '</a>');
echo w2PshowImage('stock_attach-16.png', 16, 16, '', '', $m);
}
$canAccess_folders = getPermission('file_folders', 'access');
if ($canAccess_folders) {
$folder = w2PgetParam($_GET, 'folder', 0);
require( W2P_BASE_DIR . '/modules/files/folders_table.php' );
} elseif (getPermission('files', 'view')) {
require( W2P_BASE_DIR . '/modules/files/index_table.php' );
}
images/ct0.png

257 Bytes

images/ct1.png

892 Bytes

images/ct2.png

611 Bytes

images/ct3.png

257 Bytes

images/ct4.png

574 Bytes

images/ct5.png

268 Bytes

images/ct6.png

273 Bytes

images/ct7.png

858 Bytes

<html><body bgcolor="#FFFFFF"></body></html>
\ No newline at end of file
<html><body bgcolor="#FFFFFF"></body></html>
\ No newline at end of file
<?php /* HELPDESK $Id$ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly');
}
include_once 'helpdesk.functions.php';
// check permissions for this module
$canReadModule = canView( $m );
if (!$canReadModule) {
$AppUI->redirect(ACCESS_DENIED);
}
if (isset( $_GET['tab'] )) {
$AppUI->setState( 'HelpDeskIdxTab', $_GET['tab'] );
}
$tab = $AppUI->getState( 'HelpDeskIdxTab' ) !== NULL ? $AppUI->getState( 'HelpDeskIdxTab' ) : 0;
// Setup the title block
$titleBlock = new w2p_Theme_TitleBlock( 'Help Desk', 'helpdesk.png', $m, 'ID_HELP_HELPDESK_IDX' );
if (hditemCreate()) {
$titleBlock->addCell(
'<input type="submit" class="button" value="'.$AppUI->_('new item').'" />', '',
'<form action="?m=helpdesk&a=addedit" method="post">', '</form>'
);
}
$titleBlock->addCrumb( "?m=helpdesk", 'home' );
$titleBlock->addCrumb( "?m=helpdesk&a=list", 'list' );
$titleBlock->addCrumb( "?m=helpdesk&a=reports", 'reports' );
$titleBlock->show();
$item_perms = getItemPerms();
$q = new w2p_Database_Query;
$q->addQuery('COUNT(item_id)');
$q->addTable('helpdesk_items');
$q->addWhere($item_perms);
$numtotal = $q->loadResult ();
/*
* Unassigned = 0
* Open = 1
* Closed = 2
* On hold = 3
* ....
*/
$item_perms = getItemPerms();
$q = new w2p_Database_Query;
$q->addQuery('COUNT(DISTINCT(item_id))');
$q->addTable('helpdesk_items');
$q->addWhere('item_assigned_to=' . $AppUI->user_id . ' AND (item_status != 2)');
$nummine = $q->loadResult ();
$q = new w2p_Database_Query;
$q->addQuery('COUNT(DISTINCT(item_id))');
$q->addTable('helpdesk_items');
$q->addJoin('helpdesk_item_status','his','helpdesk_items.item_id = his.status_item_id');
$q->addWhere('item_status = 1 AND status_code = 0 ');
$q->addWhere($item_perms . ' AND (TO_DAYS(NOW()) - TO_DAYS(status_date) = 0)');
$numopened = $q->loadResult ();
$q = new w2p_Database_Query;
$q->addQuery('COUNT(DISTINCT(item_id))');
$q->addTable('helpdesk_items');
$q->addJoin('helpdesk_item_status','his','helpdesk_items.item_id = his.status_item_id');
$q->addWhere('item_status = 2 AND status_code = 11 ');
$q->addWhere($item_perms . ' AND (TO_DAYS(NOW()) - TO_DAYS(status_date) = 0)');
$numclosed = $q->loadResult();
?>
<table cellspacing="0" cellpadding="2" border="0" width="100%">
<tr>
<td width="80%" valign="top">
<?php
// Tabbed information boxes
$tabBox = new CTabBox( '?m=helpdesk', W2P_BASE_DIR . '/modules/helpdesk/', $tab );
$tabBox->add( 'vw_idx_stats', $AppUI->_('Help Desk Items')." ($numtotal)" );
$tabBox->add( 'vw_idx_my', $AppUI->_('My Open')." ($nummine)" );
$tabBox->add( 'vw_idx_new', $AppUI->_('Opened Today')." ($numopened)" );
$tabBox->add( 'vw_idx_closed', $AppUI->_('Closed Today')." ($numclosed)" );
$tabBox->add( 'vw_idx_watched', "Watched Tickets" );
$tabBox->show();
?>
</td>
</tr>
</table>
This diff is collapsed.
##
## DO NOT MODIFY THIS FILE BY HAND!
##
'new log',
'Add Log',
'Adding Help Desk Item',
'Ago',
'All (not closed)',
'All Companies and All Projects',
'All Helpdesk task log entries',
'All users',
'Amount',
'Application',
'Assigned To',
'Attach a file',
'Bug',
'Call Source',
'Call Type',
'Closed',
'Closed On',
'Closed Today',
'Comments',
'Company',
'Complaint',
'Configure Help Desk Module',
'Cost',
'Cost Code',
'Created',
'Created by',
'Critical',
'Date Created',
'Deadline',
'Default Actions',
'Delete this item',
'Deleted',
'E-Lodged',
'E-Mail',
'Edit log',
'Edit this item',
'Editing Help Desk Item',
'Email Notification',
'Feature Request',
'First',
'For period',
'Help Desk',
'Help Desk Item',
'Help Desk Item ID is NULL',
'Help Desk Items',
'Helpdesk Reports',
'Helpdesk Task Log Report',
'Helpdesk Task Logs',
'Helpdesk task log entries from',
'High',
'Home',
'Hours',
'Hours Worked',
'Ignore 0 hours',
'In Person',
'Invalid item id',
'IsNowWatched'=>'has been added to your watch list.',
'Item',
'Item Created',
'Item Details',
'Item History',
'Items',
'Last',
'Link',
'List',
'Log All',
'Low',
'Make PDF',
'Medium',
'My Open',
'New Helpdesk Log',
'New Item',
'New Item Default Selections',
'New Log',
'Next',
'Next Day',
'Next Month',
'Next Week',
'No Impact',
'Not Specified',
'Notify by e-mail',
'Number',
'OS',
'Off',
'On',
'On Hold',
'Open',
'Opened On',
'Opened Today',
'Operating System',
'Pages',
'Paging Options',
'Permission Options',
'Previous',
'Previous Day',
'Previous Month',
'Previous Week',
'Priority',
'Project',
'Report Totals',
'Requestor',
'Requestor E-mail',
'Requestor Phone',
'Required field',
'Reset',
'Search Fields On Item List',
'Severity',
'Start',
'Status',
'Subject',
'Suggestion',
'Summary',
'Task Log',
'Task Logs',
'Testing',
'This helpdesk item has been exported to task',
'This task is exported from Helpdesk item',
'Ticket',
'Ticket Detail',
'Ticket ID',
'Title',
'Title/Summary Search',
'Type',
'URL',
'Unassigned',
'Update',
'Updated',
'Updated Today',
'View this item',
'Viewing Help Desk Item',
'WWW',
'Watched'=>'now being watched',
'Watched Tickets',
'Watchers',
'Watchers Notification',
'Without Project',
'added',
'ago',
'cancel',
'cannot be opened',
'cannot be written to',
'changed from',
'create task log',
'day',
'days',
'delete this item',
'edit this item',
'export this item to task',
'found',
'has been successfully updated',
'helpdeskDefCompany'=>'Default \"company\" field to be that of the current user',
'helpdeskDefCurUser'=>'Default \"assigned to\" field to be the current user',
'helpdeskDefNotify'=>'Default the \"notify by email\" field to on',
'helpdeskDefThisUser'=>'Default \"assigned to\" field to be this user',
'helpdeskFieldMessage'=>'If you select your name from the popup window, your e-mail address and phone number will be populated from your account details (if available).',
'helpdeskHDCompany'=>'The company which handles Help Desk items',
'helpdeskHDDepartment'=>'The department which handles Help Desk items',
'helpdeskItemsNoCompany'=>'Items with no company should be editable by anyone',
'helpdeskItemsPerPage'=>'Number of items displayed per page on the list view',
'helpdeskLogsPerPage'=>'Number of status log items displayed per page in item view',
'helpdeskMinLevel'=>'Minimum user level to edit other users\' logs',
'helpdeskMinRepLevel'=>'Minimum user level to view reports',
'helpdeskPagesPerSide'=>'Number of pages to display on each side of current page',
'helpdeskSignature'=>'The IT Department',
'helpdeskSubmitError'=>'You must enter the following value(s)',
'helpdeskUseProjectPerms'=>'Project list based on Project, as opposed to Company, permissions.',
'home',
'hours',
'is not writable',
'list',
'month',
'months',
'new item',
'save',
'to',
'update task log',
'value for the previous buttons',
'view this item',
'week',
'weeks',
'year',
'years',
##
## DO NOT MODIFY THIS FILE BY HAND!
##
'Add Log'=>'Ajouter une action',
'Adding Help Desk Item'=>'Ajout d\'une demande d\'assistance',
'Ago'=>'passé(e)',
'All (not closed)'=>'Tous (non fermés)',
'All Companies and All Projects'=>'Toutes les sociétés et tous les projets',
'All Helpdesk task log entries'=>'Tout le temps passé pour assistance',
'All users'=>'Tous',
'Amount'=>'Montant',
'Application'=>'Application',
'Assigned To'=>'Assignée à ',
'Attach a file'=>'Joindre un fichier',
'Bug'=>'Bogue',
'Call Source'=>'Source de l\'appel',
'Call Type'=>'Type d\'appel',
'Closed'=>'Fermée',
'Closed On'=>'Fermée le',
'Closed Today'=>'Fermées aujourd\'hui',
'Comments'=>'Commentaires',
'Company'=>'Société',
'Complaint'=>'Plainte',
'Configure Help Desk Module'=>'Configurer le module d\'assistance',
'Cost'=>'Coût',
'Cost Code'=>'C.Coût',
'Created'=>'Créée',
'Created by'=>'Créée par',
'Critical'=>'Critique',
'Date Created'=>'Date de création',
'Deadline'=>'Échéance',
'Default Actions'=>'Actions',
'Delete this item'=>'Supprimer cette demande d\'assistance',
'Deleted'=>'Supprimée',
'E-Lodged'=>'Automatique',
'E-Mail'=>'Courriel',
'Edit log'=>'Editer l\'action',
'Edit this item'=>'Editer cette demande d\'assistance',
'Editing Help Desk Item'=>'Edition de la demande d\'assistance',
'Email Notification'=>'Informer par courriel',
'Feature Request'=>'Demande de fonctionalité',
'First'=>'Première',
'For period'=>'Pour la période',
'Help Desk'=>'Centre d\'assistance',
'Help Desk Item'=>'Demande d\'assistance',
'Help Desk Item ID is NULL'=>'L\'ID de la demande est nulle',
'Help Desk Items'=>'Demandes d\'assistance',
'Helpdesk Reports'=>'Rapports de demandes d\'assistance',
'Helpdesk Task Log Report'=>'Rapport de temps passé pour assistance',
'Helpdesk Task Logs'=>'Temps passé pour assistance',
'Helpdesk task log entries from'=>'Temps passé pour assistance du',
'High'=>'Elevé',
'Home'=>'Accueil',
'Hours'=>'Heures',
'Hours Worked'=>'Heures travaillées',
'Ignore 0 hours'=>'Ignorer les heures à 0',
'In Person'=>'En personne',
'Invalid item id'=>'ID de demande invalide',
'IsNowWatched'=>'A été ajoutée à votre liste de surveillance.',
'Item'=>'Demande',
'Item Created'=>'Demande créée',
'Item Details'=>'Détails de la demande',
'Item History'=>'Historique de la demande',
'Items'=>'Demandes',
'Last'=>'Dernière',
'Link'=>'Lien',
'List'=>'Liste',
'Log All'=>'Montrer tout',
'Low'=>'Bas',
'Make PDF'=>'Générer en PDF',
'Medium'=>'Moyen',
'My Open'=>'Mes demandes ouvertes',
'New Helpdesk Log'=>'Nouvelle action',
'New Item'=>'Nouvelle demande',
'New Item Default Selections'=>'Sélection par défaut pour nouvelle demande',
'New Log'=>'Nouveau temps',
'Next'=>'Prochaine',
'Next Day'=>'Jour suivant',
'Next Month'=>'Mois suivant',
'Next Week'=>'Semaine suivante',
'No Impact'=>'Aucun Impact',
'Not Specified'=>'Non spécifié',
'Notify by e-mail'=>'Informer par courriel',
'Number'=>'Numéro',
'OS'=>'SE',
'Off'=>'Eteinte',
'On'=>'Allumée',
'On Hold'=>'En Attente',
'Open'=>'Ouverte',
'Opened On'=>'Ouverte le',
'Opened Today'=>'Ouvertes aujourd\'hui',
'Operating System'=>'Système d\'exploitation',
'Pages'=>'Pages',
'Paging Options'=>'Options de pagination',
'Permission Options'=>'Options d\'authorisation',
'Previous'=>'Précédente',
'Previous Day'=>'Jour précédent',
'Previous Month'=>'Mois précédent',
'Previous Week'=>'Semaine précédente',
'Priority'=>'Priorité',
'Project'=>'Projet',
'Report Totals'=>'Totaux',
'Requestor'=>'Demandeur',
'Requestor E-mail'=>'Courriel du demandeur',
'Requestor Phone'=>'Téléphone du demandeur',
'Required field'=>'Champ obligatoire',
'Reset'=>'Réintialiser',
'Search Fields On Item List'=>'Rechercher les champs dans la liste de demandes',
'Severity'=>'Sévérité',
'Start'=>'Début',
'Status'=>'Statut',
'Subject'=>'Titre',
'Suggestion'=>'Suggestion',
'Summary'=>'Résumé',
'Task Log'=>'Temps passé',
'Task Logs'=>'Temps passé',
'Testing'=>'En cours de test',
'This helpdesk item has been exported to task'=>'Cette demande a été transformée dans la tâche',
'This task is exported from Helpdesk item'=>'Cette demande a été transformée de la demande',
'Ticket'=>'Demande',
'Ticket Detail'=>'Détails de la demande',
'Ticket ID'=>'Demande #',
'Title'=>'Titre',
'Title/Summary Search'=>'Recherche Titre/Résumé',
'Type'=>'Type',
'URL'=>'URL',
'Unassigned'=>'Non-assignée',
'Update'=>'Mise à jour',
'Updated'=>'mise à jour',
'Updated Today'=>'Mise à jour aujourd\'hui\'',
'View this item'=>'Voir cette demande',
'Viewing Help Desk Item'=>'Visualisation de la demande d\'assistance',
'WWW'=>'Internet',
'Watched'=>'maintenant surveillée',
'Watched Tickets'=>'Demandes surveillées',
'Watchers'=>'Surveillants',
'Watchers Notification'=>'Avis de surveillance',
'Without Project'=>'Sans projet',
'added'=>'ajoutée',
'ago'=>'passé(e)',
'cancel'=>'Annuler',
'cannot be opened'=>'impossible d\'ouvrir',
'cannot be written to'=>'impossible d\'écrire',
'changed from'=>'changé depuis',
'create task log'=>'créer une action',
'day'=>'jour',
'days'=>'jours',
'delete this item'=>'Supprimer cette demande',