Skip to content

Commit

Permalink
Dolibarrize module ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 11, 2018
1 parent 6ac0708 commit ae82d04
Show file tree
Hide file tree
Showing 27 changed files with 101 additions and 104 deletions.
28 changes: 13 additions & 15 deletions htdocs/admin/ticketsup.php
Expand Up @@ -18,14 +18,15 @@

/**
* \file admin/ticketsup.php
* \ingroup ticketsup
* \brief This file is a module setup page
* \ingroup ticketsup
* \brief This file is a module setup page
*/

require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
require_once DOL_DOCUMENT_ROOT."/ticketsup/class/ticketsup.class.php";
require_once DOL_DOCUMENT_ROOT."/core/lib/ticketsup.lib.php";

// Translations
$langs->load("ticketsup");

Expand Down Expand Up @@ -214,9 +215,12 @@
}
}



/*
* View
*/

$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);

$form = new Form($db);
Expand All @@ -226,28 +230,22 @@
llxHeader('', $langs->trans($page_name), $help_url);

// Subheader
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">'
. $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans($page_name), $linkback);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';

print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');

// Configuration header
$head = ticketsupAdminPrepareHead();
dol_fiche_head(
$head,
'settings',
$langs->trans("Module56000Name"),
0,
"ticketsup"
);

print '<div class="info"><p>' . $langs->trans("TicketsupSetupDictionaries") . ' : <a href="' . dol_buildpath('/admin/dict.php', 1) . '" >' . dol_buildpath('/admin/dict.php', 2) . '</a></p></div>';
dol_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticketsup");

print '<p>' . $langs->trans("TicketsupPublicAccess") . ' : <a href="' . dol_buildpath('/ticketsup/public/index.php', 1) . '" target="_blank" >' . dol_buildpath('/ticketsup/public/index.php', 2) . '</a></p>';
print $langs->trans("TicketsupSetupDictionaries") . ' : <a href="' . dol_buildpath('/admin/dict.php', 1) . '" >' . dol_buildpath('/admin/dict.php', 2) . '</a><br>';

//print '<p>'. $langs->trans("TicketsupSetupPage").'</p>';
print $langs->trans("TicketsupPublicAccess") . ' : <a href="' . dol_buildpath('/ticketsup/public/index.php', 1) . '" target="_blank" >' . dol_buildpath('/ticketsup/public/index.php', 2) . '</a>';

dol_fiche_end();


/*
* Projects Numbering model
*/
Expand Down
14 changes: 6 additions & 8 deletions htdocs/admin/ticketsup_extrafields.php
Expand Up @@ -47,11 +47,15 @@
accessforbidden();
}


/*
* Actions
*/

include DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php';



/*
* View
*/
Expand All @@ -63,17 +67,11 @@
llxHeader('', $langs->trans($page_name), $help_url);

$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("TicketsupSetup"), $linkback, 'setup');
print load_fiche_titre($langs->trans("TicketsupSetup"), $linkback, 'title_setup');

$head = ticketsupAdminPrepareHead();

dol_fiche_head(
$head,
'attributes',
$langs->trans("Module56000Name"),
0,
"ticketsup"
);
dol_fiche_head($head, 'attributes', $langs->trans("Module56000Name"), -1, "ticketsup");

