Merge pull request #12426 from frederic34/actioncomm_category
NEW categories for actioncomm
This commit is contained in:
commit
e938f46672
@ -1747,7 +1747,7 @@ else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->showCategories($object->id, 'member', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -531,7 +531,7 @@ if ($rowid > 0)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->showCategories($object->id, 'member', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +48,11 @@ class Categories extends DolibarrApi
|
||||
3 => 'member',
|
||||
4 => 'contact',
|
||||
5 => 'account',
|
||||
//6 => 'project',
|
||||
//7 => 'user',
|
||||
//8 => 'bank_line',
|
||||
//9 => 'warehouse',
|
||||
//10 => 'actioncomm',
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@ -54,6 +54,7 @@ class Categorie extends CommonObject
|
||||
const TYPE_ACCOUNT = 'bank_account';
|
||||
const TYPE_BANK_LINE = 'bank_line';
|
||||
const TYPE_WAREHOUSE = 'warehouse';
|
||||
const TYPE_ACTIONCOMM = 'actioncomm';
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
@ -77,6 +78,7 @@ class Categorie extends CommonObject
|
||||
'user' => 7,
|
||||
'bank_line' => 8,
|
||||
'warehouse' => 9,
|
||||
'actioncomm' => 10,
|
||||
);
|
||||
|
||||
/**
|
||||
@ -93,6 +95,7 @@ class Categorie extends CommonObject
|
||||
7 => 'user',
|
||||
8 => 'bank_line',
|
||||
9 => 'warehouse',
|
||||
10 => 'actioncomm',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -111,6 +114,7 @@ class Categorie extends CommonObject
|
||||
'bank_account' => 'account',
|
||||
'project' => 'project',
|
||||
'warehouse'=> 'warehouse',
|
||||
'actioncomm' => 'actioncomm',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -129,6 +133,7 @@ class Categorie extends CommonObject
|
||||
'bank_account'=> 'account',
|
||||
'project' => 'project',
|
||||
'warehouse'=> 'warehouse',
|
||||
'actioncomm' => 'actioncomm',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -147,6 +152,7 @@ class Categorie extends CommonObject
|
||||
'bank_account' => 'Account',
|
||||
'project' => 'Project',
|
||||
'warehouse'=> 'Entrepot',
|
||||
'actioncomm' => 'ActionComm',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -164,6 +170,7 @@ class Categorie extends CommonObject
|
||||
'account' => 'bank_account',
|
||||
'project' => 'projet',
|
||||
'warehouse'=> 'entrepot',
|
||||
'actioncomm' => 'actioncomm',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -214,6 +221,7 @@ class Categorie extends CommonObject
|
||||
* @see Categorie::TYPE_PROJECT
|
||||
* @see Categorie::TYPE_BANK_LINE
|
||||
* @see Categorie::TYPE_WAREHOUSE
|
||||
* @see Categorie::TYPE_ACTIONCOMM
|
||||
*/
|
||||
public $type;
|
||||
|
||||
|
||||
@ -59,7 +59,13 @@ elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCate
|
||||
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
|
||||
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
|
||||
elseif ($type == Categorie::TYPE_WAREHOUSE) { $title=$langs->trans("StocksCategoriesArea"); $typetext='warehouse'; }
|
||||
else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; }
|
||||
elseif ($type == Categorie::TYPE_ACTIONCOMM) {
|
||||
$title = $langs->trans("ActionCommCategoriesArea");
|
||||
$typetext = 'actioncomm';
|
||||
} else {
|
||||
$title = $langs->trans("CategoriesArea");
|
||||
$typetext = 'unknown';
|
||||
}
|
||||
|
||||
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
|
||||
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
|
||||
|
||||
@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "other", "commercial", "bills", "orders", "agenda"));
|
||||
@ -374,6 +375,10 @@ if (empty($reshook) && $action == 'add')
|
||||
{
|
||||
if (!$object->error)
|
||||
{
|
||||
// Category association
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
unset($_SESSION['assignedtouser']);
|
||||
|
||||
$moreparam = '';
|
||||
@ -595,6 +600,10 @@ if (empty($reshook) && $action == 'update')
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
// Category association
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
unset($_SESSION['assignedtouser']);
|
||||
|
||||
$db->commit();
|
||||
@ -1000,6 +1009,14 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->categorie->enabled) {
|
||||
// Categories
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
|
||||
print $form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, '', 0, '100%');
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -1411,6 +1428,19 @@ if ($id > 0)
|
||||
print $form->select_dolusers($object->userdoneid > 0 ? $object->userdoneid : -1, 'doneby', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
// Tags-Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
|
||||
$c = new Categorie($db);
|
||||
$cats = $c->containing($object->id, Categorie::TYPE_ACTIONCOMM);
|
||||
$arrayselected = array();
|
||||
foreach ($cats as $cat) {
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -1717,6 +1747,12 @@ if ($id > 0)
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
print $form->showCategories($object->id, Categorie::TYPE_ACTIONCOMM, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -1510,6 +1510,50 @@ class ActionComm extends CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets object to supplied categories.
|
||||
*
|
||||
* Deletes object from existing categories not supplied.
|
||||
* Adds it to non existing supplied categories.
|
||||
* Existing categories are left untouch.
|
||||
*
|
||||
* @param int[]|int $categories Category or categories IDs
|
||||
* @return void
|
||||
*/
|
||||
public function setCategories($categories)
|
||||
{
|
||||
// Handle single category
|
||||
if (! is_array($categories)) {
|
||||
$categories = array($categories);
|
||||
}
|
||||
|
||||
// Get current categories
|
||||
include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$c = new Categorie($this->db);
|
||||
$existing = $c->containing($this->id, Categorie::TYPE_ACTIONCOMM, 'id');
|
||||
|
||||
// Diff
|
||||
if (is_array($existing)) {
|
||||
$to_del = array_diff($existing, $categories);
|
||||
$to_add = array_diff($categories, $existing);
|
||||
} else {
|
||||
$to_del = array(); // Nothing to delete
|
||||
$to_add = $categories;
|
||||
}
|
||||
|
||||
// Process
|
||||
foreach($to_del as $del) {
|
||||
if ($c->fetch($del) > 0) {
|
||||
$c->del_type($this, Categorie::TYPE_ACTIONCOMM);
|
||||
}
|
||||
}
|
||||
foreach ($to_add as $add) {
|
||||
if ($c->fetch($add) > 0) {
|
||||
$c->add_type($this, Categorie::TYPE_ACTIONCOMM);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
|
||||
@ -491,7 +491,7 @@ if ($object->id > 0)
|
||||
$langs->load("categories");
|
||||
print '<tr><td>'.$langs->trans("CustomersCategoriesShort").'</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, 'customer', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_CUSTOMER, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -690,7 +690,7 @@ else
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($object->id, 'bank_account', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -1364,7 +1364,7 @@ else
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showCategories($object->id, 'contact', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -219,165 +219,206 @@ class modAgenda extends DolibarrModules
|
||||
);
|
||||
$r++;
|
||||
|
||||
$this->menu[$r]=array('fk_menu'=>'r=0',
|
||||
'type'=>'left',
|
||||
'titre'=>'Actions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>100,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=0',
|
||||
'type'=>'left',
|
||||
'titre'=>'Actions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>100,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2,
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'NewAction',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create',
|
||||
'langs'=>'commercial',
|
||||
'position'=>101,
|
||||
'perms'=>'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'NewAction',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create',
|
||||
'langs'=>'commercial',
|
||||
'position'=>101,
|
||||
'perms'=>'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
// Calendar
|
||||
$this->menu[$r]=array('fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'Calendar',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>140,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'Calendar',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>140,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=3',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>141,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=3',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>141,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=3',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>142,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=3',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>142,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=3',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>143,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=3',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>143,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=3',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>144,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=3',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>144,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
||||
// List
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'List',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>110,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'List',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>110,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=8',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>111,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=8',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>111,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=8',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>112,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=8',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>112,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=8',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>113,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=8',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>113,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
$this->menu[$r]=array('fk_menu'=>'r=8',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>114,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=8',
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>114,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
// Reports
|
||||
$this->menu[$r]=array('fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'Reportings',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>160,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2);
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'Reportings',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>160,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
$r++;
|
||||
// Categories
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu' => 'r=1',
|
||||
'type' => 'left',
|
||||
'titre' => 'Categories',
|
||||
'mainmenu' => 'agenda',
|
||||
'url'=>'/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10',
|
||||
'langs' => 'agenda',
|
||||
'position' => 170,
|
||||
'perms' => '$user->rights->agenda->allactions->read',
|
||||
'enabled' => '$conf->categorie->enabled&&$conf->categorie->enabled',
|
||||
'target' => '',
|
||||
'user' => 2
|
||||
);
|
||||
$r++;
|
||||
|
||||
|
||||
|
||||
@ -312,7 +312,7 @@ if ($object->id > 0)
|
||||
$langs->load("categories");
|
||||
print '<tr><td>'.$langs->trans("SuppliersCategoriesShort").'</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, 'supplier', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ UPDATE llx_holiday SET ref = rowid WHERE ref IS NULL;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_holiday ALTER COLUMN ref SET NOT NULL;
|
||||
|
||||
ALTER TABLE llx_c_email_senderprofile MODIFY COLUMN active tinyint DEFAULT 1 NOT NULL;
|
||||
|
||||
|
||||
insert into llx_c_type_container (code,label,module,active) values ('menu', 'Menu', 'system', 1);
|
||||
|
||||
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('HELP', '15', 'Request for functionnal help', 1, 0, NULL);
|
||||
@ -532,22 +532,22 @@ ALTER TABLE llx_comment ADD COLUMN fk_user_modif integer DEFAULT NULL;
|
||||
|
||||
|
||||
CREATE TABLE llx_mrp_production(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_mo integer NOT NULL,
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_mo integer NOT NULL,
|
||||
position integer NOT NULL DEFAULT 0,
|
||||
fk_product integer NOT NULL,
|
||||
fk_product integer NOT NULL,
|
||||
fk_warehouse integer,
|
||||
qty real NOT NULL DEFAULT 1,
|
||||
qty_frozen smallint DEFAULT 0,
|
||||
disable_stock_change smallint DEFAULT 0,
|
||||
disable_stock_change smallint DEFAULT 0,
|
||||
batch varchar(30),
|
||||
role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation)
|
||||
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
|
||||
fk_stock_movement integer, -- id of stock movement when movements are validated
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14)
|
||||
) ENGINE=innodb;
|
||||
ALTER TABLE llx_mrp_production MODIFY COLUMN qty real NOT NULL DEFAULT 1;
|
||||
|
||||
@ -59,6 +59,22 @@ create table llx_object_lang
|
||||
|
||||
ALTER TABLE llx_object_lang ADD UNIQUE INDEX uk_object_lang (fk_object, type_object, property, lang);
|
||||
|
||||
|
||||
CREATE TABLE llx_categorie_actioncomm
|
||||
(
|
||||
fk_categorie integer NOT NULL,
|
||||
fk_actioncomm integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_categorie_actioncomm ADD PRIMARY KEY pk_categorie_actioncomm (fk_categorie, fk_actioncomm);
|
||||
ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_categorie (fk_categorie);
|
||||
ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_actioncomm (fk_actioncomm);
|
||||
|
||||
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm (id);
|
||||
|
||||
|
||||
ALTER TABLE llx_accounting_account ADD COLUMN labelshort varchar(255) DEFAULT NULL after label;
|
||||
|
||||
|
||||
|
||||
25
htdocs/install/mysql/tables/llx_categorie_actioncomm.key.sql
Normal file
25
htdocs/install/mysql/tables/llx_categorie_actioncomm.key.sql
Normal file
@ -0,0 +1,25 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
-- Copyright (C) 2016-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
--
|
||||
-- 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 FITNESS 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 <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ============================================================================
|
||||
|
||||
ALTER TABLE llx_categorie_actioncomm ADD PRIMARY KEY pk_categorie_actioncomm (fk_categorie, fk_actioncomm);
|
||||
ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_categorie (fk_categorie);
|
||||
ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_actioncomm (fk_actioncomm);
|
||||
|
||||
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm (id);
|
||||
26
htdocs/install/mysql/tables/llx_categorie_actioncomm.sql
Normal file
26
htdocs/install/mysql/tables/llx_categorie_actioncomm.sql
Normal file
@ -0,0 +1,26 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
-- Copyright (C) 2016-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
--
|
||||
-- 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 FITNESS 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 <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- Table to link actioncomm tag/categories with actioncomms
|
||||
-- ===========================================================================
|
||||
|
||||
CREATE TABLE llx_categorie_actioncomm
|
||||
(
|
||||
fk_categorie integer NOT NULL,
|
||||
fk_actioncomm integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
) ENGINE=innodb;
|
||||
@ -90,4 +90,5 @@ ShowCategory=Show tag/category
|
||||
ByDefaultInList=By default in list
|
||||
ChooseCategory=Choose category
|
||||
StocksCategoriesArea=Warehouses Categories Area
|
||||
ActionCommCategoriesArea=Events Categories Area
|
||||
UseOrOperatorForCategories=Use or operator for categories
|
||||
|
||||
@ -1992,7 +1992,7 @@ else
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
print $form->showCategories($object->id, 'product', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_PRODUCT, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -454,7 +454,7 @@ else
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
print $form->showCategories($object->id, 'warehouse', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
@ -1086,7 +1086,7 @@ elseif ($object->id > 0)
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($object->id, 'project', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ print '</td></tr>';
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($object->id, 'project', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -271,7 +271,7 @@ if ($id > 0 || ! empty($ref))
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($object->id, 'project', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -247,7 +247,7 @@ print '</td></tr>';
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($object->id, 'project', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -204,7 +204,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref))
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($object->id, 'project', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -479,7 +479,7 @@ if ($id > 0 || !empty($ref))
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($object->id, 'project', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -2561,7 +2561,7 @@ else
|
||||
if ($object->prospect || $object->client || (!$object->fournisseur && !empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) {
|
||||
print '<tr><td>'.$langs->trans("CustomersCategoriesShort").'</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, 'customer', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_CUSTOMER, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
@ -2569,7 +2569,7 @@ else
|
||||
if ($object->fournisseur) {
|
||||
print '<tr><td>'.$langs->trans("SuppliersCategoriesShort").'</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, 'supplier', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1772,7 +1772,7 @@ else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showCategories($object->id, 'user', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_USER, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -2633,7 +2633,7 @@ else
|
||||
{
|
||||
print $form->multiselectarray('usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
|
||||
} else {
|
||||
print $form->showCategories($object->id, 'user', 1);
|
||||
print $form->showCategories($object->id, Categorie::TYPE_USER, 1);
|
||||
}
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user