Debut ticket module

This commit is contained in:
Laurent Destailleur 2018-04-12 23:33:38 +02:00
parent ace55ba569
commit ce402abda2
6 changed files with 58 additions and 72 deletions

View File

@ -70,8 +70,10 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
/*
* Add file in email form
* Actions
*/
// Add file in email form
if (GETPOST('addfile') && !GETPOST('add_ticket')) {
////$res = $object->fetch('',GETPOST('track_id'));
////if($res > 0)
@ -89,9 +91,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) {
////}
}
/*
* Remove file in email form
*/
// Remove file
if (GETPOST('removedfile') && !GETPOST('add_ticket')) {
////$res = $object->fetch('',GETPOST('track_id'));
////if($res > 0)
@ -255,17 +255,20 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
{
foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
{
$qualified = true;
if ($qualified && isset($this->attributes[$object->table_element]['list'][$key]))
$enabled = 1;
if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key]))
{
$qualified = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
if (empty($result) || $result == 2) $qualified = false;
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
}
if ($qualified && isset($this->attributes[$object->table_element]['perms'][$key]))
$perms = 1;
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key]))
{
$qualified = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
}
$qualified=true;
if (empty($enabled) || $enabled == 2) $qualified = false;
if (empty($perms)) $qualified = false;
if ($qualified) $message_admin .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
}
}
@ -324,7 +327,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
*/
$arrayofjs = array();
$arrayofcss = array('/opensurvey/css/style.css', '/ticketsup/css/styles.css', '/ticketsup/css/bg.css.php');
$arrayofcss = array('/opensurvey/css/style.css', '/ticketsup/css/styles.css.php');
llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
@ -361,7 +364,7 @@ if ($action != "infos_success") {
print '<div class="info marginleftonly marginrightonly">' . $langs->trans('TicketPublicInfoCreateTicket') . '</div>';
$formticket->showForm();
} else {
print '<div class="ok">' . $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '<strong>' . $object->track_id . '</strong>');
print '<div class="info center">' . $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '<strong>' . $object->track_id . '</strong>');
print '<br>';
print $langs->trans('PleaseRememberThisId');
}

View File

@ -66,7 +66,7 @@ $form = new Form($db);
$formticket = new FormTicketsup($db);
$arrayofjs = array();
$arrayofcss = array('/ticketsup/css/styles.css', '/ticketsup/css/bg.css.php');
$arrayofcss = array('/ticketsup/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) {

View File

@ -134,7 +134,7 @@ $user_create = new User($db);
$formticket = new FormTicketsup($db);
$arrayofjs = array();
$arrayofcss = array('/ticketsup/css/styles.css', '/ticketsup/css/bg.css.php');
$arrayofcss = array('/ticketsup/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) {

View File

@ -125,7 +125,7 @@ $form = new Form($db);
$formticket = new FormTicketsup($db);
$arrayofjs = array();
$arrayofcss = array('/ticketsup/css/styles.css', '/ticketsup/css/bg.css.php');
$arrayofcss = array('/ticketsup/css/styles.css.php');
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) {

View File

@ -1,57 +0,0 @@
<?php
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
if (! defined('NOREQUIRESOC')) {
define('NOREQUIRESOC', '1');
}
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
if (! defined('NOCSRFCHECK')) {
define('NOCSRFCHECK', 1);
}
if (! defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', 1);
}
if (! defined('NOLOGIN')) {
define('NOLOGIN', 1); // File must be accessed by logon page so without login
}if (! defined('NOREQUIREMENU')) {
define('NOREQUIREMENU', 1);
}
if (! defined('NOREQUIREHTML')) {
define('NOREQUIREHTML', 1);
}
if (! defined('NOREQUIREAJAX')) {
define('NOREQUIREAJAX', '1');
}
session_cache_limiter(false);
require_once '../../../main.inc.php';
// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined)
if (empty($user->id) && ! empty($_SESSION['dol_login'])) {
$user->fetch('', $_SESSION['dol_login']);
}
// Define css type
header('Content-type: text/css');
// Important: Following code is to avoid page request by browser and PHP CPU at
// each Dolibarr page access.
if (empty($dolibarr_nocache)) {
header('Cache-Control: max-age=3600, public, must-revalidate');
} else {
header('Cache-Control: no-cache');
}
// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) {
ob_start("ob_gzhandler");
}
print 'html {';
if (! empty($conf->global->TICKETS_SHOW_MODULE_LOGO)) {
print 'background: url("../public/img/bg_ticket.png") no-repeat 95% 90%;';
}
print '}';

View File

@ -1,3 +1,43 @@
<?php
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FI8TNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/ticketsup/css/styles.css.php
* \brief File for CSS style sheet for ticket module
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
if (! defined('NOLOGIN')) define('NOLOGIN',1); // File must be accessed by logon page so without login
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(FALSE);
require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
?>
html {
min-height: 100%; height: 100%;
}