merge develop
This commit is contained in:
commit
806b40662f
@ -50,7 +50,7 @@ jobs:
|
|||||||
- if: type = push AND branch = develop
|
- if: type = push AND branch = develop
|
||||||
php: nightly
|
php: nightly
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- if: type = push AND branch = 13.0
|
- if: type = push AND branch = 14.0
|
||||||
php: nightly
|
php: nightly
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
|
|
||||||
@ -401,6 +401,9 @@ script:
|
|||||||
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log
|
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log
|
||||||
php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log
|
php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log
|
||||||
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
|
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
|
||||||
|
php upgrade.php 13.0.0 14.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade13001400.log
|
||||||
|
php upgrade2.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-2.log
|
||||||
|
php step5.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-3.log
|
||||||
|
|
||||||
# Enable modules not enabled into original dump
|
# Enable modules not enabled into original dump
|
||||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP > $TRAVIS_BUILD_DIR/enablemodule.log
|
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||||
|
|||||||
18
ChangeLog
18
ChangeLog
@ -182,8 +182,8 @@ NEW: Add option "If the feature to manage kits of module Stock is used, show det
|
|||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
---------------
|
---------------
|
||||||
NEW: add __MEMBER_TYPE__ substitution key
|
NEW: add substitution key __MEMBER_TYPE__
|
||||||
NEW: add __TYPE__ substitution key
|
NEW: add substitution key __TYPE__
|
||||||
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
|
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
|
||||||
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
|
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
|
||||||
NEW: Add some fields to link website page to an other object
|
NEW: Add some fields to link website page to an other object
|
||||||
@ -193,14 +193,9 @@ NEW: can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
|
|||||||
NEW: can force the antivirus from conf file or autoprepend ini setup
|
NEW: can force the antivirus from conf file or autoprepend ini setup
|
||||||
NEW: can add event to log into blockedlog module with a constant
|
NEW: can add event to log into blockedlog module with a constant
|
||||||
NEW: add property cssview when declaring fields of an object
|
NEW: add property cssview when declaring fields of an object
|
||||||
NEW: Can use dynamic code into the 'enabled' property of DAO fields
|
NEW: can use dynamic code into the 'enabled' property of DAO fields
|
||||||
NEW: allow to edit "demand reason" field though API
|
|
||||||
NEW: fetch contact by email with REST API
|
|
||||||
NEW: field ref_ext in llx_commandedet
|
NEW: field ref_ext in llx_commandedet
|
||||||
NEW: fields ref_ext for Attributes and Combinations
|
NEW: field ref_ext for Attributes and Combinations
|
||||||
NEW: get state by REST API
|
|
||||||
NEW: get state dictionnary by REST API
|
|
||||||
NEW: improve Product API for variant products
|
|
||||||
NEW: OAuth SCOPE for Admin SDK
|
NEW: OAuth SCOPE for Admin SDK
|
||||||
NEW: retrieve discount from invoice from API
|
NEW: retrieve discount from invoice from API
|
||||||
NEW: standardizes API thirdparties by email like other object
|
NEW: standardizes API thirdparties by email like other object
|
||||||
@ -221,6 +216,11 @@ NEW: API can update a payment
|
|||||||
NEW: API get member by thirdparty
|
NEW: API get member by thirdparty
|
||||||
NEW: API get thirdparty by barcode
|
NEW: API get thirdparty by barcode
|
||||||
NEW: API get users by email / login
|
NEW: API get users by email / login
|
||||||
|
NEW: allow to edit field "demand reason" through API
|
||||||
|
NEW: fetch contact by email with REST API
|
||||||
|
NEW: get state by REST API
|
||||||
|
NEW: get state dictionary by REST API
|
||||||
|
NEW: improve Product API for product variants
|
||||||
|
|
||||||
HOOKs
|
HOOKs
|
||||||
NEW: Hook on propal card
|
NEW: Hook on propal card
|
||||||
|
|||||||
@ -50,6 +50,13 @@ Replace call to serialize_val with no bugged value
|
|||||||
|
|
||||||
* In all files, replace constructor names into __construct. Replace also parent::constructor_name with parent::__construct
|
* In all files, replace constructor names into __construct. Replace also parent::constructor_name with parent::__construct
|
||||||
|
|
||||||
|
* Line 4222 of file nusoap.php
|
||||||
|
|
||||||
|
$rev = array();
|
||||||
|
preg_match('/\$Revision: ([^ ]+)/', $this->revision, $rev);
|
||||||
|
$this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".(isset($rev[1]) ? $rev[1] : '').")";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TCPDF:
|
TCPDF:
|
||||||
|
|||||||
@ -314,7 +314,6 @@ if ($action != 'export_csv')
|
|||||||
if (empty($accountingaccountstatic->account_number)) {
|
if (empty($accountingaccountstatic->account_number)) {
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&accountingaccount='.length_accountg($line->numero_compte).'">'.img_edit_add().'</a>';
|
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&accountingaccount='.length_accountg($line->numero_compte).'">'.img_edit_add().'</a>';
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven">';
|
|
||||||
|
|
||||||
if (!empty($show_subgroup))
|
if (!empty($show_subgroup))
|
||||||
{
|
{
|
||||||
@ -343,6 +342,7 @@ if ($action != 'export_csv')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$accounting_account.'</td>';
|
print '<td>'.$accounting_account.'</td>';
|
||||||
print '<td class="nowraponall right">'.price($opening_balance).'</td>';
|
print '<td class="nowraponall right">'.price($opening_balance).'</td>';
|
||||||
print '<td class="nowraponall right">'.price($line->debit).'</td>';
|
print '<td class="nowraponall right">'.price($line->debit).'</td>';
|
||||||
|
|||||||
@ -937,6 +937,11 @@ while ($i < min($num, $limit))
|
|||||||
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
||||||
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
|
} elseif ($line->doc_type == 'bank')
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
$objectstatic = new AccountLine($db);
|
||||||
|
$objectstatic->fetch($line->fk_doc);
|
||||||
} else {
|
} else {
|
||||||
// Other type
|
// Other type
|
||||||
}
|
}
|
||||||
@ -951,6 +956,10 @@ while ($i < min($num, $limit))
|
|||||||
{
|
{
|
||||||
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
||||||
print $documentlink;
|
print $documentlink;
|
||||||
|
} elseif ($line->doc_type == 'bank') {
|
||||||
|
print $objectstatic->getNomUrl(1);
|
||||||
|
$bank_ref = strstr($line->doc_ref, '-');
|
||||||
|
print " " . $bank_ref;
|
||||||
} else {
|
} else {
|
||||||
print $line->doc_ref;
|
print $line->doc_ref;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -667,6 +667,11 @@ while ($i < min($num, $limit))
|
|||||||
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
||||||
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
|
} elseif ($line->doc_type == 'bank')
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
$objectstatic = new AccountLine($db);
|
||||||
|
$objectstatic->fetch($line->fk_doc);
|
||||||
} else {
|
} else {
|
||||||
// Other type
|
// Other type
|
||||||
}
|
}
|
||||||
@ -681,6 +686,10 @@ while ($i < min($num, $limit))
|
|||||||
{
|
{
|
||||||
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
||||||
print $documentlink;
|
print $documentlink;
|
||||||
|
} elseif ($line->doc_type == 'bank') {
|
||||||
|
print $objectstatic->getNomUrl(1);
|
||||||
|
$bank_ref = strstr($line->doc_ref, '-');
|
||||||
|
print " " . $bank_ref;
|
||||||
} else {
|
} else {
|
||||||
print $line->doc_ref;
|
print $line->doc_ref;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -679,6 +679,11 @@ while ($i < min($num, $limit))
|
|||||||
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
||||||
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
|
} elseif ($line->doc_type == 'bank')
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
$objectstatic = new AccountLine($db);
|
||||||
|
$objectstatic->fetch($line->fk_doc);
|
||||||
} else {
|
} else {
|
||||||
// Other type
|
// Other type
|
||||||
}
|
}
|
||||||
@ -693,6 +698,10 @@ while ($i < min($num, $limit))
|
|||||||
{
|
{
|
||||||
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
||||||
print $documentlink;
|
print $documentlink;
|
||||||
|
} elseif ($line->doc_type == 'bank') {
|
||||||
|
print $objectstatic->getNomUrl(1);
|
||||||
|
$bank_ref = strstr($line->doc_ref, '-');
|
||||||
|
print " " . $bank_ref;
|
||||||
} else {
|
} else {
|
||||||
print $line->doc_ref;
|
print $line->doc_ref;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1064,7 +1064,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td class="valeur">'.$object->id.'</td></tr>';
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td class="valeur">'.$object->ref.'</td></tr>';
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||||
|
|||||||
@ -63,19 +63,24 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
$arrayofmembers = array();
|
$arrayofmembers = array();
|
||||||
|
|
||||||
// request taking into account member with up to date subscriptions
|
// request taking into account member with up to date subscriptions
|
||||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,";
|
$sql = "SELECT d.rowid, d.ref, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,";
|
||||||
$sql .= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,";
|
$sql .= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,";
|
||||||
$sql .= " t.libelle as type,";
|
$sql .= " t.libelle as type,";
|
||||||
$sql .= " c.code as country_code, c.label as country";
|
$sql .= " c.code as country_code, c.label as country";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label']))
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = c.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = c.rowid";
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)";
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)";
|
||||||
|
}
|
||||||
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
|
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
|
||||||
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
||||||
if (is_numeric($foruserid)) $sql .= " AND d.rowid=".$foruserid;
|
if (is_numeric($foruserid)) $sql .= " AND d.rowid=".(int) $foruserid;
|
||||||
if ($foruserlogin) $sql .= " AND d.login='".$db->escape($foruserlogin)."'";
|
if ($foruserlogin) $sql .= " AND d.login='".$db->escape($foruserlogin)."'";
|
||||||
$sql .= " ORDER BY d.rowid ASC";
|
$sql .= " ORDER BY d.rowid ASC";
|
||||||
|
|
||||||
@ -90,6 +95,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
if ($objp->country == '-') $objp->country = '';
|
if ($objp->country == '-') $objp->country = '';
|
||||||
|
|
||||||
$adherentstatic->id = $objp->rowid;
|
$adherentstatic->id = $objp->rowid;
|
||||||
|
$adherentstatic->ref = $objp->ref;
|
||||||
$adherentstatic->lastname = $objp->lastname;
|
$adherentstatic->lastname = $objp->lastname;
|
||||||
$adherentstatic->firstname = $objp->firstname;
|
$adherentstatic->firstname = $objp->firstname;
|
||||||
|
|
||||||
@ -110,6 +116,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
// List of values to scan for a replacement
|
// List of values to scan for a replacement
|
||||||
$substitutionarray = array(
|
$substitutionarray = array(
|
||||||
'__ID__'=>$objp->rowid,
|
'__ID__'=>$objp->rowid,
|
||||||
|
'__REF__'=>$objp->ref,
|
||||||
'__LOGIN__'=>$objp->login,
|
'__LOGIN__'=>$objp->login,
|
||||||
'__FIRSTNAME__'=>$objp->firstname,
|
'__FIRSTNAME__'=>$objp->firstname,
|
||||||
'__LASTNAME__'=>$objp->lastname,
|
'__LASTNAME__'=>$objp->lastname,
|
||||||
@ -149,6 +156,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
'textfooter'=>$textfooter,
|
'textfooter'=>$textfooter,
|
||||||
'textright'=>$textright,
|
'textright'=>$textright,
|
||||||
'id'=>$objp->rowid,
|
'id'=>$objp->rowid,
|
||||||
|
'ref'=>$objp->ref,
|
||||||
'photo'=>$objp->photo
|
'photo'=>$objp->photo
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -159,6 +167,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
'textfooter'=>$textfooter,
|
'textfooter'=>$textfooter,
|
||||||
'textright'=>$textright,
|
'textright'=>$textright,
|
||||||
'id'=>$objp->rowid,
|
'id'=>$objp->rowid,
|
||||||
|
'ref'=>$objp->ref,
|
||||||
'photo'=>$objp->photo
|
'photo'=>$objp->photo
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -172,12 +181,15 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||||||
$textfooter = '';
|
$textfooter = '';
|
||||||
$textright = '';
|
$textright = '';
|
||||||
|
|
||||||
$arrayofmembers[] = array('textleft'=>$textleft,
|
$arrayofmembers[] = array(
|
||||||
'textheader'=>$textheader,
|
'textleft'=>$textleft,
|
||||||
'textfooter'=>$textfooter,
|
'textheader'=>$textheader,
|
||||||
'textright'=>$textright,
|
'textfooter'=>$textfooter,
|
||||||
'id'=>$objp->rowid,
|
'textright'=>$textright,
|
||||||
'photo'=>$objp->photo);
|
'id'=>$objp->rowid,
|
||||||
|
'ref'=>$objp->ref,
|
||||||
|
'photo'=>$objp->photo,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -288,6 +288,7 @@ class Adherent extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
||||||
|
'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'default' => 1, 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 12, 'index' => 1),
|
||||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
||||||
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20),
|
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20),
|
||||||
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
|
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
|
||||||
@ -417,6 +418,7 @@ class Adherent extends CommonObject
|
|||||||
$infos = '';
|
$infos = '';
|
||||||
if ($this->civility_id) $infos .= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel()."\n";
|
if ($this->civility_id) $infos .= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel()."\n";
|
||||||
$infos .= $langs->transnoentities("id").": ".$this->id."\n";
|
$infos .= $langs->transnoentities("id").": ".$this->id."\n";
|
||||||
|
$infos .= $langs->transnoentities("ref").": ".$this->ref."\n";
|
||||||
$infos .= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
|
$infos .= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
|
||||||
$infos .= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
|
$infos .= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
|
||||||
$infos .= $langs->transnoentities("Company").": ".$this->company."\n";
|
$infos .= $langs->transnoentities("Company").": ".$this->company."\n";
|
||||||
@ -438,15 +440,20 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
// Substitutions
|
// Substitutions
|
||||||
$substitutionarray = array(
|
$substitutionarray = array(
|
||||||
'__ID__' => $this->id, '__MEMBER_ID__' => $this->id, '__CIVILITY__' => $this->getCivilityLabel(),
|
'__ID__' => $this->id,
|
||||||
|
'__REF__' => $this->ref,
|
||||||
|
'__MEMBER_ID__' => $this->id,
|
||||||
|
'__CIVILITY__' => $this->getCivilityLabel(),
|
||||||
'__FIRSTNAME__' => $msgishtml ? dol_htmlentitiesbr($this->firstname) : ($this->firstname ? $this->firstname : ''),
|
'__FIRSTNAME__' => $msgishtml ? dol_htmlentitiesbr($this->firstname) : ($this->firstname ? $this->firstname : ''),
|
||||||
'__LASTNAME__' => $msgishtml ? dol_htmlentitiesbr($this->lastname) : ($this->lastname ? $this->lastname : ''),
|
'__LASTNAME__' => $msgishtml ? dol_htmlentitiesbr($this->lastname) : ($this->lastname ? $this->lastname : ''),
|
||||||
'__FULLNAME__' => $msgishtml ? dol_htmlentitiesbr($this->getFullName($langs)) : $this->getFullName($langs),
|
'__FULLNAME__' => $msgishtml ? dol_htmlentitiesbr($this->getFullName($langs)) : $this->getFullName($langs),
|
||||||
'__COMPANY__' => $msgishtml ? dol_htmlentitiesbr($this->company) : ($this->company ? $this->company : ''),
|
'__COMPANY__' => $msgishtml ? dol_htmlentitiesbr($this->company) : ($this->company ? $this->company : ''),
|
||||||
'__ADDRESS__' => $msgishtml ? dol_htmlentitiesbr($this->address) : ($this->address ? $this->address : ''),
|
'__ADDRESS__' => $msgishtml ? dol_htmlentitiesbr($this->address) : ($this->address ? $this->address : ''),
|
||||||
'__ZIP__' => $msgishtml ? dol_htmlentitiesbr($this->zip) : ($this->zip ? $this->zip : ''), '__TOWN__' => $msgishtml ? dol_htmlentitiesbr($this->town) : ($this->town ? $this->town : ''),
|
'__ZIP__' => $msgishtml ? dol_htmlentitiesbr($this->zip) : ($this->zip ? $this->zip : ''),
|
||||||
|
'__TOWN__' => $msgishtml ? dol_htmlentitiesbr($this->town) : ($this->town ? $this->town : ''),
|
||||||
'__COUNTRY__' => $msgishtml ? dol_htmlentitiesbr($this->country) : ($this->country ? $this->country : ''),
|
'__COUNTRY__' => $msgishtml ? dol_htmlentitiesbr($this->country) : ($this->country ? $this->country : ''),
|
||||||
'__EMAIL__' => $msgishtml ? dol_htmlentitiesbr($this->email) : ($this->email ? $this->email : ''), '__BIRTH__' => $msgishtml ? dol_htmlentitiesbr($birthday) : ($birthday ? $birthday : ''),
|
'__EMAIL__' => $msgishtml ? dol_htmlentitiesbr($this->email) : ($this->email ? $this->email : ''),
|
||||||
|
'__BIRTH__' => $msgishtml ? dol_htmlentitiesbr($birthday) : ($birthday ? $birthday : ''),
|
||||||
'__PHOTO__' => $msgishtml ? dol_htmlentitiesbr($this->photo) : ($this->photo ? $this->photo : ''),
|
'__PHOTO__' => $msgishtml ? dol_htmlentitiesbr($this->photo) : ($this->photo ? $this->photo : ''),
|
||||||
'__LOGIN__' => $msgishtml ? dol_htmlentitiesbr($this->login) : ($this->login ? $this->login : ''),
|
'__LOGIN__' => $msgishtml ? dol_htmlentitiesbr($this->login) : ($this->login ? $this->login : ''),
|
||||||
'__PASSWORD__' => $msgishtml ? dol_htmlentitiesbr($this->pass) : ($this->pass ? $this->pass : ''),
|
'__PASSWORD__' => $msgishtml ? dol_htmlentitiesbr($this->pass) : ($this->pass ? $this->pass : ''),
|
||||||
@ -519,9 +526,10 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
// Insert member
|
// Insert member
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent";
|
||||||
$sql .= " (datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy,fk_adherent_type,entity,import_key)";
|
$sql .= " (ref, datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy,fk_adherent_type,entity,import_key)";
|
||||||
$sql .= " VALUES (";
|
$sql .= " VALUES (";
|
||||||
$sql .= " '".$this->db->idate($this->datec)."'";
|
$sql .= " '(PROV)'";
|
||||||
|
$sql .= ", '".$this->db->idate($this->datec)."'";
|
||||||
$sql .= ", ".($this->login ? "'".$this->db->escape($this->login)."'" : "null");
|
$sql .= ", ".($this->login ? "'".$this->db->escape($this->login)."'" : "null");
|
||||||
$sql .= ", ".($user->id > 0 ? $user->id : "null"); // Can be null because member can be created by a guest or a script
|
$sql .= ", ".($user->id > 0 ? $user->id : "null"); // Can be null because member can be created by a guest or a script
|
||||||
$sql .= ", null, null, '".$this->db->escape($this->morphy)."'";
|
$sql .= ", null, null, '".$this->db->escape($this->morphy)."'";
|
||||||
@ -635,7 +643,8 @@ class Adherent extends CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||||
$sql .= " civility = ".($this->civility_id ? "'".$this->db->escape($this->civility_id)."'" : "null");
|
$sql .= " ref = '".$this->db->escape($this->ref)."'";
|
||||||
|
$sql .= ", civility = ".($this->civility_id ? "'".$this->db->escape($this->civility_id)."'" : "null");
|
||||||
$sql .= ", firstname = ".($this->firstname ? "'".$this->db->escape($this->firstname)."'" : "null");
|
$sql .= ", firstname = ".($this->firstname ? "'".$this->db->escape($this->firstname)."'" : "null");
|
||||||
$sql .= ", lastname = ".($this->lastname ? "'".$this->db->escape($this->lastname)."'" : "null");
|
$sql .= ", lastname = ".($this->lastname ? "'".$this->db->escape($this->lastname)."'" : "null");
|
||||||
$sql .= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman'
|
$sql .= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman'
|
||||||
@ -752,6 +761,7 @@ class Adherent extends CommonObject
|
|||||||
// If option ADHERENT_LOGIN_NOT_REQUIRED is on, there is no login of member, so we do not overwrite user login to keep existing one.
|
// If option ADHERENT_LOGIN_NOT_REQUIRED is on, there is no login of member, so we do not overwrite user login to keep existing one.
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $luser->login = $this->login;
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $luser->login = $this->login;
|
||||||
|
|
||||||
|
$luser->ref = $this->ref;
|
||||||
$luser->civility_id = $this->civility_id;
|
$luser->civility_id = $this->civility_id;
|
||||||
$luser->firstname = $this->firstname;
|
$luser->firstname = $this->firstname;
|
||||||
$luser->lastname = $this->lastname;
|
$luser->lastname = $this->lastname;
|
||||||
@ -1242,7 +1252,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_code, d.gender, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,";
|
$sql = "SELECT d.rowid, d.ref, d.ref_ext, d.civility as civility_code, d.gender, d.firstname, d.lastname,";
|
||||||
|
$sql .= " d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,";
|
||||||
$sql .= " d.note_public,";
|
$sql .= " d.note_public,";
|
||||||
$sql .= " d.email, d.socialnetworks, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,";
|
$sql .= " d.email, d.socialnetworks, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,";
|
||||||
$sql .= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
|
$sql .= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
|
||||||
@ -1268,7 +1279,7 @@ class Adherent extends CommonObject
|
|||||||
} elseif ($ref || $fk_soc) {
|
} elseif ($ref || $fk_soc) {
|
||||||
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
||||||
if ($ref) {
|
if ($ref) {
|
||||||
$sql .= " AND d.rowid='".$this->db->escape($ref)."'";
|
$sql .= " AND d.ref='".$this->db->escape($ref)."'";
|
||||||
} elseif ($fk_soc > 0) {
|
} elseif ($fk_soc > 0) {
|
||||||
$sql .= " AND d.fk_soc=".((int) $fk_soc);
|
$sql .= " AND d.fk_soc=".((int) $fk_soc);
|
||||||
}
|
}
|
||||||
@ -1283,8 +1294,8 @@ class Adherent extends CommonObject
|
|||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$this->entity = $obj->entity;
|
$this->entity = $obj->entity;
|
||||||
$this->ref = $obj->rowid;
|
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
|
$this->ref = $obj->ref;
|
||||||
$this->ref_ext = $obj->ref_ext;
|
$this->ref_ext = $obj->ref_ext;
|
||||||
|
|
||||||
$this->civility_id = $obj->civility_code; // Bad. Kept for backard compatibility
|
$this->civility_id = $obj->civility_code; // Bad. Kept for backard compatibility
|
||||||
@ -2072,7 +2083,7 @@ class Adherent extends CommonObject
|
|||||||
if ($mode == 'login') {
|
if ($mode == 'login') {
|
||||||
$result .= dol_trunc($this->login, $maxlen);
|
$result .= dol_trunc($this->login, $maxlen);
|
||||||
} elseif ($mode == 'ref') {
|
} elseif ($mode == 'ref') {
|
||||||
$result .= $this->id;
|
$result .= $this->ref;
|
||||||
} else {
|
} else {
|
||||||
$result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : ($mode == 'lastname' ? 4 : -1)), $maxlen);
|
$result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : ($mode == 'lastname' ? 4 : -1)), $maxlen);
|
||||||
}
|
}
|
||||||
@ -2317,6 +2328,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
// Initialise parametres
|
// Initialise parametres
|
||||||
$this->id = 0;
|
$this->id = 0;
|
||||||
|
$this->ref = 'ABC001';
|
||||||
$this->entity = 1;
|
$this->entity = 1;
|
||||||
$this->specimen = 1;
|
$this->specimen = 1;
|
||||||
$this->civility_id = 0;
|
$this->civility_id = 0;
|
||||||
|
|||||||
@ -101,7 +101,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
|||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
$fieldstosearchall = array(
|
$fieldstosearchall = array(
|
||||||
'd.rowid'=>'Ref',
|
'd.ref'=>'Ref',
|
||||||
'd.login'=>'Login',
|
'd.login'=>'Login',
|
||||||
'd.lastname'=>'Lastname',
|
'd.lastname'=>'Lastname',
|
||||||
'd.firstname'=>'Firstname',
|
'd.firstname'=>'Firstname',
|
||||||
@ -247,7 +247,7 @@ $memberstatic = new Adherent($db);
|
|||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
|
$sql = "SELECT d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
|
||||||
$sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
|
$sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
|
||||||
$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
|
$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
|
||||||
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
||||||
@ -264,8 +264,13 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
|
|||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
if (!empty($search_categ) || !empty($catid)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; // We need this table joined to the select in order to filter by categ
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
|
||||||
|
}
|
||||||
|
if (!empty($search_categ) || !empty($catid)) {
|
||||||
|
// We need this table joined to the select in order to filter by categ
|
||||||
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member";
|
||||||
|
}
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d.country)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d.country)";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)";
|
||||||
@ -281,10 +286,12 @@ if ($search_type > 0) $sql .= " AND t.rowid=".$db->escape($search_type);
|
|||||||
if ($search_filter == 'withoutsubscription') $sql .= " AND (datefin IS NULL OR t.subscription = 0)";
|
if ($search_filter == 'withoutsubscription') $sql .= " AND (datefin IS NULL OR t.subscription = 0)";
|
||||||
if ($search_filter == 'uptodate') $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
|
if ($search_filter == 'uptodate') $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
|
||||||
if ($search_filter == 'outofdate') $sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
|
if ($search_filter == 'outofdate') $sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
|
||||||
if ($search_status != '') $sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
if ($search_status != '') {
|
||||||
|
// Peut valoir un nombre ou liste de nombre separes par virgules
|
||||||
|
$sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")";
|
||||||
|
}
|
||||||
if ($search_ref) {
|
if ($search_ref) {
|
||||||
if (is_numeric($search_ref)) $sql .= " AND (d.rowid = ".$db->escape($search_ref).")";
|
$sql .= natural_search("d.ref", $search_ref);
|
||||||
else $sql .= " AND 1 = 2"; // Always wrong
|
|
||||||
}
|
}
|
||||||
if ($search_civility) $sql .= natural_search("d.civility", $search_civility);
|
if ($search_civility) $sql .= natural_search("d.civility", $search_civility);
|
||||||
if ($search_firstname) $sql .= natural_search("d.firstname", $search_firstname);
|
if ($search_firstname) $sql .= natural_search("d.firstname", $search_firstname);
|
||||||
@ -604,7 +611,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder);
|
if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], 'd.rowid', '', $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], 'd.ref', '', $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'], $_SERVER["PHP_SELF"], 'd.civility', '', $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'], $_SERVER["PHP_SELF"], 'd.civility', '', $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'], $_SERVER["PHP_SELF"], 'd.firstname', '', $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'], $_SERVER["PHP_SELF"], 'd.firstname', '', $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'], $_SERVER["PHP_SELF"], 'd.lastname', '', $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'], $_SERVER["PHP_SELF"], 'd.lastname', '', $param, '', $sortfield, $sortorder);
|
||||||
@ -644,7 +651,7 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
$datefin = $db->jdate($obj->datefin);
|
$datefin = $db->jdate($obj->datefin);
|
||||||
$memberstatic->id = $obj->rowid;
|
$memberstatic->id = $obj->rowid;
|
||||||
$memberstatic->ref = $obj->rowid;
|
$memberstatic->ref = $obj->ref;
|
||||||
$memberstatic->civility_id = $obj->civility;
|
$memberstatic->civility_id = $obj->civility;
|
||||||
$memberstatic->lastname = $obj->lastname;
|
$memberstatic->lastname = $obj->lastname;
|
||||||
$memberstatic->firstname = $obj->firstname;
|
$memberstatic->firstname = $obj->firstname;
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/admin/fckeditor.php
|
* \file htdocs/admin/fckeditor.php
|
||||||
* \ingroup fckeditor
|
* \ingroup fckeditor
|
||||||
* \brief Page d'activation du module FCKeditor dans les autres modules
|
* \brief Activation page for the FCKeditor module in the other modules
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
@ -43,35 +43,41 @@ $mode = GETPOST('mode') ?GETPOST('mode', 'alpha') : 'dolibarr_notes';
|
|||||||
|
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) accessforbidden();
|
||||||
|
|
||||||
// Constante et traduction de la description du module
|
// Constant and translation of the module description
|
||||||
$modules = array(
|
$modules = array(
|
||||||
'SOCIETE' => 'FCKeditorForCompany',
|
'SOCIETE' => 'FCKeditorForCompany',
|
||||||
'PRODUCTDESC' => 'FCKeditorForProduct',
|
'PRODUCTDESC' => 'FCKeditorForProduct',
|
||||||
'DETAILS' => 'FCKeditorForProductDetails',
|
'DETAILS' => 'FCKeditorForProductDetails',
|
||||||
'USERSIGN' => 'FCKeditorForUserSignature',
|
'USERSIGN' => 'FCKeditorForUserSignature',
|
||||||
'MAILING' => 'FCKeditorForMailing',
|
'MAILING' => 'FCKeditorForMailing',
|
||||||
'MAIL' => 'FCKeditorForMail',
|
'MAIL' => 'FCKeditorForMail',
|
||||||
'TICKET' => 'FCKeditorForTicket'
|
'TICKET' => 'FCKeditorForTicket',
|
||||||
|
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
|
||||||
|
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
|
||||||
);
|
);
|
||||||
// Conditions pour que l'option soit proposee
|
// Conditions for the option to be offered
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
'SOCIETE' => 1,
|
'SOCIETE' => 1,
|
||||||
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
|
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
|
||||||
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||||
'USERSIGN' => 1,
|
'USERSIGN' => 1,
|
||||||
'MAILING' => !empty($conf->mailing->enabled),
|
'MAILING' => !empty($conf->mailing->enabled),
|
||||||
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
||||||
'TICKET' => !empty($conf->ticket->enabled)
|
'TICKET' => !empty($conf->ticket->enabled),
|
||||||
|
'NOTE_PUBLIC' => 1,
|
||||||
|
'NOTE_PRIVATE' => 1,
|
||||||
);
|
);
|
||||||
// Picto
|
// Picto
|
||||||
$picto = array(
|
$picto = array(
|
||||||
'SOCIETE' => 'generic',
|
'SOCIETE' => 'generic',
|
||||||
'PRODUCTDESC' => 'product',
|
'PRODUCTDESC' => 'product',
|
||||||
'DETAILS' => 'product',
|
'DETAILS' => 'product',
|
||||||
'USERSIGN' => 'user',
|
'USERSIGN' => 'user',
|
||||||
'MAILING' => 'email',
|
'MAILING' => 'email',
|
||||||
'MAIL' => 'email',
|
'MAIL' => 'email',
|
||||||
'TICKET' => 'ticket'
|
'TICKET' => 'ticket',
|
||||||
|
'NOTE_PUBLIC' => 'generic',
|
||||||
|
'NOTE_PRIVATE' => 'generic',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -85,7 +91,7 @@ foreach ($modules as $const => $desc)
|
|||||||
if ($action == 'activate_'.strtolower($const))
|
if ($action == 'activate_'.strtolower($const))
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity);
|
||||||
// Si fckeditor est active dans la description produit/service, on l'active dans les formulaires
|
// If fckeditor is active in the product/service description, it is activated in the forms
|
||||||
if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM))
|
if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM))
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity);
|
||||||
@ -154,7 +160,7 @@ if (empty($conf->use_javascript_ajax))
|
|||||||
// Modules
|
// Modules
|
||||||
foreach ($modules as $const => $desc)
|
foreach ($modules as $const => $desc)
|
||||||
{
|
{
|
||||||
// Si condition non remplie, on ne propose pas l'option
|
// If this condition is not met, the option is not offered
|
||||||
if (!$conditions[$const]) continue;
|
if (!$conditions[$const]) continue;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|||||||
@ -35,10 +35,10 @@ $langs->load("categories");
|
|||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$ref = GETPOST('ref', 'alphanohtml');
|
$ref = GETPOST('ref', 'alphanohtml');
|
||||||
$type = GETPOST('type', 'aZ09'); // Can be int or string
|
|
||||||
$action = (GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'edit');
|
$action = (GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'edit');
|
||||||
$confirm = GETPOST('confirm');
|
$confirm = GETPOST('confirm');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
$socid = (int) GETPOST('socid', 'int');
|
$socid = (int) GETPOST('socid', 'int');
|
||||||
$label = (string) GETPOST('label', 'alphanohtml');
|
$label = (string) GETPOST('label', 'alphanohtml');
|
||||||
@ -56,10 +56,14 @@ if ($id == "") {
|
|||||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
if ($id > 0) {
|
$result = $object->fetch($id, $label);
|
||||||
$result = $object->fetch($id);
|
if ($result <= 0) {
|
||||||
|
dol_print_error($db, $object->error); exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$type = $object->type;
|
||||||
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
@ -74,8 +78,13 @@ $error = 0;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ($cancel) {
|
if ($cancel) {
|
||||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
if ($backtopage) {
|
||||||
exit;
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action mise a jour d'une categorie
|
// Action mise a jour d'une categorie
|
||||||
@ -98,9 +107,15 @@ if ($action == 'update' && $user->rights->categorie->creer) {
|
|||||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (!$error && $object->update($user) > 0) {
|
if (!$error && $object->update($user) > 0)
|
||||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
{
|
||||||
exit;
|
if ($backtopage) {
|
||||||
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
@ -131,6 +146,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
print dol_get_fiche_head('');
|
print dol_get_fiche_head('');
|
||||||
|
|
||||||
|
|||||||
@ -109,7 +109,7 @@ if (empty($nosearch)) {
|
|||||||
|
|
||||||
foreach ($cats as $cat)
|
foreach ($cats as $cat)
|
||||||
{
|
{
|
||||||
$color = $categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #bbb"';
|
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
||||||
|
|
||||||
print "\t".'<tr class="oddeven">'."\n";
|
print "\t".'<tr class="oddeven">'."\n";
|
||||||
print "\t\t<td>";
|
print "\t\t<td>";
|
||||||
@ -160,26 +160,45 @@ foreach ($fulltree as $key => $val)
|
|||||||
$categstatic->ref = $val['label'];
|
$categstatic->ref = $val['label'];
|
||||||
$categstatic->color = $val['color'];
|
$categstatic->color = $val['color'];
|
||||||
$categstatic->type = $type;
|
$categstatic->type = $type;
|
||||||
$li = $categstatic->getNomUrl(1, '', 60, $moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam));
|
|
||||||
$desc = dol_htmlcleanlastbr($val['description']);
|
$desc = dol_htmlcleanlastbr($val['description']);
|
||||||
|
|
||||||
$counter = '';
|
$counter = '';
|
||||||
|
|
||||||
if ($conf->global->CATEGORY_SHOW_COUNTS)
|
if ($conf->global->CATEGORY_SHOW_COUNTS)
|
||||||
{
|
{
|
||||||
// we need only a count of the elements, so it is enough to consume only the id's from the database
|
// we need only a count of the elements, so it is enough to consume only the id's from the database
|
||||||
$elements = $categstatic->getObjectsInCateg($type, 1);
|
$elements = $type == Categorie::TYPE_ACCOUNT
|
||||||
|
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
|
||||||
|
: $categstatic->getObjectsInCateg($type, 1);
|
||||||
|
|
||||||
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
|
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
||||||
|
$li = $categstatic->getNomUrl(1, '', 60, '&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam));
|
||||||
|
|
||||||
$data[] = array(
|
$entry = '<table class="nobordernopadding centpercent">';
|
||||||
'rowid'=>$val['rowid'],
|
$entry .= '<tr>';
|
||||||
'fk_menu'=>$val['fk_parent'],
|
|
||||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories"'.$color.'>'.$li.'</span></td>'.$counter.
|
$entry .= '<td>';
|
||||||
'<td class="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_view().'</a></td></tr></table>'
|
$entry .= '<span class="noborderoncategories" '.$color.'>'.$li.'</span>';
|
||||||
);
|
$entry .= '</td>';
|
||||||
|
|
||||||
|
$entry .= $counter;
|
||||||
|
|
||||||
|
$entry .= '<td class="right" width="20px;">';
|
||||||
|
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_view().'</a>';
|
||||||
|
$entry .= '</td>';
|
||||||
|
$entry .= '<td class="right" width="20px;">';
|
||||||
|
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_edit().'</a>';
|
||||||
|
$entry .= '</td>';
|
||||||
|
$entry .= '<td class="right" width="20px;">';
|
||||||
|
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_delete().'</a>';
|
||||||
|
$entry .= '</td>';
|
||||||
|
|
||||||
|
$entry .= '</tr>';
|
||||||
|
$entry .= '</table>';
|
||||||
|
|
||||||
|
$data[] = array('rowid' => $val['rowid'], 'fk_menu' => $val['fk_parent'], 'entry' => $entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -194,7 +213,6 @@ if (!empty($conf->use_javascript_ajax))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$nbofentries = (count($data) - 1);
|
$nbofentries = (count($data) - 1);
|
||||||
|
|
||||||
if ($nbofentries > 0)
|
if ($nbofentries > 0)
|
||||||
{
|
{
|
||||||
print '<tr class="pair"><td colspan="3">';
|
print '<tr class="pair"><td colspan="3">';
|
||||||
|
|||||||
@ -37,16 +37,18 @@ $langs->loadLangs(array('categories', 'sendings'));
|
|||||||
|
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
$label = GETPOST('label', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid) $socid = $user->socid;
|
if ($user->socid) $socid = $user->socid;
|
||||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
if (!$object->fetch($id) > 0) {
|
$result = $object->fetch($id, $label);
|
||||||
dol_print_error($db);
|
if ($result <= 0) {
|
||||||
exit;
|
dol_print_error($db, $object->error); exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = $object->type;
|
$type = $object->type;
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
@ -63,11 +65,11 @@ llxHeader('', $langs->trans('Categories'), '');
|
|||||||
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
|
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
|
||||||
|
|
||||||
$head = categories_prepare_head($object, $type);
|
$head = categories_prepare_head($object, $type);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'info', $langs->trans($title), -1, 'category');
|
print dol_get_fiche_head($head, 'info', $langs->trans($title), -1, 'category');
|
||||||
|
|
||||||
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
||||||
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter = ' type = '.$type;
|
$object->next_prev_filter = ' type = '.$object->type;
|
||||||
$object->ref = $object->label;
|
$object->ref = $object->label;
|
||||||
$morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
$morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||||
|
|||||||
@ -38,7 +38,6 @@ $langs->loadlangs(array('categories', 'bills'));
|
|||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$type = GETPOST('type');
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm');
|
$confirm = GETPOST('confirm');
|
||||||
|
|
||||||
@ -52,18 +51,16 @@ if ($id == '' && $label == '')
|
|||||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
$result = $object->fetch($id, $label, $type);
|
$result = $object->fetch($id, $label);
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
dol_print_error($db, $object->error); exit;
|
dol_print_error($db, $object->error); exit;
|
||||||
}
|
}
|
||||||
$object->fetch_optionals();
|
|
||||||
if ($result <= 0) {
|
|
||||||
dol_print_error($db, $object->error); exit;
|
|
||||||
}
|
|
||||||
$upload_dir = $conf->categorie->multidir_output[$object->entity];
|
|
||||||
|
|
||||||
|
$type = $object->type;
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
|
$upload_dir = $conf->categorie->multidir_output[$object->entity];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -115,8 +112,6 @@ if ($object->id)
|
|||||||
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
|
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
|
||||||
|
|
||||||
$head = categories_prepare_head($object, $type);
|
$head = categories_prepare_head($object, $type);
|
||||||
|
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'photos', $langs->trans($title), -1, 'category');
|
print dol_get_fiche_head($head, 'photos', $langs->trans($title), -1, 'category');
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|||||||
@ -39,7 +39,6 @@ $id = GETPOST('id', 'int');
|
|||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$type = GETPOST('type', 'aZ09');
|
|
||||||
|
|
||||||
if ($id == '' && $label == '')
|
if ($id == '' && $label == '')
|
||||||
{
|
{
|
||||||
@ -51,15 +50,12 @@ if ($id == '' && $label == '')
|
|||||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
$result = $object->fetch($id, $label, $type);
|
$result = $object->fetch($id, $label);
|
||||||
if ($result <= 0) {
|
|
||||||
dol_print_error($db, $object->error); exit;
|
|
||||||
}
|
|
||||||
$object->fetch_optionals();
|
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
dol_print_error($db, $object->error); exit;
|
dol_print_error($db, $object->error); exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$type = $object->type;
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -38,7 +38,6 @@ $langs->load("categories");
|
|||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$type = GETPOST('type', 'aZ09');
|
|
||||||
$removeelem = GETPOST('removeelem', 'int');
|
$removeelem = GETPOST('removeelem', 'int');
|
||||||
$elemid = GETPOST('elemid', 'int');
|
$elemid = GETPOST('elemid', 'int');
|
||||||
|
|
||||||
@ -73,19 +72,12 @@ if ($id == "" && $label == "")
|
|||||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
$result = $object->fetch($id, $label, $type);
|
$result = $object->fetch($id, $label);
|
||||||
if ($result <= 0) {
|
|
||||||
dol_print_error($db, $object->error); exit;
|
|
||||||
}
|
|
||||||
$object->fetch_optionals();
|
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
dol_print_error($db, $object->error); exit;
|
dol_print_error($db, $object->error); exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$objecttype = $object->type;
|
$type = $object->type;
|
||||||
if (is_numeric($objecttype)) $objecttype = Categorie::$MAP_ID_TO_CODE[$objecttype];
|
|
||||||
if ($type === '') $type = $objecttype;
|
|
||||||
|
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
@ -94,16 +86,18 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('categorycard', 'globalcard'));
|
$hookmanager->initHooks(array('categorycard', 'globalcard'));
|
||||||
|
|
||||||
// Protection when type provided is not similare to type of category
|
|
||||||
if ($objecttype != $type) {
|
|
||||||
print 'Error: Value for type parameter does not match value of the type of the category with id='.$id;
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if ($confirm == 'no')
|
||||||
|
{
|
||||||
|
if ($backtopage) {
|
||||||
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
// Remove element from category
|
// Remove element from category
|
||||||
@ -164,8 +158,13 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
|
|||||||
{
|
{
|
||||||
if ($object->delete($user) >= 0)
|
if ($object->delete($user) >= 0)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/index.php?type='.$type);
|
if ($backtopage) {
|
||||||
exit;
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/categories/index.php?type='.$type);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
@ -226,9 +225,8 @@ llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arra
|
|||||||
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
|
$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
|
||||||
|
|
||||||
$head = categories_prepare_head($object, $type);
|
$head = categories_prepare_head($object, $type);
|
||||||
|
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'card', $langs->trans($title), -1, 'category');
|
print dol_get_fiche_head($head, 'card', $langs->trans($title), -1, 'category');
|
||||||
|
|
||||||
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
||||||
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter = ' type = '.$object->type;
|
$object->next_prev_filter = ' type = '.$object->type;
|
||||||
@ -250,7 +248,11 @@ dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'la
|
|||||||
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1);
|
if ($backtopage) {
|
||||||
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&backtopage='.urlencode($backtopage), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 2);
|
||||||
|
} else {
|
||||||
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -294,7 +296,7 @@ if ($user->rights->categorie->creer)
|
|||||||
|
|
||||||
if ($user->rights->categorie->supprimer)
|
if ($user->rights->categorie->supprimer)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'&backtolist='.urlencode($backtolist).'">'.$langs->trans("Delete").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
@ -376,8 +378,7 @@ if ($cats < 0)
|
|||||||
$categstatic->type = $type;
|
$categstatic->type = $type;
|
||||||
$desc = dol_htmlcleanlastbr($val['description']);
|
$desc = dol_htmlcleanlastbr($val['description']);
|
||||||
|
|
||||||
$counter = 0;
|
$counter = '';
|
||||||
|
|
||||||
if ($conf->global->CATEGORY_SHOW_COUNTS)
|
if ($conf->global->CATEGORY_SHOW_COUNTS)
|
||||||
{
|
{
|
||||||
// we need only a count of the elements, so it is enough to consume only the id's from the database
|
// we need only a count of the elements, so it is enough to consume only the id's from the database
|
||||||
@ -385,22 +386,29 @@ if ($cats < 0)
|
|||||||
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
|
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
|
||||||
: $categstatic->getObjectsInCateg($type, 1);
|
: $categstatic->getObjectsInCateg($type, 1);
|
||||||
|
|
||||||
$counter = is_countable($elements) ? count($elements) : 0;
|
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$color = $categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"';
|
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
||||||
|
$li = $categstatic->getNomUrl(1, '', 60, '&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type));
|
||||||
|
|
||||||
$entry = '<table class="nobordernopadding centpercent">';
|
$entry = '<table class="nobordernopadding centpercent">';
|
||||||
$entry .= '<tr>';
|
$entry .= '<tr>';
|
||||||
|
|
||||||
$entry .= '<td>';
|
$entry .= '<td>';
|
||||||
$entry .= '<span class="noborderoncategories" '.$color.'>'.$categstatic->getNomUrl(1, '', 60).'</span>';
|
$entry .= '<span class="noborderoncategories" '.$color.'>'.$li.'</span>';
|
||||||
$entry .= '</td>';
|
$entry .= '</td>';
|
||||||
|
|
||||||
$entry .= '<td class="left" width="40px;">'.$counter.'</td>';
|
$entry .= $counter;
|
||||||
|
|
||||||
$entry .= '<td class="right" width="20px;">';
|
$entry .= '<td class="right" width="20px;">';
|
||||||
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a>';
|
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type).'">'.img_view().'</a>';
|
||||||
|
$entry .= '</td>';
|
||||||
|
$entry .= '<td class="right" width="20px;">';
|
||||||
|
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type).'">'.img_edit().'</a>';
|
||||||
|
$entry .= '</td>';
|
||||||
|
$entry .= '<td class="right" width="20px;">';
|
||||||
|
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type).'">'.img_delete().'</a>';
|
||||||
$entry .= '</td>';
|
$entry .= '</td>';
|
||||||
|
|
||||||
$entry .= '</tr>';
|
$entry .= '</tr>';
|
||||||
@ -409,7 +417,8 @@ if ($cats < 0)
|
|||||||
$data[] = array('rowid' => $val['rowid'], 'fk_menu' => $val['fk_parent'], 'entry' => $entry);
|
$data[] = array('rowid' => $val['rowid'], 'fk_menu' => $val['fk_parent'], 'entry' => $entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((count($data) - 1))
|
$nbofentries = (count($data) - 1);
|
||||||
|
if ($nbofentries > 0)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
||||||
print '<tr class="pair">';
|
print '<tr class="pair">';
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -118,36 +118,48 @@ class Mailing extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int id of user create
|
* @var int id of user create
|
||||||
* @deprecated
|
|
||||||
*/
|
*/
|
||||||
public $user_creation;
|
public $user_creation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int id of user create
|
* @var int id of user create
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $user_creat;
|
public $user_creat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int id of user validate
|
* @var int id of user validate
|
||||||
* @deprecated
|
|
||||||
*/
|
*/
|
||||||
public $user_validation;
|
public $user_validation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int id of user validate
|
* @var int id of user validate
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $user_valid;
|
public $user_valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer|string date_creation
|
* @var integer|string date_creation
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $date_creat;
|
public $date_creat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer|string date_creation
|
||||||
|
*/
|
||||||
|
public $date_creation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int date validate
|
* @var int date validate
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $date_valid;
|
public $date_valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int date validate
|
||||||
|
*/
|
||||||
|
public $date_validation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array extraparams
|
* @var array extraparams
|
||||||
*/
|
*/
|
||||||
@ -314,10 +326,14 @@ class Mailing extends CommonObject
|
|||||||
$this->email_errorsto = $obj->email_errorsto;
|
$this->email_errorsto = $obj->email_errorsto;
|
||||||
|
|
||||||
$this->user_creat = $obj->fk_user_creat;
|
$this->user_creat = $obj->fk_user_creat;
|
||||||
|
$this->user_creation = $obj->fk_user_creat;
|
||||||
$this->user_valid = $obj->fk_user_valid;
|
$this->user_valid = $obj->fk_user_valid;
|
||||||
|
$this->user_validation = $obj->fk_user_valid;
|
||||||
|
|
||||||
$this->date_creat = $this->db->jdate($obj->date_creat);
|
$this->date_creat = $this->db->jdate($obj->date_creat);
|
||||||
|
$this->date_creation = $this->db->jdate($obj->date_creat);
|
||||||
$this->date_valid = $this->db->jdate($obj->date_valid);
|
$this->date_valid = $this->db->jdate($obj->date_valid);
|
||||||
|
$this->date_validation = $this->db->jdate($obj->date_valid);
|
||||||
$this->date_envoi = $this->db->jdate($obj->date_envoi);
|
$this->date_envoi = $this->db->jdate($obj->date_envoi);
|
||||||
|
|
||||||
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|||||||
@ -33,8 +33,9 @@ $id = GETPOST('id', 'int');
|
|||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (!$user->rights->mailing->lire || $user->socid > 0)
|
if (!$user->rights->mailing->lire || $user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -48,8 +49,7 @@ $form = new Form($db);
|
|||||||
|
|
||||||
$object = new Mailing($db);
|
$object = new Mailing($db);
|
||||||
|
|
||||||
if ($object->fetch($id) >= 0)
|
if ($object->fetch($id) >= 0) {
|
||||||
{
|
|
||||||
$head = emailing_prepare_head($object);
|
$head = emailing_prepare_head($object);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email');
|
print dol_get_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email');
|
||||||
@ -58,13 +58,14 @@ if ($object->fetch($id) >= 0)
|
|||||||
|
|
||||||
$morehtmlright = '';
|
$morehtmlright = '';
|
||||||
$nbtry = $nbok = 0;
|
$nbtry = $nbok = 0;
|
||||||
if ($object->statut == 2 || $object->statut == 3)
|
if ($object->statut == 2 || $object->statut == 3) {
|
||||||
{
|
|
||||||
$nbtry = $object->countNbOfTargets('alreadysent');
|
$nbtry = $object->countNbOfTargets('alreadysent');
|
||||||
$nbko = $object->countNbOfTargets('alreadysentko');
|
$nbko = $object->countNbOfTargets('alreadysentko');
|
||||||
|
|
||||||
$morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
|
$morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
|
||||||
if ($nbko) $morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
|
if ($nbko) {
|
||||||
|
$morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
|
||||||
|
}
|
||||||
$morehtmlright .= ') ';
|
$morehtmlright .= ') ';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,10 +74,6 @@ if ($object->fetch($id) >= 0)
|
|||||||
print '<div class="underbanner clearboth"></div><br>';
|
print '<div class="underbanner clearboth"></div><br>';
|
||||||
|
|
||||||
//print '<table width="100%"><tr><td>';
|
//print '<table width="100%"><tr><td>';
|
||||||
$object->user_creation = $object->user_creat;
|
|
||||||
$object->date_creation = $object->date_creat;
|
|
||||||
$object->user_validation = $object->user_valid;
|
|
||||||
$object->date_validation = $object->date_valid;
|
|
||||||
dol_print_object_info($object, 0);
|
dol_print_object_info($object, 0);
|
||||||
//print '</td></tr></table>';
|
//print '</td></tr></table>';
|
||||||
|
|
||||||
|
|||||||
@ -1660,7 +1660,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td valign="top">';
|
print '<td valign="top">';
|
||||||
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc) ? $objectsrc->note_public : null));
|
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc) ? $objectsrc->note_public : null));
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
// Private note
|
// Private note
|
||||||
@ -1670,7 +1670,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td valign="top">';
|
print '<td valign="top">';
|
||||||
$note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc)) ? $objectsrc->note_private : null));
|
$note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc)) ? $objectsrc->note_private : null));
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -1736,7 +1736,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
// print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
|
// print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1747,7 +1747,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
// print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
|
// print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -252,7 +252,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_8, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -264,7 +264,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_8, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -349,7 +349,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td class="tdtop">'.$langs->trans("NotePublic").'</td>';
|
print '<tr><td class="tdtop">'.$langs->trans("NotePublic").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
$doleditor = new DolEditor('note_public', $object->note_public, '', 200, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_8, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
@ -360,7 +360,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td>';
|
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
$doleditor = new DolEditor('note_private', $object->note_private, '', 200, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_8, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|||||||
@ -1008,7 +1008,7 @@ if ($action == 'create')
|
|||||||
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic');
|
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
// Private note
|
// Private note
|
||||||
@ -1019,7 +1019,7 @@ if ($action == 'create')
|
|||||||
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate');
|
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -3534,7 +3534,7 @@ if ($action == 'create')
|
|||||||
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext);
|
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td valign="top" colspan="2">';
|
print '<td valign="top" colspan="2">';
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
// Private note
|
// Private note
|
||||||
@ -3545,7 +3545,7 @@ if ($action == 'create')
|
|||||||
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext);
|
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td valign="top" colspan="2">';
|
print '<td valign="top" colspan="2">';
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -1129,13 +1129,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||||||
|
|
||||||
// Note Public
|
// Note Public
|
||||||
print '<tr><td class="tdtop"><label for="note_public">'.$langs->trans("NotePublic").'</label></td><td colspan="3">';
|
print '<tr><td class="tdtop"><label for="note_public">'.$langs->trans("NotePublic").'</label></td><td colspan="3">';
|
||||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Note Private
|
// Note Private
|
||||||
print '<tr><td class="tdtop"><label for="note_private">'.$langs->trans("NotePrivate").'</label></td><td colspan="3">';
|
print '<tr><td class="tdtop"><label for="note_private">'.$langs->trans("NotePrivate").'</label></td><td colspan="3">';
|
||||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1174,14 +1174,14 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("NotePublic").'</td><td class="tdtop">';
|
print '<tr><td>'.$langs->trans("NotePublic").'</td><td class="tdtop">';
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if (empty($user->socid))
|
if (empty($user->socid))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("NotePrivate").'</td><td class="tdtop">';
|
print '<tr><td>'.$langs->trans("NotePrivate").'</td><td class="tdtop">';
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2954,18 +2954,25 @@ abstract class CommonObject
|
|||||||
|
|
||||||
// Special cas
|
// Special cas
|
||||||
if ($this->table_element == 'product' && $newsuffix == '_private') $newsuffix = '';
|
if ($this->table_element == 'product' && $newsuffix == '_private') $newsuffix = '';
|
||||||
|
if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
|
||||||
|
$fieldusermod = "fk_user_mod";
|
||||||
|
} elseif ($this->table_element == 'ecm_files') {
|
||||||
|
$fieldusermod = "fk_user_m";
|
||||||
|
} else {
|
||||||
|
$fieldusermod = "fk_user_modif";
|
||||||
|
}
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql .= " SET note".$newsuffix." = ".(!empty($note) ? ("'".$this->db->escape($note)."'") : "NULL");
|
$sql .= " SET note".$newsuffix." = ".(!empty($note) ? ("'".$this->db->escape($note)."'") : "NULL");
|
||||||
$sql .= " ,".(in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment')) ? "fk_user_mod" : "fk_user_modif")." = ".$user->id;
|
$sql .= " ,".$fieldusermod." = ".$user->id;
|
||||||
$sql .= " WHERE rowid =".$this->id;
|
$sql .= " WHERE rowid =".$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update_note", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update_note", LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql)) {
|
||||||
{
|
if ($suffix == '_public') {
|
||||||
if ($suffix == '_public') $this->note_public = $note;
|
$this->note_public = $note;
|
||||||
elseif ($suffix == '_private') $this->note_private = $note;
|
} elseif ($suffix == '_private') {
|
||||||
else {
|
$this->note_private = $note;
|
||||||
|
} else {
|
||||||
$this->note = $note; // deprecated
|
$this->note = $note; // deprecated
|
||||||
$this->note_private = $note;
|
$this->note_private = $note;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ function categories_prepare_head(Categorie $object, $type)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/categories/info.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/categories/info.php?id='.$object->id.'&type='.$type;
|
||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
$head[$h][2] = 'info';
|
$head[$h][2] = 'info';
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -111,6 +111,16 @@ function ecm_file_prepare_head($object)
|
|||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
// Notes
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/ecm/file_note.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
|
||||||
|
$head[$h][1] = $langs->trans("Notes");
|
||||||
|
$nbNote = 0;
|
||||||
|
if (!empty($object->note_private)) $nbNote++;
|
||||||
|
if (!empty($object->note_public)) $nbNote++;
|
||||||
|
if ($nbNote > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||||
|
$head[$h][2] = 'note';
|
||||||
|
$h++;
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -263,6 +263,7 @@ class modCommande extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande';
|
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande';
|
||||||
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('commande').')';
|
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('commande').')';
|
||||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
//--------
|
//--------
|
||||||
$r = 0;
|
$r = 0;
|
||||||
|
|||||||
@ -306,7 +306,7 @@ class modExpedition extends DolibarrModules
|
|||||||
}
|
}
|
||||||
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid';
|
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid';
|
||||||
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('expedition').')';
|
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('expedition').')';
|
||||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -291,7 +291,7 @@ class modFacture extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object';
|
||||||
$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture';
|
$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture';
|
||||||
$this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('invoice').')';
|
$this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('invoice').')';
|
||||||
if (isset($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ class modFacture extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON ba.rowid = b.fk_account';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON ba.rowid = b.fk_account';
|
||||||
$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid';
|
$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('invoice').')';
|
$this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('invoice').')';
|
||||||
if (isset($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
||||||
$r++;
|
$r++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -254,7 +254,7 @@ class modPropale extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object';
|
||||||
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal';
|
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal';
|
||||||
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('propal').')';
|
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('propal').')';
|
||||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
//--------
|
//--------
|
||||||
|
|||||||
@ -231,7 +231,7 @@ class modReception extends DolibarrModules
|
|||||||
}
|
}
|
||||||
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_reception AND ed.fk_commandefourndet = cd.rowid';
|
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_reception AND ed.fk_commandefourndet = cd.rowid';
|
||||||
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('reception').')';
|
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('reception').')';
|
||||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.(empty($user) ? 0 : $user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,11 +79,16 @@ if ($module == 'propal') {
|
|||||||
$permission = $user->rights->expedition->creer;
|
$permission = $user->rights->expedition->creer;
|
||||||
} elseif ($module == 'product') {
|
} elseif ($module == 'product') {
|
||||||
$permission = $user->rights->produit->creer;
|
$permission = $user->rights->produit->creer;
|
||||||
|
} elseif ($module == 'ecmfiles') {
|
||||||
|
$permission = $user->rights->ecm->setup;
|
||||||
}
|
}
|
||||||
//else dol_print_error('','Bad value '.$module.' for param module');
|
//else dol_print_error('','Bad value '.$module.' for param module');
|
||||||
|
|
||||||
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note.
|
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) {
|
||||||
else $typeofdata = 'textarea:12:95%';
|
$typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note.
|
||||||
|
} else {
|
||||||
|
$typeofdata = 'textarea:12:95%';
|
||||||
|
}
|
||||||
|
|
||||||
print '<!-- BEGIN PHP TEMPLATE NOTES -->'."\n";
|
print '<!-- BEGIN PHP TEMPLATE NOTES -->'."\n";
|
||||||
print '<div class="tagtable border table-border tableforfield centpercent">'."\n";
|
print '<div class="tagtable border table-border tableforfield centpercent">'."\n";
|
||||||
|
|||||||
@ -443,7 +443,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -453,7 +453,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,6 +150,12 @@ class EcmFiles extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $src_object_id;
|
public $src_object_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int section_id ID of section = ID of EcmDirectory, directory of manual ECM (not stored into database)
|
||||||
|
*/
|
||||||
|
public $section_id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -389,6 +395,8 @@ class EcmFiles extends CommonObject
|
|||||||
$sql .= " t.tms as date_m,";
|
$sql .= " t.tms as date_m,";
|
||||||
$sql .= " t.fk_user_c,";
|
$sql .= " t.fk_user_c,";
|
||||||
$sql .= " t.fk_user_m,";
|
$sql .= " t.fk_user_m,";
|
||||||
|
$sql .= ' t.note_private,';
|
||||||
|
$sql .= ' t.note_public,';
|
||||||
$sql .= " t.acl,";
|
$sql .= " t.acl,";
|
||||||
$sql .= " t.src_object_type,";
|
$sql .= " t.src_object_type,";
|
||||||
$sql .= " t.src_object_id";
|
$sql .= " t.src_object_id";
|
||||||
@ -450,6 +458,8 @@ class EcmFiles extends CommonObject
|
|||||||
$this->date_m = $this->db->jdate($obj->date_m);
|
$this->date_m = $this->db->jdate($obj->date_m);
|
||||||
$this->fk_user_c = $obj->fk_user_c;
|
$this->fk_user_c = $obj->fk_user_c;
|
||||||
$this->fk_user_m = $obj->fk_user_m;
|
$this->fk_user_m = $obj->fk_user_m;
|
||||||
|
$this->note_private = $obj->note_private;
|
||||||
|
$this->note_public = $obj->note_public;
|
||||||
$this->acl = $obj->acl;
|
$this->acl = $obj->acl;
|
||||||
$this->src_object_type = $obj->src_object_type;
|
$this->src_object_type = $obj->src_object_type;
|
||||||
$this->src_object_id = $obj->src_object_id;
|
$this->src_object_id = $obj->src_object_id;
|
||||||
|
|||||||
@ -36,14 +36,15 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
if (!$user->rights->ecm->setup) accessforbidden();
|
if (!$user->rights->ecm->setup) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
$socid = GETPOST("socid", "int");
|
$socid = GETPOST("socid", "int");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0)
|
if ($user->socid > 0) {
|
||||||
{
|
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
@ -52,22 +53,26 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortorder) $sortorder = "ASC";
|
if (!$sortorder) {
|
||||||
if (!$sortfield) $sortfield = "label";
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
if (!$sortfield) {
|
||||||
|
$sortfield = "label";
|
||||||
|
}
|
||||||
|
|
||||||
$section = GETPOST("section", 'alpha');
|
$section = GETPOST("section", 'alpha');
|
||||||
if (!$section)
|
if (!$section) {
|
||||||
{
|
|
||||||
dol_print_error('', 'Error, section parameter missing');
|
dol_print_error('', 'Error, section parameter missing');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$urlfile = GETPOST("urlfile");
|
$urlfile = (string) dol_sanitizePathName(GETPOST("urlfile"));
|
||||||
if (!$urlfile)
|
if (!$urlfile) {
|
||||||
{
|
|
||||||
dol_print_error('', "ErrorParamNotDefined");
|
dol_print_error('', "ErrorParamNotDefined");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -75,8 +80,7 @@ if (!$urlfile)
|
|||||||
// Load ecm object
|
// Load ecm object
|
||||||
$ecmdir = new EcmDirectory($db);
|
$ecmdir = new EcmDirectory($db);
|
||||||
$result = $ecmdir->fetch(GETPOST("section", 'alpha'));
|
$result = $ecmdir->fetch(GETPOST("section", 'alpha'));
|
||||||
if (!$result > 0)
|
if (!$result > 0) {
|
||||||
{
|
|
||||||
dol_print_error($db, $ecmdir->error);
|
dol_print_error($db, $ecmdir->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -85,13 +89,9 @@ $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
|
|||||||
|
|
||||||
$fullpath = $conf->ecm->dir_output.'/'.$relativepath.$urlfile;
|
$fullpath = $conf->ecm->dir_output.'/'.$relativepath.$urlfile;
|
||||||
|
|
||||||
$file = new stdClass();
|
|
||||||
$file->section_id = $ecmdir->id;
|
|
||||||
$file->label = $urlfile;
|
|
||||||
|
|
||||||
$relativetodocument = 'ecm/'.$relativepath; // $relativepath is relative to ECM dir, we need relative to document
|
$relativetodocument = 'ecm/'.$relativepath; // $relativepath is relative to ECM dir, we need relative to document
|
||||||
$filepath = $relativepath.$file->label;
|
$filepath = $relativepath.$urlfile;
|
||||||
$filepathtodocument = $relativetodocument.$file->label;
|
$filepathtodocument = $relativetodocument.$urlfile;
|
||||||
|
|
||||||
// Try to load object from index
|
// Try to load object from index
|
||||||
$object = new ECMFiles($db);
|
$object = new ECMFiles($db);
|
||||||
@ -100,8 +100,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$result = $object->fetch(0, '', $filepathtodocument);
|
$result = $object->fetch(0, '', $filepathtodocument);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
dol_print_error($db, $object->error, $object->errors);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -112,11 +111,9 @@ if ($result < 0)
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($cancel)
|
if ($cancel) {
|
||||||
{
|
|
||||||
$action = '';
|
$action = '';
|
||||||
if ($backtopage)
|
if ($backtopage) {
|
||||||
{
|
|
||||||
header("Location: ".$backtopage);
|
header("Location: ".$backtopage);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
@ -126,8 +123,7 @@ if ($cancel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Rename file
|
// Rename file
|
||||||
if ($action == 'update')
|
if ($action == 'update') {
|
||||||
{
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$oldlabel = GETPOST('urlfile', 'alpha');
|
$oldlabel = GETPOST('urlfile', 'alpha');
|
||||||
@ -154,11 +150,9 @@ if ($action == 'update')
|
|||||||
// Now we update index of file
|
// Now we update index of file
|
||||||
$db->begin();
|
$db->begin();
|
||||||
//print $oldfile.' - '.$newfile;
|
//print $oldfile.' - '.$newfile;
|
||||||
if ($newlabel != $oldlabel)
|
if ($newlabel != $oldlabel) {
|
||||||
{
|
|
||||||
$result = dol_move($oldfile, $newfileformove); // This include update of database
|
$result = dol_move($oldfile, $newfileformove); // This include update of database
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
setEventMessages($langs->trans('ErrorFailToRenameFile', $oldfile, $newfile), null, 'errors');
|
setEventMessages($langs->trans('ErrorFailToRenameFile', $oldfile, $newfile), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -166,27 +160,25 @@ if ($action == 'update')
|
|||||||
|
|
||||||
// Reload object after the move
|
// Reload object after the move
|
||||||
$result = $object->fetch(0, '', $newdirrelativetodocument.$newlabel);
|
$result = $object->fetch(0, '', $newdirrelativetodocument.$newlabel);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
dol_print_error($db, $object->error, $object->errors);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
if ($shareenabled) {
|
||||||
if ($shareenabled)
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||||
$object->share = getRandomPassword(true);
|
$object->share = getRandomPassword(true);
|
||||||
} else {
|
} else {
|
||||||
$object->share = '';
|
$object->share = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->id > 0)
|
if ($object->id > 0) {
|
||||||
{
|
|
||||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
$result = $object->insertExtraFields();
|
$result = $object->insertExtraFields();
|
||||||
@ -197,8 +189,7 @@ if ($action == 'update')
|
|||||||
}
|
}
|
||||||
// Call update to set the share key
|
// Call update to set the share key
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'warnings');
|
setEventMessages($object->error, $object->errors, 'warnings');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -212,15 +203,13 @@ if ($action == 'update')
|
|||||||
$object->description = ''; // indexed content
|
$object->description = ''; // indexed content
|
||||||
$object->keyword = ''; // keyword content
|
$object->keyword = ''; // keyword content
|
||||||
$result = $object->create($user);
|
$result = $object->create($user);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'warnings');
|
setEventMessages($object->error, $object->errors, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|
||||||
$urlfile = $newlabel;
|
$urlfile = $newlabel;
|
||||||
@ -246,10 +235,11 @@ $form = new Form($db);
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$head = ecm_file_prepare_head($file);
|
$object->section_id = $ecmdir->id;
|
||||||
|
$object->label = $urlfile;
|
||||||
|
$head = ecm_file_prepare_head($object);
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit') {
|
||||||
{
|
|
||||||
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="section" value="'.$section.'">';
|
print '<input type="hidden" name="section" value="'.$section.'">';
|
||||||
@ -267,12 +257,10 @@ $tmpecmdir = new EcmDirectory($db); // Need to create a new one
|
|||||||
$tmpecmdir->fetch($ecmdir->id);
|
$tmpecmdir->fetch($ecmdir->id);
|
||||||
$result = 1;
|
$result = 1;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($tmpecmdir && $result > 0)
|
while ($tmpecmdir && $result > 0) {
|
||||||
{
|
|
||||||
$tmpecmdir->ref = $tmpecmdir->label;
|
$tmpecmdir->ref = $tmpecmdir->label;
|
||||||
$s = $tmpecmdir->getNomUrl(1).$s;
|
$s = $tmpecmdir->getNomUrl(1).$s;
|
||||||
if ($tmpecmdir->fk_parent)
|
if ($tmpecmdir->fk_parent) {
|
||||||
{
|
|
||||||
$s = ' -> '.$s;
|
$s = ' -> '.$s;
|
||||||
$result = $tmpecmdir->fetch($tmpecmdir->fk_parent);
|
$result = $tmpecmdir->fetch($tmpecmdir->fk_parent);
|
||||||
} else {
|
} else {
|
||||||
@ -284,8 +272,11 @@ while ($tmpecmdir && $result > 0)
|
|||||||
$urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfile);
|
$urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfile);
|
||||||
|
|
||||||
$s = img_picto('', 'object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> '.$s.' -> ';
|
$s = img_picto('', 'object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> '.$s.' -> ';
|
||||||
if ($action == 'edit') $s .= '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfiletoshow.'">';
|
if ($action == 'edit') {
|
||||||
else $s .= $urlfiletoshow;
|
$s .= '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfiletoshow.'">';
|
||||||
|
} else {
|
||||||
|
$s .= $urlfiletoshow;
|
||||||
|
}
|
||||||
|
|
||||||
$linkback = '';
|
$linkback = '';
|
||||||
if ($backtopage) {
|
if ($backtopage) {
|
||||||
@ -317,8 +308,7 @@ print '</td></tr>';
|
|||||||
print '<tr><td>'.$langs->trans("HashOfFileContent").'</td><td>';
|
print '<tr><td>'.$langs->trans("HashOfFileContent").'</td><td>';
|
||||||
$object = new EcmFiles($db);
|
$object = new EcmFiles($db);
|
||||||
$object->fetch(0, '', $filepathtodocument);
|
$object->fetch(0, '', $filepathtodocument);
|
||||||
if (!empty($object->label))
|
if (!empty($object->label)) {
|
||||||
{
|
|
||||||
print $object->label;
|
print $object->label;
|
||||||
} else {
|
} else {
|
||||||
print img_warning().' '.$langs->trans("FileNotYetIndexedInDatabase");
|
print img_warning().' '.$langs->trans("FileNotYetIndexedInDatabase");
|
||||||
@ -335,45 +325,63 @@ print '<tr><td>'.$langs->trans("DirectDownloadInternalLink").'</td><td>';
|
|||||||
$modulepart = 'ecm';
|
$modulepart = 'ecm';
|
||||||
$forcedownload = 1;
|
$forcedownload = 1;
|
||||||
$rellink = '/document.php?modulepart='.$modulepart;
|
$rellink = '/document.php?modulepart='.$modulepart;
|
||||||
if ($forcedownload) $rellink .= '&attachment=1';
|
if ($forcedownload) {
|
||||||
if (!empty($object->entity)) $rellink .= '&entity='.$object->entity;
|
$rellink .= '&attachment=1';
|
||||||
|
}
|
||||||
|
if (!empty($object->entity)) {
|
||||||
|
$rellink .= '&entity='.$object->entity;
|
||||||
|
}
|
||||||
$rellink .= '&file='.urlencode($filepath);
|
$rellink .= '&file='.urlencode($filepath);
|
||||||
$fulllink = $urlwithroot.$rellink;
|
$fulllink = $urlwithroot.$rellink;
|
||||||
print img_picto('', 'globe').' ';
|
print img_picto('', 'globe').' ';
|
||||||
if ($action != 'edit') print '<input type="text" class="quatrevingtpercent" id="downloadinternallink" name="downloadinternellink" value="'.dol_escape_htmltag($fulllink).'">';
|
if ($action != 'edit') {
|
||||||
else print $fulllink;
|
print '<input type="text" class="quatrevingtpercent" id="downloadinternallink" name="downloadinternellink" value="'.dol_escape_htmltag($fulllink).'">';
|
||||||
if ($action != 'edit') print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>'; // No target here.
|
} else {
|
||||||
|
print $fulllink;
|
||||||
|
}
|
||||||
|
if ($action != 'edit') {
|
||||||
|
print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>'; // No target here.
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Link for direct external download
|
// Link for direct external download
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
if ($action != 'edit') print $langs->trans("DirectDownloadLink");
|
if ($action != 'edit') {
|
||||||
else print $langs->trans("FileSharedViaALink");
|
print $langs->trans("DirectDownloadLink");
|
||||||
|
} else {
|
||||||
|
print $langs->trans("FileSharedViaALink");
|
||||||
|
}
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if (!empty($object->share))
|
if (!empty($object->share)) {
|
||||||
{
|
if ($action != 'edit') {
|
||||||
if ($action != 'edit')
|
|
||||||
{
|
|
||||||
$forcedownload = 0;
|
$forcedownload = 0;
|
||||||
|
|
||||||
$paramlink = '';
|
$paramlink = '';
|
||||||
if (!empty($object->share)) $paramlink .= ($paramlink ? '&' : '').'hashp='.$object->share; // Hash for public share
|
if (!empty($object->share)) {
|
||||||
if ($forcedownload) $paramlink .= ($paramlink ? '&' : '').'attachment=1';
|
$paramlink .= ($paramlink ? '&' : '').'hashp='.$object->share; // Hash for public share
|
||||||
|
}
|
||||||
|
if ($forcedownload) {
|
||||||
|
$paramlink .= ($paramlink ? '&' : '').'attachment=1';
|
||||||
|
}
|
||||||
|
|
||||||
$fulllink = $urlwithroot.'/document.php'.($paramlink ? '?'.$paramlink : '');
|
$fulllink = $urlwithroot.'/document.php'.($paramlink ? '?'.$paramlink : '');
|
||||||
//if (! empty($object->ref)) $fulllink.='&hashn='.$object->ref; // Hash of file path
|
//if (! empty($object->ref)) $fulllink.='&hashn='.$object->ref; // Hash of file path
|
||||||
//elseif (! empty($object->label)) $fulllink.='&hashc='.$object->label; // Hash of file content
|
//elseif (! empty($object->label)) $fulllink.='&hashc='.$object->label; // Hash of file content
|
||||||
|
|
||||||
print img_picto('', 'globe').' ';
|
print img_picto('', 'globe').' ';
|
||||||
if ($action != 'edit') print '<input type="text" class="quatrevingtpercent" id="downloadlink" name="downloadexternallink" value="'.dol_escape_htmltag($fulllink).'">';
|
if ($action != 'edit') {
|
||||||
else print $fulllink;
|
print '<input type="text" class="quatrevingtpercent" id="downloadlink" name="downloadexternallink" value="'.dol_escape_htmltag($fulllink).'">';
|
||||||
if ($action != 'edit') print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>'; // No target here
|
} else {
|
||||||
|
print $fulllink;
|
||||||
|
}
|
||||||
|
if ($action != 'edit') {
|
||||||
|
print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>'; // No target here
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<input type="checkbox" name="shareenabled"'.($object->share ? ' checked="checked"' : '').' /> ';
|
print '<input type="checkbox" name="shareenabled"'.($object->share ? ' checked="checked"' : '').' /> ';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($action != 'edit')
|
if ($action != 'edit') {
|
||||||
{
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("FileNotShared").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("FileNotShared").'</span>';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="checkbox" name="shareenabled"'.($object->share ? ' checked="checked"' : '').' /> ';
|
print '<input type="checkbox" name="shareenabled"'.($object->share ? ' checked="checked"' : '').' /> ';
|
||||||
@ -390,8 +398,7 @@ print ajax_autoselect('downloadlink');
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit') {
|
||||||
{
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button button-save" name="submit" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button button-save" name="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
@ -403,18 +410,15 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
|
|
||||||
// Confirmation de la suppression d'une ligne categorie
|
// Confirmation de la suppression d'une ligne categorie
|
||||||
if ($action == 'delete_file')
|
if ($action == 'delete_file') {
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($section), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile', $urlfile), 'confirm_deletefile', '', 1, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($section), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile', $urlfile), 'confirm_deletefile', '', 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action != 'edit')
|
if ($action != 'edit') {
|
||||||
{
|
|
||||||
// Actions buttons
|
// Actions buttons
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($user->rights->ecm->setup)
|
if ($user->rights->ecm->setup) {
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit§ion='.urlencode($section).'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit§ion='.urlencode($section).'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>';
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -426,7 +430,7 @@ if ($action != 'edit')
|
|||||||
{
|
{
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
184
htdocs/ecm/file_note.php
Normal file
184
htdocs/ecm/file_note.php
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/ecm/file_note.php
|
||||||
|
* \ingroup ecm
|
||||||
|
* \brief Fiche de notes sur une ecm file
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array('ecm'));
|
||||||
|
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
$socid = GETPOST('socid', 'int');
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
|
if (!$user->rights->ecm->setup) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$socid = GETPOST("socid", "int");
|
||||||
|
// Security check
|
||||||
|
if ($user->socid > 0) {
|
||||||
|
$action = '';
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
|
||||||
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
if (!$sortfield) {
|
||||||
|
$sortfield = "label";
|
||||||
|
}
|
||||||
|
|
||||||
|
$section = GETPOST("section", 'alpha');
|
||||||
|
if (!$section) {
|
||||||
|
dol_print_error('', 'Error, section parameter missing');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$urlfile = (string) dol_sanitizePathName(GETPOST("urlfile"));
|
||||||
|
if (!$urlfile) {
|
||||||
|
dol_print_error('', "ErrorParamNotDefined");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load ecm object
|
||||||
|
$ecmdir = new EcmDirectory($db);
|
||||||
|
$result = $ecmdir->fetch(GETPOST("section", 'alpha'));
|
||||||
|
if (!$result > 0) {
|
||||||
|
dol_print_error($db, $ecmdir->error);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$relativepath = $ecmdir->getRelativePath();
|
||||||
|
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
|
||||||
|
|
||||||
|
$fullpath = $conf->ecm->dir_output.'/'.$relativepath.$urlfile;
|
||||||
|
|
||||||
|
$relativetodocument = 'ecm/'.$relativepath; // $relativepath is relative to ECM dir, we need relative to document
|
||||||
|
$filepath = $relativepath.$urlfile;
|
||||||
|
$filepathtodocument = $relativetodocument.$urlfile;
|
||||||
|
|
||||||
|
// Try to load object from index
|
||||||
|
$object = new ECMFiles($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
// fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
$result = $object->fetch(0, '', $filepathtodocument);
|
||||||
|
if ($result < 0) {
|
||||||
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$permissionnote = $user->rights->ecm->setup; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
llxHeader('', $langs->trans('EcmFiles'));
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$object->section_id = $ecmdir->id;
|
||||||
|
$object->label = $urlfile;
|
||||||
|
$head = ecm_file_prepare_head($object);
|
||||||
|
|
||||||
|
print dol_get_fiche_head($head, 'note', $langs->trans("File"), -1, 'generic');
|
||||||
|
|
||||||
|
$s = '';
|
||||||
|
$tmpecmdir = new EcmDirectory($db); // Need to create a new one
|
||||||
|
$tmpecmdir->fetch($ecmdir->id);
|
||||||
|
$result = 1;
|
||||||
|
$i = 0;
|
||||||
|
while ($tmpecmdir && $result > 0) {
|
||||||
|
$tmpecmdir->ref = $tmpecmdir->label;
|
||||||
|
$s = $tmpecmdir->getNomUrl(1).$s;
|
||||||
|
if ($tmpecmdir->fk_parent) {
|
||||||
|
$s = ' -> '.$s;
|
||||||
|
$result = $tmpecmdir->fetch($tmpecmdir->fk_parent);
|
||||||
|
} else {
|
||||||
|
$tmpecmdir = 0;
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfile);
|
||||||
|
|
||||||
|
$s = img_picto('', 'object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> '.$s.' -> ';
|
||||||
|
if ($action == 'edit') {
|
||||||
|
$s .= '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfiletoshow.'">';
|
||||||
|
} else {
|
||||||
|
$s .= $urlfiletoshow;
|
||||||
|
}
|
||||||
|
|
||||||
|
$linkback = '';
|
||||||
|
if ($backtopage) {
|
||||||
|
$linkback = '<a href="'.$backtopage.'">'.$langs->trans("BackToTree").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$object->ref = ''; // Force to hide ref
|
||||||
|
dol_banner_tab($object, '', $linkback, 0, '', '', $s);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
|
||||||
|
$cssclass = "titlefield";
|
||||||
|
$moreparam = '&section='.$section.'&urlfile='.$urlfile;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -941,7 +941,7 @@ if ($action == 'create')
|
|||||||
// Note Public
|
// Note Public
|
||||||
print '<tr><td>'.$langs->trans("NotePublic").'</td>';
|
print '<tr><td>'.$langs->trans("NotePublic").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
@ -950,7 +950,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("NotePrivate").'</td>';
|
print '<tr><td>'.$langs->trans("NotePrivate").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1457,7 +1457,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1467,7 +1467,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -941,7 +941,7 @@ if ($action == 'create')
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
//print '<textarea name="note_public" cols="80" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
|
//print '<textarea name="note_public" cols="80" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -952,7 +952,7 @@ if ($action == 'create')
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
//print '<textarea name="note_private" cols="80" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
|
//print '<textarea name="note_private" cols="80" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
||||||
if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
if (!defined('DOL_VERSION')) define('DOL_VERSION', '14.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||||
|
|
||||||
if (!defined('EURO')) define('EURO', chr(128));
|
if (!defined('EURO')) define('EURO', chr(128));
|
||||||
|
|
||||||
|
|||||||
@ -1706,7 +1706,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
|
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_public', isset($note_public) ? $note_public : GETPOST('note_public', 'restricthtml'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', isset($note_public) ? $note_public : GETPOST('note_public', 'restricthtml'), '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
//print '<textarea name="note_public" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea>';
|
//print '<textarea name="note_public" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea>';
|
||||||
@ -1714,7 +1714,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans('NotePrivate').'</td>';
|
print '<tr><td>'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_private', isset($note_private) ? $note_private : GETPOST('note_private', 'restricthtml'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', isset($note_private) ? $note_private : GETPOST('note_private', 'restricthtml'), '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
//print '<td><textarea name="note_private" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
//print '<td><textarea name="note_private" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
||||||
|
|||||||
@ -2101,7 +2101,7 @@ if ($action == 'create')
|
|||||||
// Public note
|
// Public note
|
||||||
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
|
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_public', (GETPOSTISSET('note_public') ?GETPOST('note_public', 'restricthtml') : $note_public), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', (GETPOSTISSET('note_public') ?GETPOST('note_public', 'restricthtml') : $note_public), '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
// print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
||||||
@ -2110,7 +2110,7 @@ if ($action == 'create')
|
|||||||
// Private note
|
// Private note
|
||||||
print '<tr><td>'.$langs->trans('NotePrivate').'</td>';
|
print '<tr><td>'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_private', (GETPOSTISSET('note_private') ?GETPOST('note_private', 'restricthtml') : $note_private), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', (GETPOSTISSET('note_private') ?GETPOST('note_private', 'restricthtml') : $note_private), '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
// print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
||||||
|
|||||||
@ -4219,8 +4219,10 @@ class nusoap_server extends nusoap_base {
|
|||||||
$payload .= $this->getDebugAsXMLComment();
|
$payload .= $this->getDebugAsXMLComment();
|
||||||
}
|
}
|
||||||
$this->outgoing_headers[] = "Server: $this->title Server v$this->version";
|
$this->outgoing_headers[] = "Server: $this->title Server v$this->version";
|
||||||
preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
|
// @CHANGE Fix for php8
|
||||||
$this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
|
$rev = array();
|
||||||
|
preg_match('/\$Revision: ([^ ]+)/', $this->revision, $rev);
|
||||||
|
$this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".(isset($rev[1]) ? $rev[1] : '').")";
|
||||||
// Let the Web server decide about this
|
// Let the Web server decide about this
|
||||||
//$this->outgoing_headers[] = "Connection: Close\r\n";
|
//$this->outgoing_headers[] = "Connection: Close\r\n";
|
||||||
$payload = $this->getHTTPBody($payload);
|
$payload = $this->getHTTPBody($payload);
|
||||||
|
|||||||
@ -439,7 +439,8 @@ if (!file_exists($conffile))
|
|||||||
array('from'=>'9.0.0', 'to'=>'10.0.0'),
|
array('from'=>'9.0.0', 'to'=>'10.0.0'),
|
||||||
array('from'=>'10.0.0', 'to'=>'11.0.0'),
|
array('from'=>'10.0.0', 'to'=>'11.0.0'),
|
||||||
array('from'=>'11.0.0', 'to'=>'12.0.0'),
|
array('from'=>'11.0.0', 'to'=>'12.0.0'),
|
||||||
array('from'=>'12.0.0', 'to'=>'13.0.0')
|
array('from'=>'12.0.0', 'to'=>'13.0.0'),
|
||||||
|
array('from'=>'13.0.0', 'to'=>'14.0.0')
|
||||||
);
|
);
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
|||||||
@ -60,7 +60,6 @@ ALTER TABLE llx_mrp_mo_extrafields ADD INDEX idx_mrp_mo_fk_object(fk_object);
|
|||||||
|
|
||||||
|
|
||||||
-- For v13
|
-- For v13
|
||||||
|
|
||||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (111,11, '0','0','No Sales Tax',1);
|
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (111,11, '0','0','No Sales Tax',1);
|
||||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (112,11, '4','0','Sales Tax 4%',1);
|
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (112,11, '4','0','Sales Tax 4%',1);
|
||||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (113,11, '6','0','Sales Tax 6%',1);
|
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (113,11, '6','0','Sales Tax 6%',1);
|
||||||
@ -399,6 +398,8 @@ CREATE TABLE llx_ecm_files_extrafields
|
|||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|
||||||
ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_object);
|
ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_object);
|
||||||
|
ALTER TABLE llx_ecm_files ADD COLUMN note_private text AFTER fk_user_m;
|
||||||
|
ALTER TABLE llx_ecm_files ADD COLUMN note_public text AFTER note_private;
|
||||||
|
|
||||||
CREATE TABLE llx_ecm_directories_extrafields
|
CREATE TABLE llx_ecm_directories_extrafields
|
||||||
(
|
(
|
||||||
@ -409,6 +410,9 @@ CREATE TABLE llx_ecm_directories_extrafields
|
|||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|
||||||
ALTER TABLE llx_ecm_directories_extrafields ADD INDEX idx_ecm_directories_extrafields (fk_object);
|
ALTER TABLE llx_ecm_directories_extrafields ADD INDEX idx_ecm_directories_extrafields (fk_object);
|
||||||
|
ALTER TABLE llx_ecm_directories ADD COLUMN note_private text AFTER fk_user_m;
|
||||||
|
ALTER TABLE llx_ecm_directories ADD COLUMN note_public text AFTER note_private;
|
||||||
|
|
||||||
ALTER TABLE llx_website_page ADD COLUMN allowed_in_frames integer DEFAULT 0;
|
ALTER TABLE llx_website_page ADD COLUMN allowed_in_frames integer DEFAULT 0;
|
||||||
ALTER TABLE llx_website_page ADD COLUMN object_type varchar(255);
|
ALTER TABLE llx_website_page ADD COLUMN object_type varchar(255);
|
||||||
ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);
|
ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);
|
||||||
|
|||||||
41
htdocs/install/mysql/migration/13.0.0-14.0.0.sql
Normal file
41
htdocs/install/mysql/migration/13.0.0-14.0.0.sql
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
--
|
||||||
|
-- Be carefull to requests order.
|
||||||
|
-- This file must be loaded by calling /install/index.php page
|
||||||
|
-- when current version is 13.0.0 or higher.
|
||||||
|
--
|
||||||
|
-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
|
||||||
|
-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
|
||||||
|
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
||||||
|
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
|
||||||
|
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
|
||||||
|
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
|
||||||
|
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
|
||||||
|
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
|
||||||
|
-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field);
|
||||||
|
-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table
|
||||||
|
-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex
|
||||||
|
-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||||
|
-- To make pk to be auto increment (postgres):
|
||||||
|
-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid;
|
||||||
|
-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid);
|
||||||
|
-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq');
|
||||||
|
-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table;
|
||||||
|
-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL;
|
||||||
|
-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
|
||||||
|
-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL;
|
||||||
|
-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL;
|
||||||
|
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
||||||
|
-- Note: fields with type BLOB/TEXT can't have default value.
|
||||||
|
|
||||||
|
|
||||||
|
-- Missing in v13 or lower
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- For v14
|
||||||
|
|
||||||
|
ALTER TABLE llx_adherent ADD COLUMN ref varchar(30) AFTER rowid;
|
||||||
|
UPDATE llx_adherent SET ref = rowid WHERE ref = '' or ref IS NULL;
|
||||||
|
ALTER TABLE llx_adherent MODIFY COLUMN ref varchar(30) NOT NULL;
|
||||||
|
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_ref (ref, entity);
|
||||||
|
|
||||||
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_login (login, entity);
|
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_login (login, entity);
|
||||||
|
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_ref (ref, entity);
|
||||||
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_fk_soc (fk_soc);
|
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_fk_soc (fk_soc);
|
||||||
|
|
||||||
ALTER TABLE llx_adherent ADD INDEX idx_adherent_fk_adherent_type (fk_adherent_type);
|
ALTER TABLE llx_adherent ADD INDEX idx_adherent_fk_adherent_type (fk_adherent_type);
|
||||||
|
|||||||
@ -27,20 +27,21 @@
|
|||||||
create table llx_adherent
|
create table llx_adherent
|
||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
ref varchar(30) NOT NULL, -- member reference number
|
||||||
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
|
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
|
||||||
|
|
||||||
gender varchar(10),
|
gender varchar(10),
|
||||||
civility varchar(6),
|
civility varchar(6),
|
||||||
lastname varchar(50),
|
lastname varchar(50),
|
||||||
firstname varchar(50),
|
firstname varchar(50),
|
||||||
login varchar(50), -- login
|
login varchar(50), -- login
|
||||||
pass varchar(50), -- password
|
pass varchar(50), -- password
|
||||||
pass_crypted varchar(128),
|
pass_crypted varchar(128),
|
||||||
fk_adherent_type integer NOT NULL,
|
fk_adherent_type integer NOT NULL,
|
||||||
morphy varchar(3) NOT NULL, -- personne morale / personne physique
|
morphy varchar(3) NOT NULL, -- personne morale / personne physique
|
||||||
societe varchar(128), -- company name (should be same length than societe.name). No more used.
|
societe varchar(128), -- company name (should be same length than societe.name). No more used.
|
||||||
fk_soc integer NULL, -- Link to third party linked to member
|
fk_soc integer NULL, -- Link to third party linked to member
|
||||||
address text,
|
address text,
|
||||||
zip varchar(30),
|
zip varchar(30),
|
||||||
town varchar(50),
|
town varchar(50),
|
||||||
@ -48,34 +49,34 @@ create table llx_adherent
|
|||||||
country integer,
|
country integer,
|
||||||
email varchar(255),
|
email varchar(255),
|
||||||
|
|
||||||
socialnetworks text DEFAULT NULL, -- json with socialnetworks
|
socialnetworks text DEFAULT NULL, -- json with socialnetworks
|
||||||
skype varchar(255),
|
skype varchar(255), -- deprecated
|
||||||
twitter varchar(255), --
|
twitter varchar(255), -- deprecated
|
||||||
facebook varchar(255), --
|
facebook varchar(255), -- deprecated
|
||||||
linkedin varchar(255), --
|
linkedin varchar(255), -- deprecated
|
||||||
instagram varchar(255), --
|
instagram varchar(255), -- deprecated
|
||||||
snapchat varchar(255), --
|
snapchat varchar(255), -- deprecated
|
||||||
googleplus varchar(255), --
|
googleplus varchar(255), -- deprecated
|
||||||
youtube varchar(255), --
|
youtube varchar(255), -- deprecated
|
||||||
whatsapp varchar(255), --
|
whatsapp varchar(255), -- deprecated
|
||||||
|
|
||||||
phone varchar(30),
|
phone varchar(30),
|
||||||
phone_perso varchar(30),
|
phone_perso varchar(30),
|
||||||
phone_mobile varchar(30),
|
phone_mobile varchar(30),
|
||||||
birth date, -- birthday
|
birth date, -- birthday
|
||||||
photo varchar(255), -- filename or url of photo
|
photo varchar(255), -- filename or url of photo
|
||||||
statut smallint NOT NULL DEFAULT 0,
|
statut smallint NOT NULL DEFAULT 0,
|
||||||
public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ?
|
public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ?
|
||||||
datefin datetime, -- date de fin de validite de la cotisation
|
datefin datetime, -- date de fin de validite de la cotisation
|
||||||
note_private text DEFAULT NULL,
|
note_private text DEFAULT NULL,
|
||||||
note_public text DEFAULT NULL,
|
note_public text DEFAULT NULL,
|
||||||
model_pdf varchar(255),
|
model_pdf varchar(255),
|
||||||
datevalid datetime, -- date de validation
|
datevalid datetime, -- date de validation
|
||||||
datec datetime, -- date de creation
|
datec datetime, -- date de creation
|
||||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
|
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
|
||||||
fk_user_author integer, -- can be null because member can be create by a guest
|
fk_user_author integer, -- can be null because member can be create by a guest
|
||||||
fk_user_mod integer,
|
fk_user_mod integer,
|
||||||
fk_user_valid integer,
|
fk_user_valid integer,
|
||||||
canvas varchar(32), -- type of canvas if used (null by default)
|
canvas varchar(32), -- type of canvas if used (null by default)
|
||||||
import_key varchar(14) -- Import key
|
import_key varchar(14) -- Import key
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -33,5 +33,7 @@ CREATE TABLE llx_ecm_directories
|
|||||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
fk_user_c integer,
|
fk_user_c integer,
|
||||||
fk_user_m integer,
|
fk_user_m integer,
|
||||||
|
note_private text,
|
||||||
|
note_public text,
|
||||||
acl text
|
acl text
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|||||||
@ -38,5 +38,7 @@ CREATE TABLE llx_ecm_files
|
|||||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
fk_user_c integer,
|
fk_user_c integer,
|
||||||
fk_user_m integer,
|
fk_user_m integer,
|
||||||
|
note_private text,
|
||||||
|
note_public text,
|
||||||
acl text -- for future permission 'per file'
|
acl text -- for future permission 'per file'
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|||||||
@ -4332,6 +4332,14 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo
|
|||||||
$mod->remove('noboxes');
|
$mod->remove('noboxes');
|
||||||
$mod->init($reloadmode);
|
$mod->init($reloadmode);
|
||||||
}
|
}
|
||||||
|
} elseif ($moduletoreload == 'MAIN_MODULE_EXTERNALSITE') {
|
||||||
|
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ExternalSite module");
|
||||||
|
$res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modExternalSite.class.php';
|
||||||
|
if ($res) {
|
||||||
|
$mod = new modExternalSite($db);
|
||||||
|
$mod->remove('noboxes');
|
||||||
|
$mod->init($reloadmode);
|
||||||
|
}
|
||||||
} elseif ($moduletoreload == 'MAIN_MODULE_SOCIETE') {
|
} elseif ($moduletoreload == 'MAIN_MODULE_SOCIETE') {
|
||||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module");
|
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module");
|
||||||
$res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
|
$res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
|
||||||
|
|||||||
@ -40,6 +40,7 @@ PageForCreateEditView=PHP page to create/edit/view a record
|
|||||||
PageForAgendaTab=PHP page for event tab
|
PageForAgendaTab=PHP page for event tab
|
||||||
PageForDocumentTab=PHP page for document tab
|
PageForDocumentTab=PHP page for document tab
|
||||||
PageForNoteTab=PHP page for note tab
|
PageForNoteTab=PHP page for note tab
|
||||||
|
PageForContactTab=PHP page for contact tab
|
||||||
PathToModulePackage=Path to zip of module/application package
|
PathToModulePackage=Path to zip of module/application package
|
||||||
PathToModuleDocumentation=Path to file of module/application documentation (%s)
|
PathToModuleDocumentation=Path to file of module/application documentation (%s)
|
||||||
SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed.
|
SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed.
|
||||||
@ -105,7 +106,7 @@ TryToUseTheModuleBuilder=If you have knowledge of SQL and PHP, you may use the n
|
|||||||
SeeTopRightMenu=See <span class="fa fa-bug"></span> on the top right menu
|
SeeTopRightMenu=See <span class="fa fa-bug"></span> on the top right menu
|
||||||
AddLanguageFile=Add language file
|
AddLanguageFile=Add language file
|
||||||
YouCanUseTranslationKey=You can use here a key that is the translation key found into language file (see tab "Languages")
|
YouCanUseTranslationKey=You can use here a key that is the translation key found into language file (see tab "Languages")
|
||||||
DropTableIfEmpty=(Delete table if empty)
|
DropTableIfEmpty=(Destroy table if empty)
|
||||||
TableDoesNotExists=The table %s does not exists
|
TableDoesNotExists=The table %s does not exists
|
||||||
TableDropped=Table %s deleted
|
TableDropped=Table %s deleted
|
||||||
InitStructureFromExistingTable=Build the structure array string of an existing table
|
InitStructureFromExistingTable=Build the structure array string of an existing table
|
||||||
@ -139,3 +140,4 @@ TypeOfFieldsHelp=Type of fields:<br>varchar(99), double(24,8), real, text, html,
|
|||||||
AsciiToHtmlConverter=Ascii to HTML converter
|
AsciiToHtmlConverter=Ascii to HTML converter
|
||||||
AsciiToPdfConverter=Ascii to PDF converter
|
AsciiToPdfConverter=Ascii to PDF converter
|
||||||
TableNotEmptyDropCanceled=Table not empty. Drop has been canceled.
|
TableNotEmptyDropCanceled=Table not empty. Drop has been canceled.
|
||||||
|
ModuleBuilderNotAllowed=The module builder is available but not allowed to your user.
|
||||||
|
|||||||
@ -315,7 +315,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, true, ROWS_6, '90%');
|
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_6, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -324,7 +324,7 @@ if ($action == 'create')
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, true, ROWS_6, '90%');
|
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 160, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_6, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1125,20 +1125,20 @@ if (!function_exists("llxHeader"))
|
|||||||
/**
|
/**
|
||||||
* Show HTML header HTML + BODY + Top menu + left menu + DIV
|
* Show HTML header HTML + BODY + Top menu + left menu + DIV
|
||||||
*
|
*
|
||||||
* @param string $head Optionnal head lines
|
* @param string $head Optionnal head lines
|
||||||
* @param string $title HTML title
|
* @param string $title HTML title
|
||||||
* @param string $help_url Url links to help page
|
* @param string $help_url Url links to help page
|
||||||
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
||||||
* For other external page: http://server/url
|
* For other external page: http://server/url
|
||||||
* @param string $target Target to use on links
|
* @param string $target Target to use on links
|
||||||
* @param int $disablejs More content into html header
|
* @param int $disablejs More content into html header
|
||||||
* @param int $disablehead More content into html header
|
* @param int $disablehead More content into html header
|
||||||
* @param array $arrayofjs Array of complementary js files
|
* @param array|string $arrayofjs Array of complementary js files
|
||||||
* @param array $arrayofcss Array of complementary css files
|
* @param array|string $arrayofcss Array of complementary css files
|
||||||
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
||||||
* @param string $morecssonbody More CSS on body tag.
|
* @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'.
|
||||||
* @param string $replacemainareaby Replace call to main_area() by a print of this string
|
* @param string $replacemainareaby Replace call to main_area() by a print of this string
|
||||||
* @param int $disablenofollow Disable the "nofollow" on page
|
* @param int $disablenofollow Disable the "nofollow" on page
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0)
|
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0)
|
||||||
|
|||||||
@ -57,8 +57,8 @@ $modulename = dol_sanitizeFileName(GETPOST('modulename', 'alpha'));
|
|||||||
$objectname = dol_sanitizeFileName(GETPOST('objectname', 'alpha'));
|
$objectname = dol_sanitizeFileName(GETPOST('objectname', 'alpha'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($conf->modulebuilder->enabled)) accessforbidden('ModuleBuilderNotAllowed');
|
if (empty($conf->modulebuilder->enabled)) accessforbidden();
|
||||||
if (!$user->admin && empty($conf->global->MODULEBUILDER_FOREVERYONE)) accessforbidden('ModuleBuilderNotAllowed');
|
if (!$user->admin && empty($conf->global->MODULEBUILDER_FOREVERYONE)) accessforbidden($langs->trans('ModuleBuilderNotAllowed'));
|
||||||
|
|
||||||
|
|
||||||
// Dir for custom dirs
|
// Dir for custom dirs
|
||||||
@ -226,12 +226,15 @@ if ($dirins && $action == 'initmodule' && $modulename)
|
|||||||
// Delete dir and files that can be generated in sub tabs later if we need them (we want a minimal module first)
|
// Delete dir and files that can be generated in sub tabs later if we need them (we want a minimal module first)
|
||||||
dol_delete_dir_recursive($destdir.'/build/doxygen');
|
dol_delete_dir_recursive($destdir.'/build/doxygen');
|
||||||
dol_delete_dir_recursive($destdir.'/core/modules/mailings');
|
dol_delete_dir_recursive($destdir.'/core/modules/mailings');
|
||||||
|
dol_delete_dir_recursive($destdir.'/core/modules/'.strtolower($modulename).'');
|
||||||
dol_delete_dir_recursive($destdir.'/core/tpl');
|
dol_delete_dir_recursive($destdir.'/core/tpl');
|
||||||
dol_delete_dir_recursive($destdir.'/core/triggers');
|
dol_delete_dir_recursive($destdir.'/core/triggers');
|
||||||
dol_delete_dir_recursive($destdir.'/doc');
|
dol_delete_dir_recursive($destdir.'/doc');
|
||||||
dol_delete_dir_recursive($destdir.'/.tx');
|
dol_delete_dir_recursive($destdir.'/.tx');
|
||||||
dol_delete_dir_recursive($destdir.'/core/boxes');
|
dol_delete_dir_recursive($destdir.'/core/boxes');
|
||||||
|
|
||||||
|
dol_delete_file($destdir.'/admin/myobject_extrafields.php');
|
||||||
|
|
||||||
dol_delete_file($destdir.'/sql/data.sql');
|
dol_delete_file($destdir.'/sql/data.sql');
|
||||||
dol_delete_file($destdir.'/sql/update_x.x.x-y.y.y.sql');
|
dol_delete_file($destdir.'/sql/update_x.x.x-y.y.y.sql');
|
||||||
|
|
||||||
@ -902,9 +905,11 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
|
|||||||
$filetogenerate = array(
|
$filetogenerate = array(
|
||||||
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
||||||
'myobject_note.php'=>strtolower($objectname).'_note.php',
|
'myobject_note.php'=>strtolower($objectname).'_note.php',
|
||||||
|
'myobject_contact.php'=>strtolower($objectname).'_contact.php',
|
||||||
'myobject_document.php'=>strtolower($objectname).'_document.php',
|
'myobject_document.php'=>strtolower($objectname).'_document.php',
|
||||||
'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
|
'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
|
||||||
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
||||||
|
'admin/myobject_extrafields.php'=>'admin/'.strtolower($objectname).'_extrafields.php',
|
||||||
'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php',
|
'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php',
|
||||||
//'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php',
|
//'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php',
|
||||||
'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql',
|
'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql',
|
||||||
@ -1332,9 +1337,11 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname)
|
|||||||
$filetodelete = array(
|
$filetodelete = array(
|
||||||
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
||||||
'myobject_note.php'=>strtolower($objectname).'_note.php',
|
'myobject_note.php'=>strtolower($objectname).'_note.php',
|
||||||
|
'myobject_contact.php'=>strtolower($objectname).'_contact.php',
|
||||||
'myobject_document.php'=>strtolower($objectname).'_document.php',
|
'myobject_document.php'=>strtolower($objectname).'_document.php',
|
||||||
'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
|
'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
|
||||||
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
||||||
|
'admin/myobject_extrafields.php'=>'admin/'.strtolower($objectname).'_extrafields.php',
|
||||||
'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php',
|
'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php',
|
||||||
'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php',
|
'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php',
|
||||||
'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql',
|
'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql',
|
||||||
@ -1772,7 +1779,7 @@ if ($module == 'initmodule')
|
|||||||
print $langs->trans("EnterNameOfModuleToDeleteDesc").'<br><br>';
|
print $langs->trans("EnterNameOfModuleToDeleteDesc").'<br><br>';
|
||||||
|
|
||||||
print '<input type="text" name="module" placeholder="'.dol_escape_htmltag($langs->trans("ModuleKey")).'" value="">';
|
print '<input type="text" name="module" placeholder="'.dol_escape_htmltag($langs->trans("ModuleKey")).'" value="">';
|
||||||
print '<input type="submit" class="buttonDelete" value="'.$langs->trans("Delete").'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Delete").'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} elseif (!empty($module)) {
|
} elseif (!empty($module)) {
|
||||||
// Tabs for module
|
// Tabs for module
|
||||||
@ -2309,7 +2316,7 @@ if ($module == 'initmodule')
|
|||||||
print $langs->trans("EnterNameOfObjectToDeleteDesc").'<br><br>';
|
print $langs->trans("EnterNameOfObjectToDeleteDesc").'<br><br>';
|
||||||
|
|
||||||
print '<input type="text" name="objectname" value="'.dol_escape_htmltag($modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'">';
|
print '<input type="text" name="objectname" value="'.dol_escape_htmltag($modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'">';
|
||||||
print '<input type="submit" class="buttonDelete" name="delete" value="'.dol_escape_htmltag($langs->trans("Delete")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
print '<input type="submit" class="button smallpaddingimp" name="delete" value="'.dol_escape_htmltag($langs->trans("Delete")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
// tabobj = module
|
// tabobj = module
|
||||||
@ -2336,6 +2343,7 @@ if ($module == 'initmodule')
|
|||||||
$pathtodocument = strtolower($module).'/'.strtolower($tabobj).'_document.php';
|
$pathtodocument = strtolower($module).'/'.strtolower($tabobj).'_document.php';
|
||||||
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php';
|
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php';
|
||||||
$pathtonote = strtolower($module).'/'.strtolower($tabobj).'_note.php';
|
$pathtonote = strtolower($module).'/'.strtolower($tabobj).'_note.php';
|
||||||
|
$pathtocontact = strtolower($module).'/'.strtolower($tabobj).'_contact.php';
|
||||||
$pathtophpunit = strtolower($module).'/test/phpunit/'.strtolower($tabobj).'Test.php';
|
$pathtophpunit = strtolower($module).'/test/phpunit/'.strtolower($tabobj).'Test.php';
|
||||||
$pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'.sql';
|
$pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'.sql';
|
||||||
$pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'_extrafields.sql';
|
$pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'_extrafields.sql';
|
||||||
@ -2354,6 +2362,7 @@ if ($module == 'initmodule')
|
|||||||
$realpathtodocument = $dirread.'/'.$pathtodocument;
|
$realpathtodocument = $dirread.'/'.$pathtodocument;
|
||||||
$realpathtolist = $dirread.'/'.$pathtolist;
|
$realpathtolist = $dirread.'/'.$pathtolist;
|
||||||
$realpathtonote = $dirread.'/'.$pathtonote;
|
$realpathtonote = $dirread.'/'.$pathtonote;
|
||||||
|
$realpathtocontact = $dirread.'/'.$pathtocontact;
|
||||||
$realpathtophpunit = $dirread.'/'.$pathtophpunit;
|
$realpathtophpunit = $dirread.'/'.$pathtophpunit;
|
||||||
$realpathtosql = $dirread.'/'.$pathtosql;
|
$realpathtosql = $dirread.'/'.$pathtosql;
|
||||||
$realpathtosqlextra = $dirread.'/'.$pathtosqlextra;
|
$realpathtosqlextra = $dirread.'/'.$pathtosqlextra;
|
||||||
@ -2377,34 +2386,31 @@ if ($module == 'initmodule')
|
|||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtoclass).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtoclass).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong>'.($realpathtoapi ? '' : '<strike>').$pathtoapi.($realpathtoapi ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong>'.($realpathtoapi ? '' : '<strike>').$pathtoapi.($realpathtoapi ? '' : '</strike>').'</strong>';
|
||||||
if ($realpathtoapi)
|
if (dol_is_file($realpathtoapi)) {
|
||||||
{
|
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
if (empty($conf->global->$const_name)) // If module is not activated
|
if (empty($conf->global->$const_name)) // If module is not activated
|
||||||
{
|
{
|
||||||
print '<a href="#" target="apiexplorer" title="'.$langs->trans("ModuleMustBeEnabled", $module).'"><strike>'.$langs->trans("GoToApiExplorer").'</strike></a>';
|
print '<a href="#" class="classfortooltip" target="apiexplorer" title="'.$langs->trans("ModuleMustBeEnabled", $module).'"><strike>'.$langs->trans("GoToApiExplorer").'</strike></a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/api/index.php/explorer/" target="apiexplorer">'.$langs->trans("GoToApiExplorer").'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/api/index.php/explorer/" target="apiexplorer">'.$langs->trans("GoToApiExplorer").'</a>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span> ';
|
//print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span> ';
|
||||||
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initapi&format=php&file='.urlencode($pathtoapi).'"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a>';
|
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initapi&format=php&file='.urlencode($pathtoapi).'"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a>';
|
||||||
}
|
}
|
||||||
// PHPUnit
|
// PHPUnit
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong>'.($realpathtophpunit ? '' : '<strike>').$pathtophpunit.($realpathtophpunit ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong>'.($realpathtophpunit ? '' : '<strike>').$pathtophpunit.($realpathtophpunit ? '' : '</strike>').'</strong>';
|
||||||
|
if (dol_is_file($realpathtophpunit)) {
|
||||||
if ($realpathtophpunit)
|
|
||||||
{
|
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
} else {
|
} else {
|
||||||
//print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span> ';
|
//print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span> ';
|
||||||
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initphpunit&format=php&file='.urlencode($pathtophpunit).'"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a>';
|
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initphpunit&format=php&file='.urlencode($pathtophpunit).'"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a>';
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
@ -2431,24 +2437,24 @@ if ($module == 'initmodule')
|
|||||||
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("SqlFileExtraFields").' : <strong>'.($realpathtosqlextra ? '' : '<strike>').$pathtosqlextra.($realpathtosqlextra ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("SqlFileExtraFields").' : <strong>'.($realpathtosqlextra ? '' : '<strike>').$pathtosqlextra.($realpathtosqlextra ? '' : '</strike>').'</strong>';
|
||||||
if ($realpathtosqlextra)
|
if (dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey)) {
|
||||||
{
|
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&file='.urlencode($pathtosqlextra).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&file='.urlencode($pathtosqlextra).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtosqlextra).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtosqlextra).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition editfielda" href="'.$_SERVER["PHP_SELF"].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=droptableextrafields">'.$langs->trans("DropTableIfEmpty").'</a>';
|
print '<a class="reposition editfielda" href="'.$_SERVER["PHP_SELF"].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=droptableextrafields">'.$langs->trans("DropTableIfEmpty").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initsqlextrafields&format=sql&file='.urlencode($pathtosqlextra).'"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a>';
|
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initsqlextrafields&format=sql&file='.urlencode($pathtosqlextra).'"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a>';
|
||||||
}
|
}
|
||||||
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("SqlFileKeyExtraFields").' : <strong>'.($realpathtosqlextrakey ? '' : '<strike>').$pathtosqlextrakey.($realpathtosqlextrakey ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("SqlFileKeyExtraFields").' : <strong>'.($realpathtosqlextrakey ? '' : '<strike>').$pathtosqlextrakey.($realpathtosqlextrakey ? '' : '</strike>').'</strong>';
|
||||||
if ($realpathtosqlextrakey)
|
if (dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey)) {
|
||||||
{
|
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=sql&file='.urlencode($pathtosqlextrakey).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=sql&file='.urlencode($pathtosqlextrakey).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtosqlextrakey).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtosqlextrakey).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
|
} else {
|
||||||
|
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initsqlextrafields&format=sql&file='.urlencode($pathtosqlextra).'"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a>';
|
||||||
}
|
}
|
||||||
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -2463,30 +2469,34 @@ if ($module == 'initmodule')
|
|||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForCreateEditView").' : <strong><a href="'.$urlofcard.'?action=create" target="_test">'.($realpathtocard ? '' : '<strike>').$pathtocard.($realpathtocard ? '' : '</strike>').'?action=create</a></strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForCreateEditView").' : <strong><a href="'.$urlofcard.'?action=create" target="_test">'.($realpathtocard ? '' : '<strike>').$pathtocard.($realpathtocard ? '' : '</strike>').'?action=create</a></strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtocard).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtocard).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForAgendaTab").' : <strong>'.($realpathtoagenda ? '' : '<strike>').$pathtoagenda.($realpathtoagenda ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForContactTab").' : <strong>'.($realpathtocontact ? '' : '<strike>').$pathtocontact.($realpathtocontact ? '' : '</strike>').'</strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtoagenda).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtocontact).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
if ($realpathtoagenda)
|
if (dol_is_file($realpathtocontact)) {
|
||||||
{
|
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtoagenda).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtocontact).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForDocumentTab").' : <strong>'.($realpathtodocument ? '' : '<strike>').$pathtodocument.($realpathtodocument ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForDocumentTab").' : <strong>'.($realpathtodocument ? '' : '<strike>').$pathtodocument.($realpathtodocument ? '' : '</strike>').'</strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtodocument).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtodocument).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
if ($realpathtodocument)
|
if (dol_is_file($realpathtodocument)) {
|
||||||
{
|
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtodocument).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtodocument).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForNoteTab").' : <strong>'.($realpathtonote ? '' : '<strike>').$pathtonote.($realpathtonote ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForNoteTab").' : <strong>'.($realpathtonote ? '' : '<strike>').$pathtonote.($realpathtonote ? '' : '</strike>').'</strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtonote).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtonote).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
if ($realpathtonote)
|
if (dol_is_file($realpathtonote)) {
|
||||||
{
|
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtonote).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtonote).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForAgendaTab").' : <strong>'.($realpathtoagenda ? '' : '<strike>').$pathtoagenda.($realpathtoagenda ? '' : '</strike>').'</strong>';
|
||||||
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtoagenda).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
|
if (dol_is_file($realpathtoagenda)) {
|
||||||
|
print ' ';
|
||||||
|
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&file='.urlencode($pathtoagenda).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
|
}
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
/* This is already on Tab CLI
|
/* This is already on Tab CLI
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -2533,8 +2543,7 @@ if ($module == 'initmodule')
|
|||||||
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module.($forceddirread ? '@'.$dirread : '')).'">';
|
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module.($forceddirread ? '@'.$dirread : '')).'">';
|
||||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||||
|
|
||||||
print '<input class="button buttongen" type="submit" name="regenerateclasssql" value="'.$langs->trans("RegenerateClassAndSql").'">';
|
print '<input class="button smallpaddingimp" type="submit" name="regenerateclasssql" value="'.$langs->trans("RegenerateClassAndSql").'">';
|
||||||
//print '<input class="button buttongen" type="submit" name="regeneratemissing" value="'.$langs->trans("RegenerateMissingFiles").'">';
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ObjectProperties"), '', '');
|
print load_fiche_titre($langs->trans("ObjectProperties"), '', '');
|
||||||
@ -3073,7 +3082,7 @@ if ($module == 'initmodule')
|
|||||||
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=inithook&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a></td>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=inithook&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -3139,7 +3148,7 @@ if ($module == 'initmodule')
|
|||||||
} else {
|
} else {
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("NoTrigger");
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("NoTrigger");
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=inittrigger&format=php"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a></td>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=inittrigger&format=php"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -3190,7 +3199,7 @@ if ($module == 'initmodule')
|
|||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
||||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initcss&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a></td>';
|
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initcss&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
} else {
|
} else {
|
||||||
@ -3238,7 +3247,7 @@ if ($module == 'initmodule')
|
|||||||
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
print '</td><td><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
|
||||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initjs&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a></td>';
|
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initjs&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
} else {
|
} else {
|
||||||
@ -3292,7 +3301,7 @@ if ($module == 'initmodule')
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoWidget");
|
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoWidget");
|
||||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initwidget&format=php"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a>';
|
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initwidget&format=php"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -3374,7 +3383,7 @@ if ($module == 'initmodule')
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoCLIFile");
|
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoCLIFile");
|
||||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initcli&format=php"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a>';
|
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initcli&format=php"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -3412,7 +3421,7 @@ if ($module == 'initmodule')
|
|||||||
|
|
||||||
if ($action != 'editfile' || empty($file))
|
if ($action != 'editfile' || empty($file))
|
||||||
{
|
{
|
||||||
print '<span class="opacitymedium">'.$langs->trans("CronJobDefDesc", '<a href="'.DOL_URL_ROOT.'/cron/list.php">'.$langs->transnoentities('CronList').'</a>').'</span><br>';
|
print '<span class="opacitymedium">'.str_replace('{s1}', '<a href="'.DOL_URL_ROOT.'/cron/list.php">'.$langs->transnoentities('CronList').'</a>', $langs->trans("CronJobDefDesc", '{s1}')).'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
||||||
@ -3547,7 +3556,7 @@ if ($module == 'initmodule')
|
|||||||
} else {
|
} else {
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("FileNotYetGenerated");
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("FileNotYetGenerated");
|
||||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initdoc&format=php"><input type="button" class="button buttongen" value="'.$langs->trans("Generate").'"></a></td>';
|
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initdoc&format=php"><input type="button" class="button smallpaddingimp" value="'.$langs->trans("Generate").'"></a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -26,9 +26,22 @@
|
|||||||
* \brief Page to setup extra fields of myobject
|
* \brief Page to setup extra fields of myobject
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
// Load Dolibarr environment
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bom.lib.php';
|
$res = 0;
|
||||||
|
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||||
|
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||||
|
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||||
|
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||||
|
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
|
||||||
|
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||||
|
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||||
|
// Try main.inc.php using relative path
|
||||||
|
if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
|
||||||
|
if (!$res) die("Include of main fails");
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
require_once '../lib/mymodule.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('mymodule@mymodule', 'admin'));
|
$langs->loadLangs(array('mymodule@mymodule', 'admin'));
|
||||||
|
|||||||
@ -46,23 +46,31 @@ class modMyModule extends DolibarrModules
|
|||||||
// Id for module (must be unique).
|
// Id for module (must be unique).
|
||||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||||
$this->numero = 500000; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve an id number for your module
|
$this->numero = 500000; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve an id number for your module
|
||||||
|
|
||||||
// Key text used to identify module (for permissions, menus, etc...)
|
// Key text used to identify module (for permissions, menus, etc...)
|
||||||
$this->rights_class = 'mymodule';
|
$this->rights_class = 'mymodule';
|
||||||
|
|
||||||
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
||||||
// It is used to group modules by family in module setup page
|
// It is used to group modules by family in module setup page
|
||||||
$this->family = "other";
|
$this->family = "other";
|
||||||
|
|
||||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||||
$this->module_position = '90';
|
$this->module_position = '90';
|
||||||
|
|
||||||
// Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
// Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
||||||
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
||||||
// Module label (no space allowed), used if translation string 'ModuleMyModuleName' not found (MyModule is name of module).
|
// Module label (no space allowed), used if translation string 'ModuleMyModuleName' not found (MyModule is name of module).
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
|
|
||||||
// Module description, used if translation string 'ModuleMyModuleDesc' not found (MyModule is name of module).
|
// Module description, used if translation string 'ModuleMyModuleDesc' not found (MyModule is name of module).
|
||||||
$this->description = "MyModuleDescription";
|
$this->description = "MyModuleDescription";
|
||||||
// Used only if file README.md and README-LL.md not found.
|
// Used only if file README.md and README-LL.md not found.
|
||||||
$this->descriptionlong = "MyModule description (Long)";
|
$this->descriptionlong = "MyModule description (Long)";
|
||||||
|
|
||||||
|
// Author
|
||||||
$this->editor_name = 'Editor name';
|
$this->editor_name = 'Editor name';
|
||||||
$this->editor_url = 'https://www.example.com';
|
$this->editor_url = 'https://www.example.com';
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||||
$this->version = '1.0';
|
$this->version = '1.0';
|
||||||
// Url to the file with your last numberversion of this module
|
// Url to the file with your last numberversion of this module
|
||||||
@ -70,10 +78,13 @@ class modMyModule extends DolibarrModules
|
|||||||
|
|
||||||
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
||||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||||
|
|
||||||
// Name of image file used for this module.
|
// Name of image file used for this module.
|
||||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||||
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||||
|
// To use a supported fa-xxx css style of font awesome, use this->picto='xxx'
|
||||||
$this->picto = 'generic';
|
$this->picto = 'generic';
|
||||||
|
|
||||||
// Define some features supported by module (triggers, login, substitutions, menus, css, etc...)
|
// Define some features supported by module (triggers, login, substitutions, menus, css, etc...)
|
||||||
$this->module_parts = array(
|
$this->module_parts = array(
|
||||||
// Set this to 1 if module has its own trigger directory (core/triggers)
|
// Set this to 1 if module has its own trigger directory (core/triggers)
|
||||||
@ -113,11 +124,14 @@ class modMyModule extends DolibarrModules
|
|||||||
// Set this to 1 if features of module are opened to external users
|
// Set this to 1 if features of module are opened to external users
|
||||||
'moduleforexternal' => 0,
|
'moduleforexternal' => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Data directories to create when module is enabled.
|
// Data directories to create when module is enabled.
|
||||||
// Example: this->dirs = array("/mymodule/temp","/mymodule/subdir");
|
// Example: this->dirs = array("/mymodule/temp","/mymodule/subdir");
|
||||||
$this->dirs = array("/mymodule/temp");
|
$this->dirs = array("/mymodule/temp");
|
||||||
|
|
||||||
// Config pages. Put here list of php page, stored into mymodule/admin directory, to use to setup module.
|
// Config pages. Put here list of php page, stored into mymodule/admin directory, to use to setup module.
|
||||||
$this->config_page_url = array("setup.php@mymodule");
|
$this->config_page_url = array("setup.php@mymodule");
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
// A condition to hide module
|
// A condition to hide module
|
||||||
$this->hidden = false;
|
$this->hidden = false;
|
||||||
@ -125,9 +139,15 @@ class modMyModule extends DolibarrModules
|
|||||||
$this->depends = array();
|
$this->depends = array();
|
||||||
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
||||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
||||||
|
|
||||||
|
// The language file dedicated to your module
|
||||||
$this->langfiles = array("mymodule@mymodule");
|
$this->langfiles = array("mymodule@mymodule");
|
||||||
|
|
||||||
|
// Prerequisites
|
||||||
$this->phpmin = array(5, 5); // Minimum version of PHP required by module
|
$this->phpmin = array(5, 5); // Minimum version of PHP required by module
|
||||||
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
|
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
|
||||||
|
|
||||||
|
// Messages at activation
|
||||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||||
//$this->automatic_activation = array('FR'=>'MyModuleWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
//$this->automatic_activation = array('FR'=>'MyModuleWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
||||||
|
|||||||
203
htdocs/modulebuilder/template/myobject_contact.php
Normal file
203
htdocs/modulebuilder/template/myobject_contact.php
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) ---Put here your own copyright and developer email---
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/modulebuilder/template/myobject_contact.php
|
||||||
|
* \ingroup mymodule
|
||||||
|
* \brief Tab for contacts linked to MyObject
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Load Dolibarr environment
|
||||||
|
$res = 0;
|
||||||
|
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||||
|
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||||
|
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||||
|
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||||
|
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
|
||||||
|
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||||
|
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||||
|
// Try main.inc.php using relative path
|
||||||
|
if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
|
||||||
|
if (!$res) die("Include of main fails");
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
dol_include_once('/mymodule/class/myobject.class.php');
|
||||||
|
dol_include_once('/mymodule/lib/mymodule_myobject.lib.php');
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("mymodule@mymodule", "companies", "other", "mails"));
|
||||||
|
|
||||||
|
$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
$lineid = GETPOST('lineid', 'int');
|
||||||
|
$socid = GETPOST('socid', 'int');
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
|
// Initialize technical objects
|
||||||
|
$object = new MyObject($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
|
$hookmanager->initHooks(array('myobjectcontact', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
|
// Fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
//$result = restrictedArea($user, 'mymodule', $object->id);
|
||||||
|
|
||||||
|
$permission = $user->rights->mymodule->myobject->write;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add a new contact
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($action == 'addcontact' && $permission)
|
||||||
|
{
|
||||||
|
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||||
|
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||||
|
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
|
||||||
|
|
||||||
|
if ($result >= 0)
|
||||||
|
{
|
||||||
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
|
||||||
|
} else {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // Toggle the status of a contact
|
||||||
|
elseif ($action == 'swapstatut' && $permission)
|
||||||
|
{
|
||||||
|
$result = $object->swapContactStatus(GETPOST('ligne'));
|
||||||
|
} // Deletes a contact
|
||||||
|
elseif ($action == 'deletecontact' && $permission)
|
||||||
|
{
|
||||||
|
$result = $object->delete_contact($lineid);
|
||||||
|
|
||||||
|
if ($result >= 0)
|
||||||
|
{
|
||||||
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$title = $langs->trans('MyObject')." - ".$langs->trans('ContactsAddresses');
|
||||||
|
$help_url = '';
|
||||||
|
//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
$formcompany = new FormCompany($db);
|
||||||
|
$contactstatic = new Contact($db);
|
||||||
|
$userstatic = new User($db);
|
||||||
|
|
||||||
|
|
||||||
|
/* *************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* View and edit mode */
|
||||||
|
/* */
|
||||||
|
/* *************************************************************************** */
|
||||||
|
|
||||||
|
if ($object->id)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Show tabs
|
||||||
|
*/
|
||||||
|
$head = myobjectPrepareHead($object);
|
||||||
|
|
||||||
|
print dol_get_fiche_head($head, 'contact', $langs->trans("MyObject"), -1, $object->picto);
|
||||||
|
|
||||||
|
$linkback = '<a href="'.dol_buildpath('/mymodule/myobject_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
/*
|
||||||
|
// Ref customer
|
||||||
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
|
// Thirdparty
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
|
// Project
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
|
if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
if ($action != 'classify')
|
||||||
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
$morehtmlref.=' : ';
|
||||||
|
if ($action == 'classify') {
|
||||||
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
|
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
|
$morehtmlref.='</form>';
|
||||||
|
} else {
|
||||||
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
// Contacts lines (modules that overwrite templates must declare this into descriptor)
|
||||||
|
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
|
||||||
|
foreach ($dirtpls as $reldir)
|
||||||
|
{
|
||||||
|
$res = @include dol_buildpath($reldir.'/contacts.tpl.php');
|
||||||
|
if ($res) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -2651,14 +2651,14 @@ class Product extends CommonObject
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."commande as c";
|
$sql .= ", ".MAIN_DB_PREFIX."commande as c";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
|
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
}
|
}
|
||||||
$sql .= " WHERE c.rowid = cd.fk_commande";
|
$sql .= " WHERE c.rowid = cd.fk_commande";
|
||||||
$sql .= " AND c.fk_soc = s.rowid";
|
$sql .= " AND c.fk_soc = s.rowid";
|
||||||
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")";
|
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")";
|
||||||
$sql .= " AND cd.fk_product = ".$this->id;
|
$sql .= " AND cd.fk_product = ".$this->id;
|
||||||
if (!$user->rights->societe->client->voir && !$socid && !$forVirtualStock) {
|
if (empty($user->rights->societe->client->voir) && !$socid && !$forVirtualStock) {
|
||||||
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
|
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
}
|
}
|
||||||
if ($socid > 0) {
|
if ($socid > 0) {
|
||||||
|
|||||||
@ -365,7 +365,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
|||||||
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxHeader('', $title, $helpurl);
|
llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs');
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
@ -920,9 +920,9 @@ END;
|
|||||||
$param = "&id=".$object->id;
|
$param = "&id=".$object->id;
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($arrayfields['pfp.datec']['checked'])) print_liste_field_titre("AppliedPricesFrom", $_SERVER["PHP_SELF"], "pfp.datec", "", $param, "", $sortfield, $sortorder);
|
if (!empty($arrayfields['pfp.datec']['checked'])) print_liste_field_titre("AppliedPricesFrom", $_SERVER["PHP_SELF"], "pfp.datec", "", $param, "", $sortfield, $sortorder, '', '', 1);
|
||||||
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre("Suppliers", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre("Suppliers", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder, '', '', 1);
|
||||||
print_liste_field_titre("SupplierRef", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("SupplierRef", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder, '', '', 1);
|
||||||
if (!empty($arrayfields['pfp.fk_availability']['checked'])) print_liste_field_titre("Availability", $_SERVER["PHP_SELF"], "pfp.fk_availability", "", $param, "", $sortfield, $sortorder);
|
if (!empty($arrayfields['pfp.fk_availability']['checked'])) print_liste_field_titre("Availability", $_SERVER["PHP_SELF"], "pfp.fk_availability", "", $param, "", $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['pfp.quantity']['checked'])) print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "pfp.quantity", "", $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['pfp.quantity']['checked'])) print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "pfp.quantity", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
|||||||
@ -534,6 +534,7 @@ if ($resql)
|
|||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->{$rightskey}->supprimer) $arrayofmassactions['predelete'] = "<span class='fa fa-trash paddingrightonly'></span>".$langs->trans("Delete");
|
if ($user->rights->{$rightskey}->supprimer) $arrayofmassactions['predelete'] = "<span class='fa fa-trash paddingrightonly'></span>".$langs->trans("Delete");
|
||||||
if ($user->rights->{$rightskey}->creer) $arrayofmassactions['preaffecttag'] = '<span class="fa fa-tag paddingrightonly"></span>'.$langs->trans("AffectTag");
|
if ($user->rights->{$rightskey}->creer) $arrayofmassactions['preaffecttag'] = '<span class="fa fa-tag paddingrightonly"></span>'.$langs->trans("AffectTag");
|
||||||
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) $arrayofmassactions = array();
|
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) $arrayofmassactions = array();
|
||||||
|
|||||||
@ -705,7 +705,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
|
|||||||
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxHeader('', $title, $helpurl);
|
llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs');
|
||||||
|
|
||||||
$head = product_prepare_head($object);
|
$head = product_prepare_head($object);
|
||||||
$titre = $langs->trans("CardProduct".$object->type);
|
$titre = $langs->trans("CardProduct".$object->type);
|
||||||
|
|||||||
@ -785,7 +785,7 @@ if ($action == 'create')
|
|||||||
// Note Public
|
// Note Public
|
||||||
print '<tr><td>'.$langs->trans("NotePublic").'</td>';
|
print '<tr><td>'.$langs->trans("NotePublic").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
@ -794,7 +794,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("NotePrivate").'</td>';
|
print '<tr><td>'.$langs->trans("NotePrivate").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -493,56 +493,56 @@ function createProductOrService($authentication, $product)
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
|
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($product['price_net'] > 0) $product['price_base_type'] = 'HT';
|
if (empty($product['price_base_type'])) {
|
||||||
if ($product['price'] > 0) $product['price_base_type'] = 'TTC';
|
if (isset($product['price_net']) && $product['price_net'] > 0) $product['price_base_type'] = 'HT';
|
||||||
|
if (isset($product['price']) && $product['price'] > 0) $product['price_base_type'] = 'TTC';
|
||||||
|
}
|
||||||
|
|
||||||
if ($product['price_net'] > 0 && $product['price'] > 0)
|
if (isset($product['price_net']) && $product['price_net'] > 0 && isset($product['price']) && $product['price'] > 0)
|
||||||
{
|
{
|
||||||
$error++; $errorcode = 'KO'; $errorlabel = "You must choose between price or price_net to provide price.";
|
$error++; $errorcode = 'KO'; $errorlabel = "You must choose between price or price_net to provide price.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($product['barcode'] && !$product['barcode_type'])
|
if (!empty($product['barcode']) && empty($product['barcode_type']))
|
||||||
{
|
{
|
||||||
$error++; $errorcode = 'KO'; $errorlabel = "You must set a barcode type when setting a barcode.";
|
$error++; $errorcode = 'KO'; $errorlabel = "You must set a barcode type when setting a barcode.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
|
||||||
$newobject = new Product($db);
|
$newobject = new Product($db);
|
||||||
$newobject->ref = $product['ref'];
|
$newobject->ref = $product['ref'];
|
||||||
$newobject->ref_ext = $product['ref_ext'];
|
$newobject->ref_ext = empty($product['ref_ext']) ? '' : $product['ref_ext'];
|
||||||
$newobject->type = $product['type'];
|
$newobject->type = empty($product['type']) ? 0 : $product['type'];
|
||||||
$newobject->label = $product['label'];
|
$newobject->label = empty($product['label']) ? '' : $product['label'];
|
||||||
$newobject->description = $product['description'];
|
$newobject->description = empty($product['description']) ? '' : $product['description'];
|
||||||
$newobject->note_public = $product['note_public'];
|
$newobject->note_public = empty($product['note_public']) ? '' : $product['note_public'];
|
||||||
$newobject->note_private = $product['note_private'];
|
$newobject->note_private = empty($product['note_private']) ? '' :$product['note_private'];
|
||||||
$newobject->status = $product['status_tosell'];
|
$newobject->status = empty($product['status_tosell']) ? 0 : $product['status_tosell'];
|
||||||
$newobject->status_buy = $product['status_tobuy'];
|
$newobject->status_buy = empty($product['status_tobuy']) ? 0 : $product['status_tobuy'];
|
||||||
$newobject->price = $product['price_net'];
|
$newobject->price = isset($product['price_net']) ? $product['price_net'] : 0;
|
||||||
$newobject->price_ttc = $product['price'];
|
$newobject->price_ttc = isset($product['price']) ? $product['price'] : 0;
|
||||||
$newobject->tva_tx = $product['vat_rate'];
|
$newobject->tva_tx = empty($product['vat_rate']) ? 0 : $product['vat_rate'];
|
||||||
$newobject->price_base_type = $product['price_base_type'];
|
$newobject->price_base_type = $product['price_base_type'];
|
||||||
$newobject->date_creation = $now;
|
$newobject->date_creation = $now;
|
||||||
|
|
||||||
if ($product['barcode'])
|
if (!empty($product['barcode']))
|
||||||
{
|
{
|
||||||
$newobject->barcode = $product['barcode'];
|
$newobject->barcode = $product['barcode'];
|
||||||
$newobject->barcode_type = $product['barcode_type'];
|
$newobject->barcode_type = $product['barcode_type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$newobject->stock_reel = $product['stock_real'];
|
$newobject->stock_reel = isset($product['stock_real']) ? $product['stock_real'] : null;
|
||||||
$newobject->pmp = $product['pmp'];
|
$newobject->pmp = isset($product['pmp']) ? $product['pmp'] : null;
|
||||||
$newobject->seuil_stock_alert = $product['stock_alert'];
|
$newobject->seuil_stock_alert = isset($product['stock_alert']) ? $product['stock_alert'] : null;
|
||||||
|
|
||||||
$newobject->country_id = $product['country_id'];
|
$newobject->country_id = isset($product['country_id']) ? $product['country_id'] : 0;
|
||||||
if ($product['country_code']) $newobject->country_id = getCountry($product['country_code'], 3);
|
if (!empty($product['country_code'])) $newobject->country_id = getCountry($product['country_code'], 3);
|
||||||
$newobject->customcode = $product['customcode'];
|
$newobject->customcode = isset($product['customcode']) ? $product['customcode'] : '';
|
||||||
|
|
||||||
$newobject->canvas = $product['canvas'];
|
$newobject->canvas = isset($product['canvas']) ? $product['canvas'] : '';
|
||||||
/*foreach($product['lines'] as $line)
|
/*foreach($product['lines'] as $line)
|
||||||
{
|
{
|
||||||
$newline=new FactureLigne($db);
|
$newline=new FactureLigne($db);
|
||||||
@ -565,7 +565,7 @@ function createProductOrService($authentication, $product)
|
|||||||
$extrafields->fetch_name_optionals_label($elementtype, true);
|
$extrafields->fetch_name_optionals_label($elementtype, true);
|
||||||
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
|
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
|
||||||
{
|
{
|
||||||
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
|
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label)
|
||||||
{
|
{
|
||||||
$key = 'options_'.$key;
|
$key = 'options_'.$key;
|
||||||
$newobject->array_options[$key] = $product[$key];
|
$newobject->array_options[$key] = $product[$key];
|
||||||
|
|||||||
@ -180,7 +180,10 @@ class AdherentTest extends PHPUnit\Framework\TestCase
|
|||||||
$localobject->initAsSpecimen();
|
$localobject->initAsSpecimen();
|
||||||
$localobject->typeid=$fk_adherent_type;
|
$localobject->typeid=$fk_adherent_type;
|
||||||
$result=$localobject->create($user);
|
$result=$localobject->create($user);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
if ($result < 0) {
|
||||||
|
print $localobject->error;
|
||||||
|
}
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
@ -182,7 +182,10 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
|
|||||||
'type'=>1,
|
'type'=>1,
|
||||||
'description'=>'This is a new product created from WS PHPUnit test case',
|
'description'=>'This is a new product created from WS PHPUnit test case',
|
||||||
'barcode'=>'123456789012',
|
'barcode'=>'123456789012',
|
||||||
'barcode_type'=>2
|
'barcode_type'=>2,
|
||||||
|
'price_net'=>10,
|
||||||
|
'status_tosell'=>1,
|
||||||
|
'status_tobuy'=>1
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
print __METHOD__." call method ".$WS_METHOD."\n";
|
print __METHOD__." call method ".$WS_METHOD."\n";
|
||||||
@ -201,7 +204,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
|
|||||||
print $soapclient->response;
|
print $soapclient->response;
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
print var_export($result, true);
|
||||||
print __METHOD__." count(result)=".(is_array($result) ? count($result) : '')."\n";
|
print __METHOD__." count(result)=".(is_array($result) ? count($result) : '')."\n";
|
||||||
$this->assertEquals('OK', $result['result']['result_code']);
|
$this->assertEquals('OK', $result['result']['result_code']);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user