require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/boxes/box_last_modified_ticketsup.php
Expand Up @@ -31,7 +31,7 @@ class box_last_modified_ticketsup extends ModeleBoxes
{

public $boxcode = "box_last_modified_ticketsup";
public $boximg = "ticketsup@ticketsup";
public $boximg = "ticketsup";
public $boxlabel;
public $depends = array("ticketsup");
public $db;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/boxes/box_last_ticketsup.php
Expand Up @@ -31,7 +31,7 @@ class box_last_ticketsup extends ModeleBoxes
{

public $boxcode = "box_last_ticketsup";
public $boximg = "ticketsup@ticketsup";
public $boximg = "ticketsup";
public $boxlabel;
public $depends = array("ticketsup");
public $db;
Expand Down
6 changes: 4 additions & 2 deletions htdocs/core/class/html.formticketsup.class.php
Expand Up @@ -122,7 +122,7 @@ public function showForm($width = '100%')

$langs->load("other");
$langs->load("mails");
$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");

$form = new Form($this->db);
$formcompany = new FormCompany($this->db);
Expand All @@ -148,6 +148,7 @@ public function showForm($width = '100%')
}
print '<input type="hidden" name="fk_user_create" value="' . $this->fk_user_create . '">';

print '<div class="tabBar tabBarWithBottom">';
print '<table class="border" width="' . $width . '">';


Expand Down Expand Up @@ -194,7 +195,7 @@ public function showForm($width = '100%')
}
});
});
function runJsCodeForEvent'.$htmlname.'(obj) {
console.log("Run runJsCodeForEvent'.$htmlname.'");
var id = $("#'.$htmlname.'").val();
Expand Down Expand Up @@ -392,6 +393,7 @@ function(response) {
}

print '</table>';
print '</div>';

print '<center>';
print '<input class="button" type="submit" name="add_ticket" value="' . $langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")) . '" />';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/translate.class.php
Expand Up @@ -205,7 +205,7 @@ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfil
// Check cache
if (! empty($this->_tab_loaded[$newdomain])) // File already loaded for this domain
{
//dol_syslog("Translate::Load already loaded for newdomain=".$newdomain);
dol_syslog("Translate::Load already loaded for newdomain=".$newdomain);
return 0;
}

Expand All @@ -231,7 +231,7 @@ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfil

$filelangexists=is_file($file_lang_osencoded);

//dol_syslog(get_class($this).'::Load Try to read for alt='.$alt.' langofdir='.$langofdir.' newdomain='.$domain.' modulename='.$modulename.' file_lang='.$file_lang." => filelangexists=".$filelangexists);
dol_syslog(get_class($this).'::Load Try to read for alt='.$alt.' langofdir='.$langofdir.' newdomain='.$domain.' modulename='.$modulename.' file_lang='.$file_lang." => filelangexists=".$filelangexists);

if ($filelangexists)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/ticketsup.lib.php
Expand Up @@ -31,7 +31,7 @@ function ticketsupAdminPrepareHead()
{
global $langs, $conf;

$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");

$h = 0;
$head = array();
Expand Down
22 changes: 11 additions & 11 deletions htdocs/core/modules/modTicketsup.class.php
Expand Up @@ -74,7 +74,7 @@ public function __construct($db)
// use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png
// use this->picto='pictovalue@module'
$this->picto = 'ticketsup@ticketsup'; // mypicto@ticketsup
$this->picto = 'ticketsup'; // mypicto@ticketsup
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
// for default path (eg: /ticketsup/core/xxxxx) (0=disable, 1=enable)
// for specific path of parts (eg: /ticketsup/core/modules/barcode)
Expand Down Expand Up @@ -135,7 +135,7 @@ public function __construct($db)
$conf->ticketsup->enabled=0;
}
$this->dictionaries = array(
'langs' => 'ticketsup@ticketsup',
'langs' => 'ticketsup',
'tabname' => array(MAIN_DB_PREFIX . "c_ticketsup_type", MAIN_DB_PREFIX . "c_ticketsup_category", MAIN_DB_PREFIX . "c_ticketsup_severity"),
'tablib' => array("TicketsupDictType", "TicketsupDictCategory", "TicketsupDictSeverity"),
'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticketsup_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticketsup_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticketsup_severity as f'),
Expand All @@ -153,10 +153,10 @@ public function __construct($db)
$r = 0;
// Example:

$this->boxes[$r][1] = "box_last_ticketsup@ticketsup";
$this->boxes[$r][1] = "box_last_ticketsup";
$r++;

$this->boxes[$r][1] = "box_last_modified_ticketsup@ticketsup";
$this->boxes[$r][1] = "box_last_modified_ticketsup";
$r++;

// Permissions
Expand Down Expand Up @@ -209,7 +209,7 @@ public function __construct($db)
'mainmenu' => 'ticketsup',
'leftmenu' => '1', // Use 1 if you also want to add left menu entries using this descriptor.
'url' => '/ticketsup/index.php',
'langs' => 'ticketsup@ticketsup', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs' => 'ticketsup', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 100,
'enabled' => '1', // Define condition to show or hide menu entry. Use '$conf->ticketsup->enabled' if entry must be visible if module is enabled.
'perms' => '$user->rights->ticketsup->read', // Use 'perms'=>'$user->rights->ticketsup->level1->level2' if you want your menu with a permission rules
Expand All @@ -223,7 +223,7 @@ public function __construct($db)
'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsup',
'url' => '/ticketsup/index.php',
'langs' => 'ticketsup@ticketsup',
'langs' => 'ticketsup',
'position' => 101,
'enabled' => 1,
'perms' => '$user->rights->ticketsup->read',
Expand All @@ -236,7 +236,7 @@ public function __construct($db)
'titre' => 'NewTicket',
'mainmenu' => 'ticketsup',
'url' => '/ticketsup/new.php?action=create_ticket',
'langs' => 'ticketsup@ticketsup',
'langs' => 'ticketsup',
'position' => 102,
'enabled' => 1,
'perms' => '$user->rights->ticketsup->write',
Expand All @@ -250,7 +250,7 @@ public function __construct($db)
'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsuplist',
'url' => '/ticketsup/list.php',
'langs' => 'ticketsup@ticketsup',
'langs' => 'ticketsup',
'position' => 103,
'enabled' => 1,
'perms' => '$user->rights->ticketsup->read',
Expand All @@ -264,7 +264,7 @@ public function __construct($db)
'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsuplist',
'url' => '/ticketsup/list.php?search_fk_status=non_closed',
'langs' => 'ticketsup@ticketsup',
'langs' => 'ticketsup',
'position' => 104,
'enabled' => 1,
'perms' => '$user->rights->ticketsup->read',
Expand All @@ -278,7 +278,7 @@ public function __construct($db)
'mainmenu' => 'ticketsup',
'leftmenu' => 'ticketsupmy',
'url' => '/ticketsup/list.php?mode=my_assign',
'langs' => 'ticketsup@ticketsup',
'langs' => 'ticketsup',
'position' => 105,
'enabled' => 1,
'perms' => '$user->rights->ticketsup->read',
Expand All @@ -291,7 +291,7 @@ public function __construct($db)
'titre' => 'MenuTicketsupMyAssignNonClosed',
'mainmenu' => 'ticketsup',
'url' => '/ticketsup/list.php?mode=my_assign&search_fk_status=non_closed',
'langs' => 'ticketsup@ticketsup',
'langs' => 'ticketsup',
'position' => 106,
'enabled' => 1,
'perms' => '$user->rights->ticketsup->read',
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/modules_ticketsup.php
Expand Up @@ -49,7 +49,7 @@ public function isEnabled()
public function info()
{
global $langs;
$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");
return $langs->trans("NoDescription");
}

Expand All @@ -61,7 +61,7 @@ public function info()
public function getExample()
{
global $langs;
$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");
return $langs->trans("NoExample");
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/ticketsup/mod_ticketsup_universal.php
Expand Up @@ -43,7 +43,7 @@ public function info()
{
global $conf, $langs;

$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");
$langs->load("admin");

$form = new Form($this->db);
Expand Down
Expand Up @@ -50,7 +50,7 @@ public function __construct($db)
$this->family = "ticketsup";
$this->description = "Triggers of the module ticketsup";
$this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version
$this->picto = 'ticketsup@ticketsup';
$this->picto = 'ticketsup';
}

/**
Expand Down Expand Up @@ -176,7 +176,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
$filename = array();
$mimetype = array();

$langs->load('ticketsup@ticketsup');
$langs->load('ticketsup');

$object->fetch('', $object->track_id);

Expand Down
1 change: 1 addition & 0 deletions htdocs/install/mysql/migration/7.0.0-8.0.0.sql
Expand Up @@ -146,6 +146,7 @@ CREATE TABLE llx_ticketsup
tms timestamp
)ENGINE=innodb;

ALTER TABLE llx_ticketsup ADD COLUMN notify_tiers_at_create integer;
ALTER TABLE llx_ticketsup ADD UNIQUE uk_ticketsup_rowid_track_id (rowid, track_id);
ALTER TABLE llx_ticketsup ADD INDEX id_ticketsup_track_id (track_id);

Expand Down
3 changes: 2 additions & 1 deletion htdocs/install/mysql/tables/llx_ticketsup.sql
Expand Up @@ -18,7 +18,7 @@ CREATE TABLE llx_ticketsup
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
ref varchar(128) NOT NULL,
ref varchar(128) NOT NULL,
track_id varchar(128) NOT NULL,
fk_soc integer DEFAULT 0,
fk_project integer DEFAULT 0,
Expand All @@ -37,5 +37,6 @@ CREATE TABLE llx_ticketsup
datec datetime,
date_read datetime,
date_close datetime,
notify_tiers_at_create,
tms timestamp
)ENGINE=innodb;
2 changes: 1 addition & 1 deletion htdocs/langs/en_US/ticketsup.lang
Expand Up @@ -180,7 +180,7 @@ TicketMessageSuccessfullyAdded=Message successfully added
TicketMessagesList=Message list
NoMsgForThisTicket=No message for this ticket
Properties=Classification
LastNewTickets=Last %s tickets newest (not read)
LatestNewTickets=Last %s tickets newest (not read)
TicketSeverity=Severity
ShowTicket=See ticket
RelatedTickets=Related tickets
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/ticketsup/create_ticket.php
Expand Up @@ -56,7 +56,7 @@
$langs->load("companies");
$langs->load("other");
$langs->load("mails");
$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");

// Get parameters
$id = GETPOST('id', 'int');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/ticketsup/index.php
Expand Up @@ -51,7 +51,7 @@
// Load traductions files requiredby by page
$langs->load("companies");
$langs->load("other");
$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");
$langs->load("errors");

// Get parameters
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/ticketsup/list.php
Expand Up @@ -42,7 +42,7 @@
// Load traductions files requiredby by page
$langs->load("companies");
$langs->load("other");
$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");

// Get parameters
$track_id = GETPOST('track_id', 'alpha');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/ticketsup/view.php
Expand Up @@ -42,7 +42,7 @@
// Load traductions files requiredby by page
$langs->load("companies");
$langs->load("other");
$langs->load("ticketsup@ticketsup");
$langs->load("ticketsup");

// Get parameters
$track_id = GETPOST('track_id', 'alpha');
Expand Down

0 comments on commit ae82d04

Please sign in to comment.