Merge branch 'develop' into patch-234
This commit is contained in:
commit
c63db01d5f
35
ChangeLog
35
ChangeLog
@ -25,7 +25,10 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE.
|
* The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE.
|
||||||
* The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS.
|
* The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS.
|
||||||
* If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu.
|
* If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu.
|
||||||
|
* All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'.
|
||||||
|
* All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'.
|
||||||
|
* All properties 'type_libelle' were renamed into 'type_label'.
|
||||||
|
* Renamed property of thirdparty "statut_commercial" into "status_prospect_label"
|
||||||
|
|
||||||
***** ChangeLog for 10.0.3 compared to 10.0.2 *****
|
***** ChangeLog for 10.0.3 compared to 10.0.2 *****
|
||||||
IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card.
|
IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card.
|
||||||
@ -42,11 +45,11 @@ FIX: #12041
|
|||||||
FIX: #12054
|
FIX: #12054
|
||||||
FIX: #12083
|
FIX: #12083
|
||||||
FIX: #12088
|
FIX: #12088
|
||||||
|
FIX: CVE-2019-17578 CVE-2019-17577 CVE-2019-17576
|
||||||
FIX: Clean the + of categories on the product view only in POS module
|
FIX: Clean the + of categories on the product view only in POS module
|
||||||
FIX: access to public interface when origin email has an alias.
|
FIX: access to public interface when origin email has an alias.
|
||||||
FIX: Alias name is not into the email recipient label.
|
FIX: Alias name is not into the email recipient label.
|
||||||
FIX: allow standalone credit note even if no invoice
|
FIX: allow standalone credit note even if no invoice
|
||||||
FIX: an admin can not access his own permissions after enabling advanced
|
|
||||||
FIX: an admin can not access his own permissions after enabling advanced permissions
|
FIX: an admin can not access his own permissions after enabling advanced permissions
|
||||||
FIX: Attachement of linked files on ticket when sending a message
|
FIX: Attachement of linked files on ticket when sending a message
|
||||||
FIX: avoid non numeric warning
|
FIX: avoid non numeric warning
|
||||||
@ -115,17 +118,17 @@ FIX: #11752
|
|||||||
FIX: #11789 FIX: #11790
|
FIX: #11789 FIX: #11790
|
||||||
FIX: #11804 list of tickets from a customer card display ALL tickets
|
FIX: #11804 list of tickets from a customer card display ALL tickets
|
||||||
FIX: #11834
|
FIX: #11834
|
||||||
FIX: Add char $ and ; in sanitizing of filenames.
|
FIX: add char $ and ; in sanitizing of filenames
|
||||||
FIX: Add comment before protected functions
|
FIX: add comment before protected functions
|
||||||
FIX: Add log and type of content in dolWebsiteOutput and
|
FIX: add log and type of content in dolWebsiteOutput and
|
||||||
FIX: Add repair.php option 'restore' to restore user picture after v10
|
FIX: add repair.php option 'restore' to restore user picture after v10
|
||||||
FIX: amount opened on thirdparty card dont care of credit note not converted
|
FIX: amount opened on thirdparty card dont care of credit note not converted
|
||||||
FIX: Api of documents work with value 'thirdparty'
|
FIX: API of documents work with value 'thirdparty'
|
||||||
FIX: author in message / ticket API
|
FIX: author in message / ticket API
|
||||||
FIX: avoid sql error if fk_project is empty during update
|
FIX: avoid SQL error if fk_project is empty during update
|
||||||
FIX: avoid Warning: A non-numeric value encountered
|
FIX: avoid Warning: A non-numeric value encountered
|
||||||
FIX: bad consistency in list of invoice for direct debit order.
|
FIX: bad consistency in list of invoice for direct debit order
|
||||||
FIX: Bad error management in zip compress and web site export
|
FIX: bad error management in zip compress and web site export
|
||||||
FIX: bad substitution for extrafields type checkbox
|
FIX: bad substitution for extrafields type checkbox
|
||||||
FIX: better help message with multicompany
|
FIX: better help message with multicompany
|
||||||
FIX: calculation of $products_dispatched
|
FIX: calculation of $products_dispatched
|
||||||
@ -134,11 +137,11 @@ FIX: Can't delete a draft leave even if it should
|
|||||||
FIX: Can't save setup of mailman module
|
FIX: Can't save setup of mailman module
|
||||||
FIX: column jabberid missing
|
FIX: column jabberid missing
|
||||||
FIX: Confirmation of deletion
|
FIX: Confirmation of deletion
|
||||||
FIX: Consistency in direct debit order lists.
|
FIX: Consistency in direct debit order lists
|
||||||
FIX: Content send before header warning
|
FIX: Content send before header warning
|
||||||
FIX: credit note can be split
|
FIX: credit note can be split
|
||||||
FIX: credit note used on list
|
FIX: credit note used on list
|
||||||
FIX: Css was saved on wrong website.
|
FIX: CSS was saved on wrong website
|
||||||
FIX: delivery extrafields
|
FIX: delivery extrafields
|
||||||
FIX: Disabling a website does not put it offline
|
FIX: Disabling a website does not put it offline
|
||||||
FIX: display only stripe sources for customer
|
FIX: display only stripe sources for customer
|
||||||
@ -155,13 +158,13 @@ FIX: Fatal situation if payment removed on expense report. Action
|
|||||||
FIX: filepath of generated documents doesn't handle products with special characters
|
FIX: filepath of generated documents doesn't handle products with special characters
|
||||||
FIX: for MAIN_MAXTABS_IN_CARD = $i card
|
FIX: for MAIN_MAXTABS_IN_CARD = $i card
|
||||||
FIX: gzip and bzip2 must use option -f
|
FIX: gzip and bzip2 must use option -f
|
||||||
FIX: It was possible to create cashfence without entering data.
|
FIX: it was possible to create cashfence without entering data
|
||||||
FIX: javascript error when using dol_use_jmobile=1
|
FIX: javascript error when using dol_use_jmobile=1
|
||||||
FIX: logout redirect to takepos.php
|
FIX: logout redirect to takepos.php
|
||||||
FIX: Look and feel v10
|
FIX: Look and feel v10
|
||||||
FIX: Make protected all pfd models functions
|
FIX: Make protected all pfd models functions
|
||||||
FIX: management of extrafields in modulebuilder
|
FIX: management of extrafields in modulebuilder
|
||||||
FIX: Missing div for buttons in tax, loan, various payment modules
|
FIX: missing div for buttons in tax, loan, various payment modules
|
||||||
FIX: missing include (dol_convert_file not found)
|
FIX: missing include (dol_convert_file not found)
|
||||||
FIX: Missing some replacements in website module
|
FIX: Missing some replacements in website module
|
||||||
FIX: missing test on permission on button to delete ledger record
|
FIX: missing test on permission on button to delete ledger record
|
||||||
@ -185,13 +188,13 @@ FIX: Return code of pdf_einstein.modules.php and proformat
|
|||||||
FIX: round for application fee in stripe
|
FIX: round for application fee in stripe
|
||||||
FIX: Sens of the balance (Debit - Credit in accountancy not contrary)
|
FIX: Sens of the balance (Debit - Credit in accountancy not contrary)
|
||||||
FIX: Several pb in export of documents
|
FIX: Several pb in export of documents
|
||||||
FIX: SQL syntax error and CSRF check on vat reports
|
FIX: SQL syntax error and CSRF check on VAT reports
|
||||||
FIX: takepos layout clear or focus search
|
FIX: takepos layout clear or focus search
|
||||||
FIX: too many record in sql request. When a criteria is a filter, we must
|
FIX: too many record in sql request. When a criteria is a filter, we must
|
||||||
FIX: Translation of month
|
FIX: Translation of month
|
||||||
FIX: USEDOLIBARREDITOR not always set
|
FIX: USEDOLIBARREDITOR not always set
|
||||||
FIX: VAT number for Monaco (it uses FR)
|
FIX: VAT number for Monaco (it uses FR)
|
||||||
FIX: vulenrability in uploading file found by 美创科技安全实验室
|
FIX: vulnerability in uploading file found by 美创科技安全实验室
|
||||||
FIX: wrong display (and hidden input) for already dispatched quantity
|
FIX: wrong display (and hidden input) for already dispatched quantity
|
||||||
FIX: wrong parameters (same error in branch 9, 10, develop)
|
FIX: wrong parameters (same error in branch 9, 10, develop)
|
||||||
FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES
|
FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES
|
||||||
|
|||||||
@ -65,21 +65,33 @@ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
|
|||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql); $i = 0;
|
$num = $db->num_rows($resql); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($resql); $productsid[$i] = $row[0]; $i++; }
|
while ($i < $num) {
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
$productsid[$i] = $row[0];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql); $i = 0;
|
$num = $db->num_rows($resql); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($resql); $societesid[$i] = $row[0]; $i++; }
|
while ($i < $num) {
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
$societesid[$i] = $row[0];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
} else { print "err"; }
|
} else { print "err"; }
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql); $i = 0;
|
$num = $db->num_rows($resql); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($resql); $commandesid[$i] = $row[0]; $i++; }
|
while ($i < $num) {
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
$commandesid[$i] = $row[0];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
} else { print "err"; }
|
} else { print "err"; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -186,7 +186,7 @@
|
|||||||
<!-- Check indent are done with spaces and with correct number -->
|
<!-- Check indent are done with spaces and with correct number -->
|
||||||
<!-- Disabled as this does not support tab -->
|
<!-- Disabled as this does not support tab -->
|
||||||
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
||||||
<!-- TODO Enable this
|
|
||||||
<arg name="tab-width" value="4"/>
|
<arg name="tab-width" value="4"/>
|
||||||
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||||
<properties>
|
<properties>
|
||||||
@ -194,7 +194,7 @@
|
|||||||
<property name="tabIndent" value="true"/>
|
<property name="tabIndent" value="true"/>
|
||||||
</properties>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
-->
|
|
||||||
|
|
||||||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
|
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ $search_pcgtype = GETPOST('search_pcgtype', 'alpha');
|
|||||||
$search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha');
|
$search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0) accessforbidden();
|
if ($user->socid > 0) accessforbidden();
|
||||||
if (! $user->rights->accounting->chartofaccount) accessforbidden();
|
if (! $user->rights->accounting->chartofaccount) accessforbidden();
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
|
|||||||
@ -71,7 +71,7 @@ $search_country_id = GETPOST('search_country_id', 'int');
|
|||||||
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0) accessforbidden();
|
if ($user->socid > 0) accessforbidden();
|
||||||
if (! $user->rights->accounting->chartofaccount) accessforbidden();
|
if (! $user->rights->accounting->chartofaccount) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
$langs->loadLangs(array("admin","compta"));
|
$langs->loadLangs(array("admin","compta"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->fiscalyear->write) // If we can read accounting records, we should be able to see fiscal year.
|
if (! $user->rights->accounting->fiscalyear->write) // If we can read accounting records, we should be able to see fiscal year.
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
|
|||||||
$langs->loadLangs(array("admin","compta"));
|
$langs->loadLangs(array("admin","compta"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (empty($user->rights->accounting->fiscalyear->write))
|
if (empty($user->rights->accounting->fiscalyear->write))
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
|
|||||||
$langs->loadLangs(array("admin","compta"));
|
$langs->loadLangs(array("admin","compta"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->fiscalyear->write)
|
if (! $user->rights->accounting->fiscalyear->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -45,7 +45,7 @@ $mode = GETPOST('mode', 'aZ09'); // '' or 'tmp'
|
|||||||
$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id)
|
$piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id)
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("socid", 'int');
|
$socid = GETPOST("socid", 'int');
|
||||||
// if ($user->societe_id) $socid=$user->societe_id;
|
// if ($user->socid) $socid=$user->socid;
|
||||||
|
|
||||||
$lettering = new Lettering($db);
|
$lettering = new Lettering($db);
|
||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
@ -139,7 +139,7 @@ dol_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'com
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("socid", 'int');
|
$socid = GETPOST("socid", 'int');
|
||||||
// if ($user->societe_id) $socid=$user->societe_id;
|
// if ($user->socid) $socid=$user->socid;
|
||||||
|
|
||||||
$lettering = new Lettering($db);
|
$lettering = new Lettering($db);
|
||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
@ -138,7 +138,7 @@ dol_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'com
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|||||||
@ -638,11 +638,11 @@ class AccountingAccount extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
* @param int $statut Id statut
|
* @param int $status Id status
|
||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
public function LibStatut($statut, $mode = 0)
|
public function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@ -650,34 +650,33 @@ class AccountingAccount extends CommonObject
|
|||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
$prefix='';
|
if ($status == 1) return $langs->trans('Enabled');
|
||||||
if ($statut == 1) return $langs->trans('Enabled');
|
elseif ($status == 0) return $langs->trans('Disabled');
|
||||||
elseif ($statut == 0) return $langs->trans('Disabled');
|
|
||||||
}
|
}
|
||||||
elseif ($mode == 1)
|
elseif ($mode == 1)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return $langs->trans('Enabled');
|
if ($status == 1) return $langs->trans('Enabled');
|
||||||
elseif ($statut == 0) return $langs->trans('Disabled');
|
elseif ($status == 0) return $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
elseif ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
|
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
|
||||||
elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
elseif ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4');
|
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4');
|
||||||
elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5');
|
||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
|
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
|
||||||
elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
elseif ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
|
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
|
||||||
elseif ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
|
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1975,7 +1975,12 @@ class BookKeepingLine
|
|||||||
public $code_journal;
|
public $code_journal;
|
||||||
public $journal_label;
|
public $journal_label;
|
||||||
public $piece_num;
|
public $piece_num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer|string date_creation
|
||||||
|
*/
|
||||||
public $date_creation;
|
public $date_creation;
|
||||||
|
|
||||||
public $date_modification;
|
public $date_modification;
|
||||||
public $date_export;
|
public $date_export;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ $langs->loadLangs(array("compta","bills","other","main","accountancy"));
|
|||||||
if (empty($conf->accounting->enabled)) {
|
if (empty($conf->accounting->enabled)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->fiscalyear->write)
|
if (! $user->rights->accounting->fiscalyear->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -34,7 +34,7 @@ $langs->loadLangs(array("compta","bills","other","main","accountancy"));
|
|||||||
if (empty($conf->accounting->enabled)) {
|
if (empty($conf->accounting->enabled)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->fiscalyear->write)
|
if (! $user->rights->accounting->fiscalyear->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -38,7 +38,7 @@ $codeventil = GETPOST('codeventil');
|
|||||||
$id = GETPOST('id');
|
$id = GETPOST('id');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ $langs->loadLangs(array("compta","bills","other","main","accountancy"));
|
|||||||
if (empty($conf->accounting->enabled)) {
|
if (empty($conf->accounting->enabled)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -72,7 +72,7 @@ if (! $sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if (! $sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -42,7 +42,7 @@ $codeventil = GETPOST('codeventil');
|
|||||||
$id = GETPOST('id');
|
$id = GETPOST('id');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ $langs->loadLangs(array("compta","bills","other","main","accountancy"));
|
|||||||
if (empty($conf->accounting->enabled)) {
|
if (empty($conf->accounting->enabled)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -67,7 +67,7 @@ if (! $sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -77,7 +77,7 @@ if (! $sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
|||||||
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
|
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
||||||
|
|||||||
@ -80,7 +80,7 @@ $now = dol_now();
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0 && empty($id_journal))
|
if ($user->socid > 0 && empty($id_journal))
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
@ -323,11 +323,11 @@ if ($result) {
|
|||||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
||||||
if ($reg[1] == 'socialcontribution')
|
if ($reg[1] == 'socialcontribution')
|
||||||
$reg[1] = 'SocialContribution';
|
$reg[1] = 'SocialContribution';
|
||||||
$chargestatic->lib = $langs->trans($reg[1]);
|
$chargestatic->label = $langs->trans($reg[1]);
|
||||||
} else {
|
} else {
|
||||||
$chargestatic->lib = $links[$key]['label'];
|
$chargestatic->label = $links[$key]['label'];
|
||||||
}
|
}
|
||||||
$chargestatic->ref = $chargestatic->lib;
|
$chargestatic->ref = $chargestatic->label;
|
||||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||||
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
|
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$hookmanager->initHooks(array('purchasesjournal'));
|
$hookmanager->initHooks(array('purchasesjournal'));
|
||||||
|
|||||||
@ -58,7 +58,7 @@ if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$hookmanager->initHooks(array('sellsjournal'));
|
$hookmanager->initHooks(array('sellsjournal'));
|
||||||
|
|||||||
@ -42,7 +42,7 @@ $codeventil = GETPOST('codeventil');
|
|||||||
$id = GETPOST('id');
|
$id = GETPOST('id');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ $langs->loadLangs(array("compta","bills","other","main","accountancy"));
|
|||||||
if (empty($conf->accounting->enabled)) {
|
if (empty($conf->accounting->enabled)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -74,7 +74,7 @@ if (! $sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if (! $sortorder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -178,7 +178,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
|
|||||||
$listofval = array(-1 => $langs->trans("Undefined"));
|
$listofval = array(-1 => $langs->trans("Undefined"));
|
||||||
$listofval += $adht->liste_array();
|
$listofval += $adht->liste_array();
|
||||||
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
|
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
|
||||||
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listetype)>1?1:0);
|
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval)>1?1:0);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
|
|||||||
@ -118,7 +118,7 @@ if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['act
|
|||||||
|
|
||||||
<?php echo $this->control->tpl['showend'];
|
<?php echo $this->control->tpl['showend'];
|
||||||
|
|
||||||
if (empty($user->societe_id)) {
|
if (empty($user->socid)) {
|
||||||
echo '<div class="tabsAction">';
|
echo '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($user->rights->adherent->creer) {
|
if ($user->rights->adherent->creer) {
|
||||||
|
|||||||
@ -983,7 +983,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// EMail
|
// EMail
|
||||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOST('member_email', 'alpha')?GETPOST('member_email', 'alpha'):$object->email).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOST('member_email', 'alpha')?GETPOST('member_email', 'alpha'):$object->email).'"></td></tr>';
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||||
@ -1020,13 +1020,13 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pro phone
|
// Pro phone
|
||||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(GETPOST('phone', 'alpha')?GETPOST('phone', 'alpha'):$object->phone).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(GETPOST('phone', 'alpha')?GETPOST('phone', 'alpha'):$object->phone).'"></td></tr>';
|
||||||
|
|
||||||
// Personal phone
|
// Personal phone
|
||||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(GETPOST('phone_perso', 'alpha')?GETPOST('phone_perso', 'alpha'):$object->phone_perso).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(GETPOST('phone_perso', 'alpha')?GETPOST('phone_perso', 'alpha'):$object->phone_perso).'"></td></tr>';
|
||||||
|
|
||||||
// Mobile phone
|
// Mobile phone
|
||||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile', 'alpha')?GETPOST('phone_mobile', 'alpha'):$object->phone_mobile).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile', 'alpha')?GETPOST('phone_mobile', 'alpha'):$object->phone_mobile).'"></td></tr>';
|
||||||
|
|
||||||
// Skype
|
// Skype
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled))
|
||||||
@ -1259,7 +1259,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// EMail
|
// EMail
|
||||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(isset($_POST["member_email"])?GETPOST("member_email", '', 2):$object->email).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_email').' '.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(isset($_POST["member_email"])?GETPOST("member_email", '', 2):$object->email).'"></td></tr>';
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
||||||
@ -1289,13 +1289,13 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pro phone
|
// Pro phone
|
||||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(isset($_POST["phone"])?GETPOST("phone"):$object->phone).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_phoning').' '.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(isset($_POST["phone"])?GETPOST("phone"):$object->phone).'"></td></tr>';
|
||||||
|
|
||||||
// Personal phone
|
// Personal phone
|
||||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?GETPOST("phone_perso"):$object->phone_perso).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_phoning').' '.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?GETPOST("phone_perso"):$object->phone_perso).'"></td></tr>';
|
||||||
|
|
||||||
// Mobile phone
|
// Mobile phone
|
||||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?GETPOST("phone_mobile"):$object->phone_mobile).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?GETPOST("phone_mobile"):$object->phone_mobile).'"></td></tr>';
|
||||||
|
|
||||||
// Skype
|
// Skype
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled))
|
||||||
@ -1885,7 +1885,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
if (! $user->societe_id && ! $object->user_id)
|
if (! $user->socid && ! $object->user_id)
|
||||||
{
|
{
|
||||||
if ($user->rights->user->user->creer)
|
if ($user->rights->user->user->creer)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -174,7 +174,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
// -1:brouillon, 0:resilie, >=1:valide,paye
|
// -1:brouillon, 0:resilie, >=1:valide,paye
|
||||||
// def in common object
|
// def in common object
|
||||||
//public $statut;
|
//public $status;
|
||||||
|
|
||||||
public $photo;
|
public $photo;
|
||||||
|
|
||||||
@ -2132,7 +2132,11 @@ class Adherent extends CommonObject
|
|||||||
// Only picto
|
// Only picto
|
||||||
if ($withpictoimg > 0) $picto='<span class="nopadding'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'</span>';
|
if ($withpictoimg > 0) $picto='<span class="nopadding'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'</span>';
|
||||||
// Picto must be a photo
|
// Picto must be a photo
|
||||||
else $picto='<span class="nopadding'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>'.Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg==-3?'small':''), 'mini', 0, 1).'</span>';
|
else {
|
||||||
|
$picto='<span class="nopadding'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>';
|
||||||
|
$picto.=Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg==-3?'small':''), 'mini', 0, 1);
|
||||||
|
$picto.='</span>';
|
||||||
|
}
|
||||||
$result.=$picto;
|
$result.=$picto;
|
||||||
}
|
}
|
||||||
if ($withpictoimg > -2 && $withpictoimg != 2)
|
if ($withpictoimg > -2 && $withpictoimg != 2)
|
||||||
@ -2164,94 +2168,61 @@ class Adherent extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
* @param int $statut Id statut
|
* @param int $status Id status
|
||||||
* @param int $need_subscription 1 if member type need subscription, 0 otherwise
|
* @param int $need_subscription 1 if member type need subscription, 0 otherwise
|
||||||
* @param int $date_end_subscription Date fin adhesion
|
* @param int $date_end_subscription Date fin adhesion
|
||||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
public function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0)
|
public function LibStatut($status, $need_subscription, $date_end_subscription, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
if ($mode == 0)
|
|
||||||
|
$statusType = '';
|
||||||
|
$labelStatus = '';
|
||||||
|
$labelStatusShort = '';
|
||||||
|
|
||||||
|
if ($status == -1)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
$statusType = 'status0';
|
||||||
elseif ($statut >= 1) {
|
$labelStatus = $langs->trans("MemberStatusDraft");
|
||||||
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription");
|
$labelStatusShort = $langs->trans("MemberStatusDraftShort");
|
||||||
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActive");
|
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate");
|
|
||||||
else return $langs->trans("MemberStatusPaid");
|
|
||||||
}
|
}
|
||||||
elseif ($statut == 0) return $langs->trans("MemberStatusResiliated");
|
elseif ($status >= 1) {
|
||||||
}
|
if ($need_subscription == 0)
|
||||||
elseif ($mode == 1)
|
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
$statusType = 'status4';
|
||||||
elseif ($statut >= 1) {
|
$labelStatus = $langs->trans("MemberStatusNoSubscription");
|
||||||
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription");
|
$labelStatusShort = $langs->trans("MemberStatusNoSubscriptionShort");
|
||||||
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActiveShort");
|
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLateShort");
|
|
||||||
else return $langs->trans("MemberStatusPaidShort");
|
|
||||||
}
|
}
|
||||||
elseif ($statut == 0) return $langs->trans("MemberStatusResiliatedShort");
|
elseif (! $date_end_subscription)
|
||||||
}
|
|
||||||
elseif ($mode == 2)
|
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
$statusType = 'status1';
|
||||||
elseif ($statut >= 1) {
|
$labelStatus = $langs->trans("MemberStatusActive");
|
||||||
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4').' '.$langs->trans("MemberStatusNoSubscriptionShort");
|
$labelStatusShort = $langs->trans("MemberStatusActiveShort");
|
||||||
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActiveShort");
|
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLateShort");
|
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaidShort");
|
|
||||||
}
|
}
|
||||||
elseif ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5').' '.$langs->trans("MemberStatusResiliatedShort");
|
elseif ($date_end_subscription < time())
|
||||||
}
|
|
||||||
elseif ($mode == 3)
|
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
$statusType = 'status3';
|
||||||
elseif ($statut >= 1) {
|
$labelStatus = $langs->trans("MemberStatusActiveLate");
|
||||||
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
$labelStatusShort = $langs->trans("MemberStatusActiveLateShort");
|
||||||
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
|
||||||
}
|
}
|
||||||
elseif ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5');
|
else {
|
||||||
|
$statusType = 'status4';
|
||||||
|
$labelStatus = $langs->trans("MemberStatusPaid");
|
||||||
|
$labelStatusShort = $langs->trans("MemberStatusPaidShort");
|
||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
}
|
||||||
|
elseif ($status == 0)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraft");
|
$statusType = 'status6';
|
||||||
elseif ($statut >= 1) {
|
$labelStatus = $langs->trans("MemberStatusResiliated");
|
||||||
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4').' '.$langs->trans("MemberStatusNoSubscription");
|
$labelStatusShort = $langs->trans("MemberStatusResiliatedShort");
|
||||||
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActive");
|
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLate");
|
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaid");
|
|
||||||
}
|
|
||||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'), 'statut5').' '.$langs->trans("MemberStatusResiliated");
|
|
||||||
}
|
|
||||||
elseif ($mode == 5)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusDraftShort").'</span> '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
|
||||||
elseif ($statut >= 1) {
|
|
||||||
if ($need_subscription == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusNoSubscriptionShort").' </span>'.img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
|
||||||
elseif (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveShort").' </span>'.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
|
||||||
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLateShort").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
|
||||||
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaidShort").' </span>'.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
|
||||||
}
|
|
||||||
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'), 'statut5');
|
|
||||||
}
|
|
||||||
elseif ($mode == 6)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
|
||||||
if ($statut >= 1) {
|
|
||||||
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription").' '.img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
|
||||||
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
|
||||||
else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
|
||||||
}
|
|
||||||
if ($statut == 0) return $langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'), 'statut5');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class AdherentStats extends Stats
|
|||||||
|
|
||||||
$this->where.= " m.statut != 0";
|
$this->where.= " m.statut != 0";
|
||||||
$this->where.= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")";
|
$this->where.= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")";
|
||||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if($this->memberid)
|
if($this->memberid)
|
||||||
{
|
{
|
||||||
$this->where .= " AND m.rowid = ".$this->memberid;
|
$this->where .= " AND m.rowid = ".$this->memberid;
|
||||||
@ -92,7 +92,7 @@ class AdherentStats extends Stats
|
|||||||
|
|
||||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)";
|
$sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'";
|
$sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'";
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
@ -112,7 +112,7 @@ class AdherentStats extends Stats
|
|||||||
|
|
||||||
$sql = "SELECT date_format(p.dateadh,'%Y') as dm, count(*)";
|
$sql = "SELECT date_format(p.dateadh,'%Y') as dm, count(*)";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE ".$this->where;
|
$sql.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
$sql.= $this->db->order('dm', 'DESC');
|
$sql.= $this->db->order('dm', 'DESC');
|
||||||
@ -133,7 +133,7 @@ class AdherentStats extends Stats
|
|||||||
|
|
||||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")";
|
$sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'";
|
$sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'";
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
|
|||||||
@ -431,10 +431,10 @@ class Subscription extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
* @param int $statut Id statut
|
* @param int $status Id status
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
public function LibStatut($statut)
|
public function LibStatut($status)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@ -54,7 +54,7 @@ if (! isset($cotis))
|
|||||||
|
|
||||||
$sql = "SELECT d.login, d.pass, d.datefin";
|
$sql = "SELECT d.login, d.pass, d.datefin";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
|
||||||
$sql .= " WHERE d.statut = $statut ";
|
$sql .= " WHERE d.statut = ".$statut;
|
||||||
if ($cotis==1)
|
if ($cotis==1)
|
||||||
{
|
{
|
||||||
$sql .= " AND datefin > '".$db->idate($now)."'";
|
$sql .= " AND datefin > '".$db->idate($now)."'";
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $AdherentsResilies=array();
|
|||||||
|
|
||||||
$AdherentType=array();
|
$AdherentType=array();
|
||||||
|
|
||||||
// Members list
|
// Type of membership
|
||||||
$sql = "SELECT t.rowid, t.libelle as label, t.subscription,";
|
$sql = "SELECT t.rowid, t.libelle as label, t.subscription,";
|
||||||
$sql.= " d.statut, count(d.rowid) as somme";
|
$sql.= " d.statut, count(d.rowid) as somme";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
|
||||||
@ -71,7 +71,7 @@ $sql.= " AND d.entity IN (".getEntity('adherent').")";
|
|||||||
$sql.= " WHERE t.entity IN (".getEntity('member_type').")";
|
$sql.= " WHERE t.entity IN (".getEntity('member_type').")";
|
||||||
$sql.= " GROUP BY t.rowid, t.libelle, t.subscription, d.statut";
|
$sql.= " GROUP BY t.rowid, t.libelle, t.subscription, d.statut";
|
||||||
|
|
||||||
dol_syslog("index.php::select nb of members by type", LOG_DEBUG);
|
dol_syslog("index.php::select nb of members per type", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -140,6 +140,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
{
|
{
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($listofsearchfields as $key => $value)
|
foreach($listofsearchfields as $key => $value)
|
||||||
@ -152,6 +153,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
@ -227,10 +229,8 @@ $sql = "SELECT c.subscription, c.dateadh as dateh";
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
||||||
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||||
$sql.= " AND d.rowid = c.fk_adherent";
|
$sql.= " AND d.rowid = c.fk_adherent";
|
||||||
if(isset($date_select) && $date_select != '')
|
|
||||||
{
|
|
||||||
$sql .= " AND c.dateadh LIKE '".$date_select."%'";
|
|
||||||
}
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -251,21 +251,33 @@ if ($result)
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>'.$langs->trans("Subscriptions").'</th>';
|
print '<th>'.$langs->trans("Year").'</th>';
|
||||||
print '<th class="right">'.$langs->trans("Number").'</th>';
|
print '<th class="right">'.$langs->trans("Subscriptions").'</th>';
|
||||||
print '<th class="right">'.$langs->trans("AmountTotal").'</th>';
|
print '<th class="right">'.$langs->trans("AmountTotal").'</th>';
|
||||||
print '<th class="right">'.$langs->trans("AmountAverage").'</th>';
|
print '<th class="right">'.$langs->trans("AmountAverage").'</th>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
krsort($Total);
|
krsort($Total);
|
||||||
|
$i = 0;
|
||||||
foreach ($Total as $key=>$value)
|
foreach ($Total as $key=>$value)
|
||||||
{
|
{
|
||||||
|
if ($i >= 8)
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print "<td>...</td>";
|
||||||
|
print "<td class=\"right\"></td>";
|
||||||
|
print "<td class=\"right\"></td>";
|
||||||
|
print "<td class=\"right\"></td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
break;
|
||||||
|
}
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
|
print "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
|
||||||
print "<td class=\"right\">".$Number[$key]."</td>";
|
print "<td class=\"right\">".$Number[$key]."</td>";
|
||||||
print "<td class=\"right\">".price($value)."</td>";
|
print "<td class=\"right\">".price($value)."</td>";
|
||||||
print "<td class=\"right\">".price(price2num($value/$Number[$key], 'MT'))."</td>";
|
print "<td class=\"right\">".price(price2num($value/$Number[$key], 'MT'))."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total
|
// Total
|
||||||
@ -282,7 +294,7 @@ print "<br>\n";
|
|||||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last modified members
|
* Latest modified members
|
||||||
*/
|
*/
|
||||||
$max=5;
|
$max=5;
|
||||||
|
|
||||||
@ -330,7 +342,7 @@ if ($resql)
|
|||||||
print '<td>'.$staticmember->getNomUrl(1, 32).'</td>';
|
print '<td>'.$staticmember->getNomUrl(1, 32).'</td>';
|
||||||
print '<td>'.$statictype->getNomUrl(1, 32).'</td>';
|
print '<td>'.$statictype->getNomUrl(1, 32).'</td>';
|
||||||
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
|
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
|
||||||
print '<td class="right">'.$staticmember->LibStatut($obj->statut, ($obj->subscription=='yes'?1:0), $db->jdate($obj->date_end_subscription), 5).'</td>';
|
print '<td class="right">'.$staticmember->LibStatut($obj->statut, ($obj->subscription=='yes'?1:0), $db->jdate($obj->date_end_subscription), 3).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,9 +37,9 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
|
|
||||||
// Protection
|
// Protection
|
||||||
$socid=0;
|
$socid=0;
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
$socid = $user->societe_id;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$object = new Adherent($db);
|
$object = new Adherent($db);
|
||||||
|
|||||||
@ -681,6 +681,7 @@ while ($i < min($num, $limit))
|
|||||||
$memberstatic->datefin= $datefin;
|
$memberstatic->datefin= $datefin;
|
||||||
$memberstatic->socid = $obj->fk_soc;
|
$memberstatic->socid = $obj->fk_soc;
|
||||||
$memberstatic->photo = $obj->photo;
|
$memberstatic->photo = $obj->photo;
|
||||||
|
$memberstatic->morphy = $obj->morphy;
|
||||||
|
|
||||||
if (! empty($obj->fk_soc)) {
|
if (! empty($obj->fk_soc)) {
|
||||||
$memberstatic->fetch_thirdparty();
|
$memberstatic->fetch_thirdparty();
|
||||||
|
|||||||
@ -33,10 +33,10 @@ $mode=GETPOST('mode')?GETPOST('mode'):'';
|
|||||||
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result=restrictedArea($user, 'adherent', '', '', 'cotisation');
|
$result=restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||||
|
|
||||||
|
|||||||
@ -34,10 +34,10 @@ $mode=GETPOST('mode')?GETPOST('mode'):'';
|
|||||||
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result=restrictedArea($user, 'adherent', '', '', 'cotisation');
|
$result=restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||||
|
|
||||||
|
|||||||
@ -35,10 +35,10 @@ $userid=GETPOST('userid', 'int'); if ($userid < 0) $userid=0;
|
|||||||
$socid=GETPOST('socid', 'int'); if ($socid < 0) $socid=0;
|
$socid=GETPOST('socid', 'int'); if ($socid < 0) $socid=0;
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result=restrictedArea($user, 'adherent', '', '', 'cotisation');
|
$result=restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ $cancel=GETPOST('cancel', 'alpha');
|
|||||||
// Security check
|
// Security check
|
||||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
// Security check
|
// Security check
|
||||||
$result=restrictedArea($user, 'adherent', $id, 'adherent_type');
|
$result=restrictedArea($user, 'adherent', $id, 'adherent_type');
|
||||||
|
|
||||||
|
|||||||
@ -208,7 +208,7 @@ print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
|
|||||||
print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
|
print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$sql = "SELECT rowid, code as encoding, libelle, coder, example";
|
$sql = "SELECT rowid, code as encoding, libelle as label, coder, example";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
$sql.= " WHERE entity = ".$conf->entity;
|
||||||
$sql.= " ORDER BY code";
|
$sql.= " ORDER BY code";
|
||||||
@ -225,7 +225,7 @@ if ($resql)
|
|||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven"><td width="100">';
|
print '<tr class="oddeven"><td width="100">';
|
||||||
print $obj->libelle;
|
print $obj->label;
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
||||||
//print "L'EAN se compose de 8 caracteres, 7 chiffres plus une cle de controle.<br>";
|
//print "L'EAN se compose de 8 caracteres, 7 chiffres plus une cle de controle.<br>";
|
||||||
|
|||||||
@ -183,16 +183,6 @@ elseif ($action == 'set_BOM_FREE_TEXT')
|
|||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
} elseif ($action=="setshippableiconinlist") {
|
|
||||||
// Activate Set Shippable Icon In List
|
|
||||||
$setshippableiconinlist = GETPOST('value', 'int');
|
|
||||||
$res = dolibarr_set_const($db, "SHIPPABLE_BOM_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
|
|
||||||
if (! $res > 0) $error++;
|
|
||||||
if (! $error) {
|
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
||||||
} else {
|
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -314,8 +304,6 @@ foreach ($dirmodels as $reldir)
|
|||||||
print "</table><br>\n";
|
print "</table><br>\n";
|
||||||
|
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* Document templates generators
|
* Document templates generators
|
||||||
*/
|
*/
|
||||||
@ -438,12 +426,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
|
||||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
|
||||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
|
|
||||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||||
//$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
|
|
||||||
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
|
||||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
|
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
|
||||||
|
|
||||||
|
|
||||||
@ -531,27 +514,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Notifications
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
print load_fiche_titre($langs->trans("Notifications"), '', '');
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
|
||||||
print '<td class="center" width="60"></td>';
|
|
||||||
print '<td width="80"> </td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td colspan="2">';
|
|
||||||
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
|
|
||||||
print '</td><td class="right">';
|
|
||||||
print "</td></tr>\n";
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -395,52 +395,6 @@ class PrestaShopWebservice
|
|||||||
self::checkStatusCode($request['status_code']);// check the response validity
|
self::checkStatusCode($request['status_code']);// check the response validity
|
||||||
return self::parseXML($request['response']);
|
return self::parseXML($request['response']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete (DELETE) a resource.
|
|
||||||
* Unique parameter must take : <br><br>
|
|
||||||
* 'resource' => Resource name<br>
|
|
||||||
* 'id' => ID or array which contains IDs of a resource(s) you want to delete<br><br>
|
|
||||||
* <code>
|
|
||||||
* <?php
|
|
||||||
* require_once('./PrestaShopWebservice.php');
|
|
||||||
* try
|
|
||||||
* {
|
|
||||||
* $ws = new PrestaShopWebservice('http://mystore.com/', 'ZQ88PRJX5VWQHCWE4EE7SQ7HPNX00RAJ', false);
|
|
||||||
* $xml = $ws->delete(array('resource' => 'orders', 'id' => 1));
|
|
||||||
* // Following code will not be executed if an exception is thrown.
|
|
||||||
* echo 'Successfully deleted.';
|
|
||||||
* }
|
|
||||||
* catch (PrestaShopWebserviceException $ex)
|
|
||||||
* {
|
|
||||||
* echo 'Error : '.$ex->getMessage();
|
|
||||||
* }
|
|
||||||
* ?>
|
|
||||||
* </code>
|
|
||||||
*
|
|
||||||
* @param array $options Array representing resource to delete.
|
|
||||||
* @return boolean True
|
|
||||||
*/
|
|
||||||
public function delete($options)
|
|
||||||
{
|
|
||||||
if (isset($options['url'])) {
|
|
||||||
$url = $options['url'];
|
|
||||||
} elseif (isset($options['resource']) && isset($options['id'])) {
|
|
||||||
if (is_array($options['id']))
|
|
||||||
$url = $this->url.'/api/'.$options['resource'].'/?id=['.implode(',', $options['id']).']';
|
|
||||||
else
|
|
||||||
$url = $this->url.'/api/'.$options['resource'].'/'.$options['id'];
|
|
||||||
}
|
|
||||||
if (isset($options['id_shop'])) {
|
|
||||||
$url .= '&id_shop='.$options['id_shop'];
|
|
||||||
}
|
|
||||||
if (isset($options['id_group_shop'])) {
|
|
||||||
$url .= '&id_group_shop='.$options['id_group_shop'];
|
|
||||||
}
|
|
||||||
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'DELETE'));
|
|
||||||
self::checkStatusCode($request['status_code']);// check the response validity
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -75,8 +75,8 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->socid > 0) access_forbidden();
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0);
|
||||||
//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
dol_fiche_head(array(), '');
|
dol_fiche_head(array(), '');
|
||||||
|
|
||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border centpercent tableforfield">'."\n";
|
||||||
|
|
||||||
//unset($fields[]);
|
//unset($fields[]);
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent">' . "\n";
|
print '<table class="border centpercent tableforfield">' . "\n";
|
||||||
|
|
||||||
// Common attributes
|
// Common attributes
|
||||||
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
|
||||||
@ -448,7 +448,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border centpercent tableforfield">'."\n";
|
||||||
|
|
||||||
// Common attributes
|
// Common attributes
|
||||||
//$keyforbreak='fieldkeytoswithonsecondcolumn';
|
//$keyforbreak='fieldkeytoswithonsecondcolumn';
|
||||||
|
|||||||
@ -78,9 +78,9 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=0;
|
$socid=0;
|
||||||
if ($user->societe_id > 0) // Protection if external user
|
if ($user->socid > 0) // Protection if external user
|
||||||
{
|
{
|
||||||
//$socid = $user->societe_id;
|
//$socid = $user->socid;
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
//$result = restrictedArea($user, 'emailcollector', $id, '');
|
//$result = restrictedArea($user, 'emailcollector', $id, '');
|
||||||
|
|||||||
@ -71,9 +71,9 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
|
|
||||||
// Protection if external user
|
// Protection if external user
|
||||||
$socid=0;
|
$socid=0;
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
//$socid = $user->societe_id;
|
//$socid = $user->socid;
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,7 @@ foreach ($modulesdir as $dir)
|
|||||||
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0;
|
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0;
|
||||||
|
|
||||||
// We discard modules according to property disabled
|
// We discard modules according to property disabled
|
||||||
if (! empty($objMod->hidden)) $modulequalified=0;
|
//if (! empty($objMod->hidden)) $modulequalified=0;
|
||||||
|
|
||||||
if ($modulequalified > 0)
|
if ($modulequalified > 0)
|
||||||
{
|
{
|
||||||
@ -214,15 +214,17 @@ asort($orders);
|
|||||||
//var_dump($modules);
|
//var_dump($modules);
|
||||||
|
|
||||||
|
|
||||||
|
unset($objMod);
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($orders as $tmpkey => $tmpvalue)
|
foreach($orders as $tmpkey => $tmpvalue)
|
||||||
{
|
{
|
||||||
$objMod = $modules[$tmpkey];
|
$tmpMod = $modules[$tmpkey];
|
||||||
if ($objMod->numero == $id)
|
if ($tmpMod->numero == $id)
|
||||||
{
|
{
|
||||||
$key = $i;
|
$key = $i;
|
||||||
$modName = $filename[$tmpkey];
|
$modName = $filename[$tmpkey];
|
||||||
$dirofmodule = $dirmod[$tmpkey];
|
$dirofmodule = $dirmod[$tmpkey];
|
||||||
|
$objMod = $tmpMod;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
@ -233,25 +235,7 @@ $familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$h = 0;
|
$head = modulehelp_prepare_head($objMod);
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=desc';
|
|
||||||
$head[$h][1] = $langs->trans("Description");
|
|
||||||
$head[$h][2] = 'desc';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=feature';
|
|
||||||
$head[$h][1] = $langs->trans("TechnicalServicesProvided");
|
|
||||||
$head[$h][2] = 'feature';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
if ($objMod->isCoreOrExternalModule() == 'external')
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$id.'&mode=changelog';
|
|
||||||
$head[$h][1] = $langs->trans("ChangeLog");
|
|
||||||
$head[$h][2] = 'changelog';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check filters
|
// Check filters
|
||||||
$modulename=$objMod->getName();
|
$modulename=$objMod->getName();
|
||||||
|
|||||||
522
htdocs/admin/mrp.php
Normal file
522
htdocs/admin/mrp.php
Normal file
@ -0,0 +1,522 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or 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/admin/mrp.php
|
||||||
|
* \ingroup mrp
|
||||||
|
* \brief Setup page of module MRP
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array('admin', 'errors', 'mrp', 'other'));
|
||||||
|
|
||||||
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
$action = GETPOST('action', 'alpha');
|
||||||
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$label = GETPOST('label', 'alpha');
|
||||||
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
|
$type = 'mrp';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||||
|
|
||||||
|
if ($action == 'updateMask')
|
||||||
|
{
|
||||||
|
$maskconstmrp=GETPOST('maskconstMo', 'alpha');
|
||||||
|
$maskmrp=GETPOST('maskMo', 'alpha');
|
||||||
|
|
||||||
|
if ($maskconstmrp) $res = dolibarr_set_const($db, $maskconstmrp, $maskmrp, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif ($action == 'specimen')
|
||||||
|
{
|
||||||
|
$modele=GETPOST('module', 'alpha');
|
||||||
|
|
||||||
|
$mo = new MO($db);
|
||||||
|
$mrp->initAsSpecimen();
|
||||||
|
|
||||||
|
// Search template files
|
||||||
|
$file=''; $classname=''; $filefound=0;
|
||||||
|
$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
|
foreach($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
$file=dol_buildpath($reldir."core/modules/mrp/doc/pdf_".$modele.".modules.php", 0);
|
||||||
|
if (file_exists($file))
|
||||||
|
{
|
||||||
|
$filefound=1;
|
||||||
|
$classname = "pdf_".$modele;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($filefound)
|
||||||
|
{
|
||||||
|
require_once $file;
|
||||||
|
|
||||||
|
$module = new $classname($db);
|
||||||
|
|
||||||
|
if ($module->write_file($mrp, $langs) > 0)
|
||||||
|
{
|
||||||
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mrp&file=SPECIMEN.pdf");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($module->error, null, 'errors');
|
||||||
|
dol_syslog($module->error, LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activate a model
|
||||||
|
elseif ($action == 'set')
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif ($action == 'del')
|
||||||
|
{
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
if ($conf->global->MRP_MO_ADDON_PDF == "$value") dolibarr_del_const($db, 'MRP_MO_ADDON_PDF', $conf->entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set default model
|
||||||
|
elseif ($action == 'setdoc')
|
||||||
|
{
|
||||||
|
if (dolibarr_set_const($db, "MRP_MO_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||||
|
{
|
||||||
|
// The constant that was read before the new set
|
||||||
|
// We therefore requires a variable to have a coherent view
|
||||||
|
$conf->global->MRP_MO_ADDON_PDF = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On active le modele
|
||||||
|
$ret = delDocumentModel($value, $type);
|
||||||
|
if ($ret > 0)
|
||||||
|
{
|
||||||
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif ($action == 'setmod')
|
||||||
|
{
|
||||||
|
// TODO Check if numbering module chosen can be activated
|
||||||
|
// by calling method canBeActivated
|
||||||
|
|
||||||
|
dolibarr_set_const($db, "MRP_MO_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK')
|
||||||
|
{
|
||||||
|
$draft = GETPOST("MRP_MO_DRAFT_WATERMARK");
|
||||||
|
$res = dolibarr_set_const($db, "MRP_MO_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
elseif ($action == 'set_MRP_MO_FREE_TEXT')
|
||||||
|
{
|
||||||
|
$freetext = GETPOST("MRP_MO_FREE_TEXT", 'none'); // No alpha here, we want exact string
|
||||||
|
|
||||||
|
$res = dolibarr_set_const($db, "MRP_MO_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
|
$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
|
|
||||||
|
llxHeader("", $langs->trans("MrpSetupPage"));
|
||||||
|
|
||||||
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
print load_fiche_titre($langs->trans("MrpSetupPage"), $linkback, 'title_setup');
|
||||||
|
|
||||||
|
$head = mrpAdminPrepareHead();
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'settings', $langs->trans("MOs"), -1, 'mrp');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MOs Numbering model
|
||||||
|
*/
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("MOsNumberingModules"), '', '');
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
|
||||||
|
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
|
||||||
|
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
foreach ($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
$dir = dol_buildpath($reldir."core/modules/mrp/");
|
||||||
|
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
|
$handle = opendir($dir);
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
if (substr($file, 0, 7) == 'mod_mo_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
||||||
|
{
|
||||||
|
$file = substr($file, 0, dol_strlen($file)-4);
|
||||||
|
|
||||||
|
require_once $dir.$file.'.php';
|
||||||
|
|
||||||
|
$module = new $file($db);
|
||||||
|
|
||||||
|
// Show modules according to features level
|
||||||
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||||
|
|
||||||
|
if ($module->isEnabled())
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||||
|
print $module->info();
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Show example of numbering model
|
||||||
|
print '<td class="nowrap">';
|
||||||
|
$tmp=$module->getExample();
|
||||||
|
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||||
|
else print $tmp;
|
||||||
|
print '</td>'."\n";
|
||||||
|
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($conf->global->MRP_MO_ADDON == $file)
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
$mrp=new MO($db);
|
||||||
|
$mrp->initAsSpecimen();
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip='';
|
||||||
|
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||||
|
$mrp->type=0;
|
||||||
|
$nextval=$module->getNextValue($mysoc, $mrp);
|
||||||
|
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||||
|
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||||
|
if ($nextval) {
|
||||||
|
if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured')
|
||||||
|
$nextval = $langs->trans($nextval);
|
||||||
|
$htmltooltip.=$nextval.'<br>';
|
||||||
|
} else {
|
||||||
|
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td class="center">';
|
||||||
|
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</table><br>\n";
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Document templates generators
|
||||||
|
*/
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("MOsModelModule"), '', '');
|
||||||
|
|
||||||
|
// Load array def with activated templates
|
||||||
|
$def = array();
|
||||||
|
$sql = "SELECT nom";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql.= " WHERE type = '".$type."'";
|
||||||
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
$num_rows=$db->num_rows($resql);
|
||||||
|
while ($i < $num_rows)
|
||||||
|
{
|
||||||
|
$array = $db->fetch_array($resql);
|
||||||
|
array_push($def, $array[0]);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||||
|
print "<tr class=\"liste_titre\">\n";
|
||||||
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||||
|
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||||
|
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
clearstatcache();
|
||||||
|
|
||||||
|
foreach ($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
foreach (array('','/doc') as $valdir)
|
||||||
|
{
|
||||||
|
$dir = dol_buildpath($reldir."core/modules/mrp".$valdir);
|
||||||
|
|
||||||
|
if (is_dir($dir))
|
||||||
|
{
|
||||||
|
$handle=opendir($dir);
|
||||||
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
|
while (($file = readdir($handle))!==false)
|
||||||
|
{
|
||||||
|
$filelist[]=$file;
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
arsort($filelist);
|
||||||
|
|
||||||
|
foreach($filelist as $file)
|
||||||
|
{
|
||||||
|
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
|
||||||
|
{
|
||||||
|
if (file_exists($dir.'/'.$file))
|
||||||
|
{
|
||||||
|
$name = substr($file, 4, dol_strlen($file) -16);
|
||||||
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||||
|
|
||||||
|
require_once $dir.'/'.$file;
|
||||||
|
$module = new $classname($db);
|
||||||
|
|
||||||
|
$modulequalified=1;
|
||||||
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||||
|
|
||||||
|
if ($modulequalified)
|
||||||
|
{
|
||||||
|
$var = !$var;
|
||||||
|
print '<tr class="oddeven"><td width="100">';
|
||||||
|
print (empty($module->name)?$name:$module->name);
|
||||||
|
print "</td><td>\n";
|
||||||
|
if (method_exists($module, 'info')) print $module->info($langs);
|
||||||
|
else print $module->description;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Active
|
||||||
|
if (in_array($name, $def))
|
||||||
|
{
|
||||||
|
print '<td class="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||||
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td class="center">'."\n";
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($conf->global->MRP_MO_ADDON_PDF == $name)
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Default"), 'on');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Info
|
||||||
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||||
|
if ($module->type == 'pdf')
|
||||||
|
{
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
}
|
||||||
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftMOs").': '.yn($module->option_draft_watermark, 1, 1);
|
||||||
|
|
||||||
|
|
||||||
|
print '<td class="center">';
|
||||||
|
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Preview
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($module->type == 'pdf')
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print "<br>";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Other options
|
||||||
|
*/
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||||
|
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
|
||||||
|
print "<td> </td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
|
||||||
|
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
|
||||||
|
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||||
|
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
|
||||||
|
$htmltext.='</i>';
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="set_MRP_MO_FREE_TEXT">';
|
||||||
|
print '<tr class="oddeven"><td colspan="2">';
|
||||||
|
print $form->textwithpicto($langs->trans("FreeLegalTextOnMOs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||||
|
$variablename='MRP_MO_FREE_TEXT';
|
||||||
|
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||||
|
{
|
||||||
|
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||||
|
print $doleditor->Create();
|
||||||
|
}
|
||||||
|
print '</td><td class="right">';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
print "</td></tr>\n";
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
//Use draft Watermark
|
||||||
|
|
||||||
|
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print "<input type=\"hidden\" name=\"action\" value=\"set_MRP_MO_DRAFT_WATERMARK\">";
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $form->textwithpicto($langs->trans("WatermarkOnDraftMOs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||||
|
print '</td><td>';
|
||||||
|
print '<input class="flat minwidth200" type="text" name="MRP_MO_DRAFT_WATERMARK" value="'.$conf->global->MRP_MO_DRAFT_WATERMARK.'">';
|
||||||
|
print '</td><td class="right">';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
print "</td></tr>\n";
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -236,7 +236,7 @@ foreach($listofnotifiedevents as $notifiedevent)
|
|||||||
$s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
$s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
||||||
$arrayemail=explode(',', $value);
|
$arrayemail=explode(',', $value);
|
||||||
$showwarning=0;
|
$showwarning=0;
|
||||||
foreach($arrayemail as $key=>$valuedet)
|
foreach($arrayemail as $keydet => $valuedet)
|
||||||
{
|
{
|
||||||
$valuedet=trim($valuedet);
|
$valuedet=trim($valuedet);
|
||||||
if (! empty($valuedet) && ! isValidEmail($valuedet, 1)) $showwarning++;
|
if (! empty($valuedet) && ! isValidEmail($valuedet, 1)) $showwarning++;
|
||||||
|
|||||||
@ -35,10 +35,10 @@ $action=GETPOST('action', 'alpha');
|
|||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
|
|||||||
@ -35,10 +35,10 @@ $action=GETPOST('action', 'alpha');
|
|||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
|
|||||||
@ -458,7 +458,7 @@ if ($mode == 'searchkey')
|
|||||||
//print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder;
|
//print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder;
|
||||||
$title = $langs->trans("TranslationKeySearch");
|
$title = $langs->trans("TranslationKeySearch");
|
||||||
if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')';
|
if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')';
|
||||||
print print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n";
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit);
|
||||||
|
|
||||||
print '<input type="hidden" id="action" name="action" value="search">';
|
print '<input type="hidden" id="action" name="action" value="search">';
|
||||||
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
||||||
@ -466,7 +466,7 @@ if ($mode == 'searchkey')
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder).'</td>';
|
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
|
||||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
|
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
|
||||||
|
|||||||
@ -421,7 +421,7 @@ $h++;
|
|||||||
dol_fiche_head($head, 'website', '', -1);
|
dol_fiche_head($head, 'website', '', -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("WebsiteSetupDesc").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("WebsiteSetupDesc").'</span><br>';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -102,6 +102,7 @@ class DolibarrApi
|
|||||||
unset($object->isextrafieldmanaged);
|
unset($object->isextrafieldmanaged);
|
||||||
unset($object->ismultientitymanaged);
|
unset($object->ismultientitymanaged);
|
||||||
unset($object->restrictiononfksoc);
|
unset($object->restrictiononfksoc);
|
||||||
|
unset($object->table_rowid);
|
||||||
|
|
||||||
// Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses
|
// Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses
|
||||||
unset($object->linkedObjects);
|
unset($object->linkedObjects);
|
||||||
@ -127,13 +128,14 @@ class DolibarrApi
|
|||||||
unset($object->timespent_withhour);
|
unset($object->timespent_withhour);
|
||||||
unset($object->timespent_fk_user);
|
unset($object->timespent_fk_user);
|
||||||
unset($object->timespent_note);
|
unset($object->timespent_note);
|
||||||
|
unset($object->fk_delivery_address);
|
||||||
|
|
||||||
unset($object->statuts);
|
unset($object->statuts);
|
||||||
unset($object->statuts_short);
|
unset($object->statuts_short);
|
||||||
unset($object->statuts_logo);
|
unset($object->statuts_logo);
|
||||||
unset($object->statuts_long);
|
unset($object->statuts_long);
|
||||||
unset($object->labelstatut);
|
unset($object->labelStatus);
|
||||||
unset($object->labelstatut_short);
|
unset($object->labelStatusShort);
|
||||||
|
|
||||||
unset($object->element);
|
unset($object->element);
|
||||||
unset($object->fk_element);
|
unset($object->fk_element);
|
||||||
@ -146,6 +148,11 @@ class DolibarrApi
|
|||||||
|
|
||||||
unset($object->skip_update_total);
|
unset($object->skip_update_total);
|
||||||
unset($object->context);
|
unset($object->context);
|
||||||
|
unset($object->next_prev_filter);
|
||||||
|
|
||||||
|
if ($object->table_element != 'ticket') {
|
||||||
|
unset($object->comments);
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the $oldcopy property because it is not supported by the JSON
|
// Remove the $oldcopy property because it is not supported by the JSON
|
||||||
// encoder. The following error is generated when trying to serialize
|
// encoder. The following error is generated when trying to serialize
|
||||||
@ -178,6 +185,7 @@ class DolibarrApi
|
|||||||
unset($object->lines[$i]->cond_reglement);
|
unset($object->lines[$i]->cond_reglement);
|
||||||
unset($object->lines[$i]->fk_delivery_address);
|
unset($object->lines[$i]->fk_delivery_address);
|
||||||
unset($object->lines[$i]->fk_projet);
|
unset($object->lines[$i]->fk_projet);
|
||||||
|
unset($object->lines[$i]->fk_project);
|
||||||
unset($object->lines[$i]->thirdparty);
|
unset($object->lines[$i]->thirdparty);
|
||||||
unset($object->lines[$i]->user);
|
unset($object->lines[$i]->user);
|
||||||
unset($object->lines[$i]->model_pdf);
|
unset($object->lines[$i]->model_pdf);
|
||||||
|
|||||||
@ -390,7 +390,7 @@ class Setup extends DolibarrApi
|
|||||||
public function getListOfShipmentMethods($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
public function getListOfShipmentMethods($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
$list = array();
|
$list = array();
|
||||||
$sql = "SELECT t.code, t.libelle, t.description, t.tracking";
|
$sql = "SELECT t.rowid, t.code, t.libelle, t.description, t.tracking";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t";
|
||||||
$sql.= " WHERE t.active = ".$active;
|
$sql.= " WHERE t.active = ".$active;
|
||||||
// Add sql filters
|
// Add sql filters
|
||||||
|
|||||||
@ -55,6 +55,12 @@ require_once DOL_DOCUMENT_ROOT.'/api/class/api_access.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
|
||||||
|
$url = $_SERVER['PHP_SELF'];
|
||||||
|
// Fix for some NGINX setups (this should not be required even with NGINX, however setup of NGINX are often mysterious and this may help is such cases)
|
||||||
|
if (! empty($conf->global->MAIN_NGINX_FIX))
|
||||||
|
{
|
||||||
|
$url = (isset($_SERVER['SCRIPT_URI']) && $_SERVER["SCRIPT_URI"] !== null) ? $_SERVER["SCRIPT_URI"] : $_SERVER['PHP_SELF'];
|
||||||
|
}
|
||||||
|
|
||||||
// Enable and test if module Api is enabled
|
// Enable and test if module Api is enabled
|
||||||
if (empty($conf->global->MAIN_MODULE_API))
|
if (empty($conf->global->MAIN_MODULE_API))
|
||||||
@ -67,7 +73,7 @@ if (empty($conf->global->MAIN_MODULE_API))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test if explorer is not disabled
|
// Test if explorer is not disabled
|
||||||
if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($conf->global->API_EXPLORER_DISABLED))
|
if (preg_match('/api\/index\.php\/explorer/', $url) && ! empty($conf->global->API_EXPLORER_DISABLED))
|
||||||
{
|
{
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||||
@ -91,7 +97,7 @@ if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($
|
|||||||
|
|
||||||
|
|
||||||
$reg=array();
|
$reg=array();
|
||||||
preg_match('/index\.php\/([^\/]+)(.*)$/', $_SERVER["PHP_SELF"], $reg);
|
preg_match('/index\.php\/([^\/]+)(.*)$/', $url, $reg);
|
||||||
// .../index.php/categories?sortfield=t.rowid&sortorder=ASC
|
// .../index.php/categories?sortfield=t.rowid&sortorder=ASC
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -60,8 +60,8 @@ foreach($object->fields as $key => $val)
|
|||||||
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->socid > 0) access_forbidden();
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'asset', $id);
|
//$result = restrictedArea($user, 'asset', $id);
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
|
|||||||
@ -128,7 +128,13 @@ class Asset extends CommonObject
|
|||||||
|
|
||||||
public $note_public;
|
public $note_public;
|
||||||
public $note_private;
|
public $note_private;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer|string date_creation
|
||||||
|
*/
|
||||||
public $date_creation;
|
public $date_creation;
|
||||||
|
|
||||||
|
|
||||||
public $tms;
|
public $tms;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -40,8 +40,8 @@ $id=(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->socid > 0) access_forbidden();
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'asset', $id);
|
//$result = restrictedArea($user, 'asset', $id);
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
|
|||||||
@ -34,7 +34,7 @@ $ref=GETPOST('ref', 'alpha');
|
|||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
$result = restrictedArea($user, 'asset', $id, '');
|
$result = restrictedArea($user, 'asset', $id, '');
|
||||||
|
|
||||||
$object = new Asset($db);
|
$object = new Asset($db);
|
||||||
|
|||||||
@ -72,9 +72,9 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
|
|
||||||
// Protection if external user
|
// Protection if external user
|
||||||
$socid=0;
|
$socid=0;
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
//$socid = $user->societe_id;
|
//$socid = $user->socid;
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
//$result = restrictedArea($user, 'asset', $id,'');
|
//$result = restrictedArea($user, 'asset', $id,'');
|
||||||
|
|||||||
@ -46,8 +46,8 @@ $hookmanager->initHooks(array('assetnote')); // Note that conf->hooks_module
|
|||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->socid > 0) access_forbidden();
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'asset', $id);
|
//$result = restrictedArea($user, 'asset', $id);
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
|
|||||||
@ -615,7 +615,7 @@ if ($rowid > 0)
|
|||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print '<br><br><table class="border" width="100%">';
|
print '<br><br><table class="border" width="100%">';
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attributes[$object->element]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
if (isset($_POST["options_" . $key])) {
|
if (isset($_POST["options_" . $key])) {
|
||||||
if (is_array($_POST["options_" . $key])) {
|
if (is_array($_POST["options_" . $key])) {
|
||||||
|
|||||||
@ -100,7 +100,12 @@ class BlockedLog
|
|||||||
*/
|
*/
|
||||||
public $fk_user = 0;
|
public $fk_user = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer|string date_creation
|
||||||
|
*/
|
||||||
public $date_creation;
|
public $date_creation;
|
||||||
|
|
||||||
|
|
||||||
public $date_modification;
|
public $date_modification;
|
||||||
|
|
||||||
public $date_object = 0;
|
public $date_object = 0;
|
||||||
|
|||||||
@ -53,8 +53,8 @@ else
|
|||||||
$search_agenda_label=GETPOST('search_agenda_label');
|
$search_agenda_label=GETPOST('search_agenda_label');
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->socid > 0) access_forbidden();
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'bom', $id);
|
//$result = restrictedArea($user, 'bom', $id);
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
|
|||||||
@ -70,8 +70,8 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->socid > 0) access_forbidden();
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->statut == BillOfMaterials::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->statut == BillOfMaterials::STATUS_DRAFT) ? 1 : 0);
|
||||||
//$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
//$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
@ -127,6 +127,8 @@ if (empty($reshook))
|
|||||||
// Set if we used free entry or predefined product
|
// Set if we used free entry or predefined product
|
||||||
$idprod = GETPOST('idprod', 'int');
|
$idprod = GETPOST('idprod', 'int');
|
||||||
$qty = GETPOST('qty', 'int');
|
$qty = GETPOST('qty', 'int');
|
||||||
|
$qty_frozen = GETPOST('qty_frozen', 'int');
|
||||||
|
$disable_stock_change = GETPOST('disable_stock_change', 'int');
|
||||||
$efficiency = GETPOST('efficiency', 'int');
|
$efficiency = GETPOST('efficiency', 'int');
|
||||||
|
|
||||||
if ($qty == '') {
|
if ($qty == '') {
|
||||||
@ -138,10 +140,14 @@ if (empty($reshook))
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$bomline = new BOMLine($db);
|
$bomline = new BOMLine($db);
|
||||||
$bomline->fk_bom = $id;
|
$bomline->fk_bom = $id;
|
||||||
$bomline->fk_product = $idprod;
|
$bomline->fk_product = $idprod;
|
||||||
$bomline->qty = $qty;
|
$bomline->qty = $qty;
|
||||||
|
$bomline->qty_frozen = $qty_frozen;
|
||||||
|
$bomline->disable_stock_change = $disable_stock_change;
|
||||||
$bomline->efficiency = $efficiency;
|
$bomline->efficiency = $efficiency;
|
||||||
|
|
||||||
$result = $bomline->create($user);
|
$result = $bomline->create($user);
|
||||||
@ -150,6 +156,12 @@ if (empty($reshook))
|
|||||||
setEventMessages($bomline->error, $bomline->errors, 'errors');
|
setEventMessages($bomline->error, $bomline->errors, 'errors');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unset($_POST['qty_frozen']);
|
||||||
|
unset($_POST['disable_stock_change']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add line
|
// Add line
|
||||||
@ -160,6 +172,8 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Set if we used free entry or predefined product
|
// Set if we used free entry or predefined product
|
||||||
$qty=GETPOST('qty', 'int');
|
$qty=GETPOST('qty', 'int');
|
||||||
|
$qty_frozen = GETPOST('qty_frozen', 'int');
|
||||||
|
$disable_stock_change = GETPOST('disable_stock_change', 'int');
|
||||||
$efficiency=GETPOST('efficiency', 'int');
|
$efficiency=GETPOST('efficiency', 'int');
|
||||||
|
|
||||||
if ($qty == '') {
|
if ($qty == '') {
|
||||||
@ -170,6 +184,8 @@ if (empty($reshook))
|
|||||||
$bomline = new BOMLine($db);
|
$bomline = new BOMLine($db);
|
||||||
$bomline->fetch($lineid);
|
$bomline->fetch($lineid);
|
||||||
$bomline->qty = $qty;
|
$bomline->qty = $qty;
|
||||||
|
$bomline->qty_frozen = $qty_frozen;
|
||||||
|
$bomline->disable_stock_change = $disable_stock_change;
|
||||||
$bomline->efficiency = $efficiency;
|
$bomline->efficiency = $efficiency;
|
||||||
|
|
||||||
$result = $bomline->update($user);
|
$result = $bomline->update($user);
|
||||||
@ -178,6 +194,11 @@ if (empty($reshook))
|
|||||||
setEventMessages($bomline->error, $bomline->errors, 'errors');
|
setEventMessages($bomline->error, $bomline->errors, 'errors');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unset($_POST['qty_frozen']);
|
||||||
|
unset($_POST['disable_stock_change']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,12 +315,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
||||||
}
|
}
|
||||||
$formconfirm = '';
|
|
||||||
|
|
||||||
// Confirmation to delete
|
|
||||||
if ($action == 'delete') {
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Confirmation of validation
|
// Confirmation of validation
|
||||||
if ($action == 'validate')
|
if ($action == 'validate')
|
||||||
@ -647,14 +662,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
// Documents
|
// Documents
|
||||||
/*$objref = dol_sanitizeFileName($object->ref);
|
$objref = dol_sanitizeFileName($object->ref);
|
||||||
$relativepath = $comref . '/' . $comref . '.pdf';
|
$relativepath = $objref . '/' . $objref . '.pdf';
|
||||||
$filedir = $conf->bom->dir_output . '/' . $objref;
|
$filedir = $conf->bom->dir_output . '/' . $objref;
|
||||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||||
$genallowed = $user->rights->bom->read; // If you can read, you can build the PDF to read content
|
$genallowed = $user->rights->bom->read; // If you can read, you can build the PDF to read content
|
||||||
$delallowed = $user->rights->bom->create; // If you can create/edit, you can remove a file on card
|
$delallowed = $user->rights->bom->write; // If you can create/edit, you can remove a file on card
|
||||||
print $formfile->showdocuments('bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
print $formfile->showdocuments('bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $mysoc->default_lang);
|
||||||
*/
|
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('bom'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('bom'));
|
||||||
@ -678,17 +692,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Select mail models is same action as presend
|
//Select mail models is same action as presend
|
||||||
/*
|
|
||||||
if (GETPOST('modelselected')) $action = 'presend';
|
if (GETPOST('modelselected')) $action = 'presend';
|
||||||
|
|
||||||
// Presend form
|
// Presend form
|
||||||
$modelmail='inventory';
|
$modelmail='bom';
|
||||||
$defaulttopic='InformationMessage';
|
$defaulttopic='InformationMessage';
|
||||||
$diroutput = $conf->product->dir_output.'/inventory';
|
$diroutput = $conf->bom->dir_output;
|
||||||
$trackid = 'stockinv'.$object->id;
|
$trackid = 'bom'.$object->id;
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -41,8 +41,8 @@ $id=(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->socid > 0) access_forbidden();
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'bom', $id);
|
//$result = restrictedArea($user, 'bom', $id);
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
|
|||||||
@ -73,9 +73,9 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=0;
|
$socid=0;
|
||||||
if ($user->societe_id > 0) // Protection if external user
|
if ($user->socid > 0) // Protection if external user
|
||||||
{
|
{
|
||||||
//$socid = $user->societe_id;
|
//$socid = $user->socid;
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
//$result = restrictedArea($user, 'bom', $id, '');
|
//$result = restrictedArea($user, 'bom', $id, '');
|
||||||
|
|||||||
@ -47,8 +47,8 @@ $hookmanager->initHooks(array('bomnote','globalcard')); // Note that conf->h
|
|||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
//if ($user->socid > 0) access_forbidden();
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'bom', $id);
|
//$result = restrictedArea($user, 'bom', $id);
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
|
|||||||
@ -281,12 +281,53 @@ class Boms extends DolibarrApi
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
/*unset($object->note);
|
unset($object->rowid);
|
||||||
unset($object->address);
|
unset($object->canvas);
|
||||||
|
|
||||||
|
unset($object->name);
|
||||||
|
unset($object->lastname);
|
||||||
|
unset($object->firstname);
|
||||||
|
unset($object->civility_id);
|
||||||
|
unset($object->statut);
|
||||||
|
unset($object->state);
|
||||||
|
unset($object->state_id);
|
||||||
|
unset($object->state_code);
|
||||||
|
unset($object->region);
|
||||||
|
unset($object->region_code);
|
||||||
|
unset($object->country);
|
||||||
|
unset($object->country_id);
|
||||||
|
unset($object->country_code);
|
||||||
unset($object->barcode_type);
|
unset($object->barcode_type);
|
||||||
unset($object->barcode_type_code);
|
unset($object->barcode_type_code);
|
||||||
unset($object->barcode_type_label);
|
unset($object->barcode_type_label);
|
||||||
unset($object->barcode_type_coder);*/
|
unset($object->barcode_type_coder);
|
||||||
|
unset($object->total_ht);
|
||||||
|
unset($object->total_tva);
|
||||||
|
unset($object->total_localtax1);
|
||||||
|
unset($object->total_localtax2);
|
||||||
|
unset($object->total_ttc);
|
||||||
|
unset($object->fk_account);
|
||||||
|
unset($object->comments);
|
||||||
|
unset($object->note);
|
||||||
|
unset($object->mode_reglement_id);
|
||||||
|
unset($object->cond_reglement_id);
|
||||||
|
unset($object->cond_reglement);
|
||||||
|
unset($object->shipping_method_id);
|
||||||
|
unset($object->fk_incoterms);
|
||||||
|
unset($object->label_incoterms);
|
||||||
|
unset($object->location_incoterms);
|
||||||
|
|
||||||
|
// If object has lines, remove $db property
|
||||||
|
if (isset($object->lines) && is_array($object->lines) && count($object->lines) > 0) {
|
||||||
|
$nboflines = count($object->lines);
|
||||||
|
for ($i=0; $i < $nboflines; $i++)
|
||||||
|
{
|
||||||
|
$this->_cleanObjectDatas($object->lines[$i]);
|
||||||
|
|
||||||
|
unset($object->lines[$i]->lines);
|
||||||
|
unset($object->lines[$i]->note);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,13 @@ class BOM extends CommonObject
|
|||||||
public $description;
|
public $description;
|
||||||
public $note_public;
|
public $note_public;
|
||||||
public $note_private;
|
public $note_private;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer|string date_creation
|
||||||
|
*/
|
||||||
public $date_creation;
|
public $date_creation;
|
||||||
|
|
||||||
|
|
||||||
public $tms;
|
public $tms;
|
||||||
public $fk_user_creat;
|
public $fk_user_creat;
|
||||||
public $fk_user_modif;
|
public $fk_user_modif;
|
||||||
@ -240,9 +246,10 @@ class BOM extends CommonObject
|
|||||||
unset($object->import_key);
|
unset($object->import_key);
|
||||||
|
|
||||||
// Clear fields
|
// Clear fields
|
||||||
$object->ref = "copy_of_".$object->ref;
|
$object->ref = empty($this->fields['ref']['default']) ? $langs->trans("copy_of_").$object->ref: $this->fields['ref']['default'];
|
||||||
$object->title = $langs->trans("CopyOf")." ".$object->title;
|
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label: $this->fields['label']['default'];
|
||||||
|
$object->status = self::STATUS_DRAFT;
|
||||||
|
// ...
|
||||||
// Clear extrafields that are unique
|
// Clear extrafields that are unique
|
||||||
if (is_array($object->array_options) && count($object->array_options) > 0)
|
if (is_array($object->array_options) && count($object->array_options) > 0)
|
||||||
{
|
{
|
||||||
@ -808,43 +815,19 @@ class BOM extends CommonObject
|
|||||||
public function LibStatut($status, $mode = 0)
|
public function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (empty($this->labelstatus))
|
if (empty($this->labelStatus))
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
//$langs->load("mrp");
|
//$langs->load("mrp");
|
||||||
$this->labelstatus[self::STATUS_DRAFT] = $langs->trans('Draft');
|
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
|
||||||
$this->labelstatus[self::STATUS_VALIDATED] = $langs->trans('Enabled');
|
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled');
|
||||||
$this->labelstatus[self::STATUS_CANCELED] = $langs->trans('Disabled');
|
$this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 0)
|
$statusType = 'status'.$status;
|
||||||
{
|
if ($status == self::STATUS_VALIDATED) $statusType = 'status4';
|
||||||
return $this->labelstatus[$status];
|
|
||||||
}
|
return dolGetStatus($this->labelStatus[$status], $this->labelStatus[$status], '', $statusType, $mode);
|
||||||
elseif ($mode == 1)
|
|
||||||
{
|
|
||||||
return $this->labelstatus[$status];
|
|
||||||
}
|
|
||||||
elseif ($mode == 2)
|
|
||||||
{
|
|
||||||
return img_picto($this->labelstatus[$status], 'statut'.($status == self::STATUS_VALIDATED ? 4 : $status), '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
|
||||||
}
|
|
||||||
elseif ($mode == 3)
|
|
||||||
{
|
|
||||||
return img_picto($this->labelstatus[$status], 'statut'.($status == self::STATUS_VALIDATED ? 4 : $status), '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
}
|
|
||||||
elseif ($mode == 4)
|
|
||||||
{
|
|
||||||
return img_picto($this->labelstatus[$status], 'statut'.($status == self::STATUS_VALIDATED ? 4 : $status), '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
|
||||||
}
|
|
||||||
elseif ($mode == 5)
|
|
||||||
{
|
|
||||||
return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut'.($status == self::STATUS_VALIDATED ? 4 : $status), '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
}
|
|
||||||
elseif ($mode == 6)
|
|
||||||
{
|
|
||||||
return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut'.($status == self::STATUS_VALIDATED ? 4 : $status), '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1059,11 +1042,13 @@ class BOMLine extends CommonObject
|
|||||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||||
*/
|
*/
|
||||||
public $fields=array(
|
public $fields=array(
|
||||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
|
'rowid' => array('type'=>'integer', 'label'=>'LineID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
|
||||||
'fk_bom' => array('type'=>'integer:BillOfMaterials:societe/class/bom.class.php', 'label'=>'BillOfMaterials', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1,),
|
'fk_bom' => array('type'=>'integer:BillOfMaterials:societe/class/bom.class.php', 'label'=>'BillOfMaterials', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1,),
|
||||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
|
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
|
||||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
||||||
'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',),
|
'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',),
|
||||||
|
'qty_frozen' => array('type'=>'smallint', 'label'=>'QuantityFrozen', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>105, 'css'=>'maxwidth50imp', 'help'=>'QuantityConsumedInvariable'),
|
||||||
|
'disable_stock_change' => array('type'=>'smallint', 'label'=>'DisableStockChange', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>108, 'css'=>'maxwidth50imp', 'help'=>'DisableStockChangeHelp'),
|
||||||
'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'),
|
'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'),
|
||||||
'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,),
|
'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,),
|
||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||||
@ -1073,6 +1058,8 @@ class BOMLine extends CommonObject
|
|||||||
public $fk_product;
|
public $fk_product;
|
||||||
public $description;
|
public $description;
|
||||||
public $qty;
|
public $qty;
|
||||||
|
public $qty_frozen;
|
||||||
|
public $disable_stock_change;
|
||||||
public $efficiency;
|
public $efficiency;
|
||||||
public $position;
|
public $position;
|
||||||
public $import_key;
|
public $import_key;
|
||||||
@ -1339,47 +1326,7 @@ class BOMLine extends CommonObject
|
|||||||
public function LibStatut($status, $mode = 0)
|
public function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (empty($this->labelstatus))
|
return '';
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
//$langs->load("mrp");
|
|
||||||
$this->labelstatus[1] = $langs->trans('Enabled');
|
|
||||||
$this->labelstatus[0] = $langs->trans('Disabled');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($mode == 0)
|
|
||||||
{
|
|
||||||
return $this->labelstatus[$status];
|
|
||||||
}
|
|
||||||
elseif ($mode == 1)
|
|
||||||
{
|
|
||||||
return $this->labelstatus[$status];
|
|
||||||
}
|
|
||||||
elseif ($mode == 2)
|
|
||||||
{
|
|
||||||
if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
|
||||||
elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
|
||||||
}
|
|
||||||
elseif ($mode == 3)
|
|
||||||
{
|
|
||||||
if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
}
|
|
||||||
elseif ($mode == 4)
|
|
||||||
{
|
|
||||||
if ($status == 1) return img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
|
||||||
elseif ($status == 0) return img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status];
|
|
||||||
}
|
|
||||||
elseif ($mode == 5)
|
|
||||||
{
|
|
||||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
}
|
|
||||||
elseif ($mode == 6)
|
|
||||||
{
|
|
||||||
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -68,6 +68,8 @@ if ($nolinesbefore) {
|
|||||||
print $langs->trans('Unit');
|
print $langs->trans('Unit');
|
||||||
print '</span></td>';
|
print '</span></td>';
|
||||||
}
|
}
|
||||||
|
print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>';
|
||||||
|
print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>';
|
||||||
print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>';
|
print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>';
|
||||||
print '<td class="linecoledit" colspan="'.$colspan.'"> </td>';
|
print '<td class="linecoledit" colspan="'.$colspan.'"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -109,6 +111,7 @@ if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
|||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
print '<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1).'">';
|
print '<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
{
|
{
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
@ -118,7 +121,14 @@ if($conf->global->PRODUCT_USE_UNITS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
|
print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOST("qty_frozen", 'alpha')?' checked="checked"':'').'>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
$coldisplay++;
|
||||||
|
print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOST("disable_stock_change", 'alpha')?' checked="checked"':'').'">';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
$coldisplay++;
|
||||||
print '<td class="nobottom nowrap linecollost right">';
|
print '<td class="nobottom nowrap linecollost right">';
|
||||||
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.(GETPOSTISSET("efficiency")?GETPOST("efficiency", 'alpha'):1).'">';
|
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.(GETPOSTISSET("efficiency")?GETPOST("efficiency", 'alpha'):1).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -116,6 +116,14 @@ if ($conf->global->PRODUCT_USE_UNITS)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$coldisplay++;
|
||||||
|
print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOSTISSET("qty_frozen")?(GETPOST('qty_frozen', 'int')?' checked="checked"':''):($line->qty_frozen?' checked="checked"':'')).'>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
$coldisplay++;
|
||||||
|
print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOSTISSET('disablestockchange')?(GETPOST("disable_stock_change", 'int')?' checked="checked"':''):($line->disable_stock_change?' checked="checked"':'')).'">';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
print '<td class="nobottom nowrap linecollost right">';
|
print '<td class="nobottom nowrap linecollost right">';
|
||||||
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>';
|
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>';
|
||||||
|
|||||||
@ -59,6 +59,13 @@ if ($conf->global->PRODUCT_USE_UNITS)
|
|||||||
print '<td class="linecoluseunit left">'.$langs->trans('Unit').'</td>';
|
print '<td class="linecoluseunit left">'.$langs->trans('Unit').'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Qty frozen
|
||||||
|
print '<td class="linecolqty right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>';
|
||||||
|
|
||||||
|
// Disable stock change
|
||||||
|
print '<td class="linecolqty right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>';
|
||||||
|
|
||||||
|
// Efficiency
|
||||||
print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>';
|
print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>';
|
||||||
|
|
||||||
print '<td class="linecoledit"></td>'; // No width to allow autodim
|
print '<td class="linecoledit"></td>'; // No width to allow autodim
|
||||||
|
|||||||
@ -87,6 +87,16 @@ if($conf->global->PRODUCT_USE_UNITS)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<td class="linecolqtyfrozen nowrap right">';
|
||||||
|
$coldisplay++;
|
||||||
|
echo $line->qty_frozen ? yn($line->qty_frozen) : '';
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="linecoldisablestockchange nowrap right">';
|
||||||
|
$coldisplay++;
|
||||||
|
echo $line->disable_stock_change ? yn($line->disable_stock_change) : ''; // Yes, it is a quantity, not a price, but we just want the formating role of function price
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="linecolqty nowrap right">';
|
print '<td class="linecolqty nowrap right">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
echo $line->efficiency;
|
echo $line->efficiency;
|
||||||
|
|||||||
@ -66,10 +66,11 @@ function printBookmarksList()
|
|||||||
|
|
||||||
$ret.= '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
$ret.= '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||||
$ret.= '<form id="actionbookmark" name="actionbookmark" method="POST" action="">';
|
$ret.= '<form id="actionbookmark" name="actionbookmark" method="POST" action="">';
|
||||||
|
$ret.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$ret.= '<select name="bookmark" id="boxbookmark" class="flat boxcombo vmenusearchselectcombo" alt="Bookmarks">';
|
$ret.= '<select name="bookmark" id="boxbookmark" class="flat boxcombo vmenusearchselectcombo" alt="Bookmarks">';
|
||||||
$ret.= '<option hidden value="listbookmarks" class="optiongrey" selected rel="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</option>';
|
$ret.= '<option hidden value="listbookmarks" class="optiongrey" selected rel="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</option>';
|
||||||
$ret.= '<option value="listbookmark" class="optionblue" rel="'.dol_escape_htmltag(DOL_URL_ROOT.'/bookmarks/list.php').'" ';
|
$ret.= '<option value="listbookmark" class="optionblue" rel="'.dol_escape_htmltag(DOL_URL_ROOT.'/bookmarks/list.php').'" ';
|
||||||
$ret.= ' data-html="'.dol_escape_htmltag('<span class="fa fa-star-o"></span> '.dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">';
|
$ret.= ' data-html="'.dol_escape_htmltag('<span class="fas fa-star"></span> '.dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">';
|
||||||
$ret.= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>';
|
$ret.= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>';
|
||||||
// Url to go on create new bookmark page
|
// Url to go on create new bookmark page
|
||||||
if (! empty($user->rights->bookmark->creer))
|
if (! empty($user->rights->bookmark->creer))
|
||||||
@ -77,7 +78,7 @@ function printBookmarksList()
|
|||||||
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||||
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||||
$ret.= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
|
$ret.= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
|
||||||
$ret.= ' data-html="'.dol_escape_htmltag('<span class="fa fa-star-o"></span> '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
|
$ret.= ' data-html="'.dol_escape_htmltag('<span class="fas fa-star"></span> '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
|
||||||
}
|
}
|
||||||
// Menu with all bookmarks
|
// Menu with all bookmarks
|
||||||
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
||||||
@ -200,7 +201,7 @@ function printDropdownBookmarksList()
|
|||||||
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||||
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||||
$newbtn.= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
|
$newbtn.= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
|
||||||
$newbtn.= '<span class="fa fa-star-o"></span> '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
|
$newbtn.= '<span class="fas fa-star"></span> '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -68,15 +68,18 @@ $langs->loadLangs(array("main","bills","cashdesk"));
|
|||||||
|
|
||||||
for ($i = 0; $i < $nbtoshow; $i++)
|
for ($i = 0; $i < $nbtoshow; $i++)
|
||||||
{
|
{
|
||||||
if ( $id == $tab_designations[$i]['rowid'] )
|
if ($id == $tab_designations[$i]['rowid']) {
|
||||||
$selected = 'selected';
|
$selected = 'selected';
|
||||||
else
|
} else {
|
||||||
$selected = '';
|
$selected = '';
|
||||||
|
}
|
||||||
|
|
||||||
$label = $tab_designations[$i]['label'];
|
$label = $tab_designations[$i]['label'];
|
||||||
|
|
||||||
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'], 16).' - '.dol_trunc($label, 35, 'middle');
|
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'], 16).' - '.dol_trunc($label, 35, 'middle');
|
||||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
|
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) {
|
||||||
|
print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
|
||||||
|
}
|
||||||
print '</option>'."\n";
|
print '</option>'."\n";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -779,9 +779,9 @@ class Categorie extends CommonObject
|
|||||||
$sql .= " AND c.fk_categorie = ".$this->id;
|
$sql .= " AND c.fk_categorie = ".$this->id;
|
||||||
$sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid";
|
$sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid";
|
||||||
// Protection for external users
|
// Protection for external users
|
||||||
if (($type == 'customer' || $type == 'supplier') && $user->societe_id > 0)
|
if (($type == 'customer' || $type == 'supplier') && $user->socid > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND o.rowid = ".$user->societe_id;
|
$sql.= " AND o.rowid = ".$user->socid;
|
||||||
}
|
}
|
||||||
if ($limit > 0 || $offset > 0) $sql .= $this->db->plimit($limit + 1, $offset);
|
if ($limit > 0 || $offset > 0) $sql .= $this->db->plimit($limit + 1, $offset);
|
||||||
$sql .= $this->db->order($sortfield, $sortorder);
|
$sql .= $this->db->order($sortfield, $sortorder);
|
||||||
@ -1018,11 +1018,11 @@ class Categorie extends CommonObject
|
|||||||
* fulllabel = nom avec chemin complet de la categorie
|
* fulllabel = nom avec chemin complet de la categorie
|
||||||
* fullpath = chemin complet compose des id
|
* fullpath = chemin complet compose des id
|
||||||
*
|
*
|
||||||
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...).
|
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member', ...)
|
||||||
* @param int|string|array $markafterid Keep only or removed all categories including the leaf $markafterid in category tree (exclude) or Keep only of category is inside the leaf starting with this id.
|
* @param int|string|array $markafterid Keep only or removed all categories including the leaf $markafterid in category tree (exclude) or Keep only of category is inside the leaf starting with this id.
|
||||||
* $markafterid can be an :
|
* $markafterid can be an :
|
||||||
* - int (id of category)
|
* - int (id of category)
|
||||||
* - string (categories ids seprated by comma)
|
* - string (categories ids separated by comma)
|
||||||
* - array (list of categories ids)
|
* - array (list of categories ids)
|
||||||
* @param int $include [=0] Removed or 1=Keep only
|
* @param int $include [=0] Removed or 1=Keep only
|
||||||
* @return array|int Array of categories. this->cats and this->motherof are set, -1 on error
|
* @return array|int Array of categories. this->cats and this->motherof are set, -1 on error
|
||||||
|
|||||||
@ -136,7 +136,7 @@ if ($object->id)
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
dol_banner_tab($object, 'ref', $linkback, ($user->socid?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression de photo
|
* Confirmation de la suppression de photo
|
||||||
|
|||||||
@ -207,7 +207,7 @@ foreach ($ways as $way)
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
dol_banner_tab($object, 'ref', $linkback, ($user->socid?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -226,7 +226,7 @@ foreach ($ways as $way)
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'label', $linkback, ($user->societe_id?0:1), 'label', 'label', $morehtmlref, '', 0, '', '', 1);
|
dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '', 0, '', '', 1);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -69,9 +69,9 @@ $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fullda
|
|||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
|
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
|
||||||
if ($user->societe_id && $socid) $result = restrictedArea($user, 'societe', $socid);
|
if ($user->socid && $socid) $result = restrictedArea($user, 'societe', $socid);
|
||||||
|
|
||||||
$error=GETPOST("error");
|
$error=GETPOST("error");
|
||||||
$donotclearsession=GETPOST('donotclearsession')?GETPOST('donotclearsession'):0;
|
$donotclearsession=GETPOST('donotclearsession')?GETPOST('donotclearsession'):0;
|
||||||
@ -861,11 +861,11 @@ if ($action == 'create')
|
|||||||
if (GETPOST('datep', 'int', 1)) $datep=dol_stringtotime(GETPOST('datep', 'int', 1), 0);
|
if (GETPOST('datep', 'int', 1)) $datep=dol_stringtotime(GETPOST('datep', 'int', 1), 0);
|
||||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>';
|
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>';
|
||||||
if (GETPOST("afaire") == 1) {
|
if (GETPOST("afaire") == 1) {
|
||||||
print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldayend');
|
print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldayend');
|
||||||
} elseif (GETPOST("afaire") == 2) {
|
} elseif (GETPOST("afaire") == 2) {
|
||||||
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldayend');
|
||||||
} else {
|
} else {
|
||||||
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
|
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart');
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1024,8 +1024,8 @@ if ($action == 'create')
|
|||||||
$events=array();
|
$events=array();
|
||||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||||
//For external user force the company to user company
|
//For external user force the company to user company
|
||||||
if (!empty($user->societe_id)) {
|
if (!empty($user->socid)) {
|
||||||
print $form->select_company($user->societe_id, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300');
|
print $form->select_company($user->socid, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300');
|
||||||
} else {
|
} else {
|
||||||
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300');
|
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300');
|
||||||
}
|
}
|
||||||
@ -1582,8 +1582,9 @@ if ($id > 0)
|
|||||||
if ($user->rights->agenda->allactions->create ||
|
if ($user->rights->agenda->allactions->create ||
|
||||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify') {
|
||||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
}
|
||||||
if ($action == 'classify') {
|
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->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.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
@ -1611,7 +1612,7 @@ if ($id > 0)
|
|||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'id', $linkback, ($user->socid?0:1), 'id', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -45,43 +45,67 @@ class ActionComm extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $table_element = 'actioncomm';
|
public $table_element = 'actioncomm';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Name of id column
|
||||||
|
*/
|
||||||
public $table_rowid = 'id';
|
public $table_rowid = 'id';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
* @var string Name of icon for actioncomm object. Filename of icon is object_action.png
|
||||||
*/
|
*/
|
||||||
public $picto = 'action';
|
public $picto = 'action';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
* @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
* @var int
|
|
||||||
*/
|
*/
|
||||||
public $ismultientitymanaged = 1;
|
public $ismultientitymanaged = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty
|
* @var integer 0=Default
|
||||||
* @var integer
|
* 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
|
||||||
|
* 2=Same than 1 but accept record if fksoc is empty
|
||||||
*/
|
*/
|
||||||
public $restrictiononfksoc = 2;
|
public $restrictiononfksoc = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id of the event
|
* @var int Id of the event
|
||||||
* @var int
|
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id of the event. Use $id as possible
|
* @var int Id of the event. Use $id as possible
|
||||||
* @var int
|
|
||||||
*/
|
*/
|
||||||
public $ref;
|
public $ref;
|
||||||
|
|
||||||
public $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set)
|
/**
|
||||||
public $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
|
* @var int Id into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||||
|
*/
|
||||||
|
public $type_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
|
||||||
|
*/
|
||||||
|
public $type_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Type label
|
||||||
|
*/
|
||||||
public $type_label;
|
public $type_label;
|
||||||
public $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
|
|
||||||
public $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set)
|
/**
|
||||||
public $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
|
* @var string Label into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||||
|
*/
|
||||||
|
public $type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Color into parent table llx_c_actioncomm (used only if option to use type is set)
|
||||||
|
*/
|
||||||
|
public $type_color;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
|
||||||
|
*/
|
||||||
|
public $code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Agenda event label
|
* @var string Agenda event label
|
||||||
@ -89,72 +113,56 @@ class ActionComm extends CommonObject
|
|||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date creation record (datec)
|
* @var integer Date creation record (datec)
|
||||||
*
|
|
||||||
* @var integer
|
|
||||||
*/
|
*/
|
||||||
public $datec;
|
public $datec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date end record (datef)
|
* @var integer Date end record (datef)
|
||||||
*
|
|
||||||
* @var integer
|
|
||||||
*/
|
*/
|
||||||
public $datef;
|
public $datef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duration (duree)
|
* @var integer Duration (duree)
|
||||||
*
|
|
||||||
* @var integer
|
|
||||||
*/
|
*/
|
||||||
public $duree;
|
public $duree;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date modification record (tms)
|
* @var integer Date modification record (tms)
|
||||||
*
|
|
||||||
* @var integer
|
|
||||||
*/
|
*/
|
||||||
public $datem;
|
public $datem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object user that create action
|
* @var User Object user that create action
|
||||||
* @var User
|
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @see $authorid
|
* @see $authorid
|
||||||
*/
|
*/
|
||||||
public $author;
|
public $author;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object user that modified action
|
* @var User Object user that modified action
|
||||||
* @var User
|
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @see $usermodid
|
* @see $usermodid
|
||||||
*/
|
*/
|
||||||
public $usermod;
|
public $usermod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id user that create action
|
* @var int Id user that create action
|
||||||
* @var int
|
|
||||||
*/
|
*/
|
||||||
public $authorid;
|
public $authorid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id user that modified action
|
* @var int Id user that modified action
|
||||||
* @var int
|
|
||||||
*/
|
*/
|
||||||
public $usermodid;
|
public $usermodid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date action start (datep)
|
* @var integer Date action start (datep)
|
||||||
*
|
|
||||||
* @var integer
|
|
||||||
*/
|
*/
|
||||||
public $datep;
|
public $datep;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date action end (datep2)
|
* @var integer Date action end (datep2)
|
||||||
*
|
|
||||||
* @var integer
|
|
||||||
*/
|
*/
|
||||||
public $datep2;
|
public $datep2;
|
||||||
|
|
||||||
@ -163,83 +171,171 @@ class ActionComm extends CommonObject
|
|||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $durationp = -1;
|
public $durationp = -1;
|
||||||
public $fulldayevent = 0; // 1=Event on full day
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Milestone
|
* @var int 1=Event on full day
|
||||||
* @var int
|
*/
|
||||||
|
public $fulldayevent = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Milestone
|
||||||
* @deprecated Milestone is already event with end date = start date
|
* @deprecated Milestone is already event with end date = start date
|
||||||
*/
|
*/
|
||||||
public $punctual = 1;
|
public $punctual = 1;
|
||||||
public $percentage; // Percentage
|
|
||||||
public $location; // Location
|
|
||||||
|
|
||||||
public $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events)
|
/**
|
||||||
public $priority; // Small int (0 By default)
|
* @var integer Percentage
|
||||||
|
*/
|
||||||
|
public $percentage;
|
||||||
|
|
||||||
public $userassigned = array(); // Array of user ids
|
/**
|
||||||
public $userownerid; // Id of user owner = fk_user_action into table
|
* @var string Location
|
||||||
public $userdoneid; // Id of user done (deprecated)
|
*/
|
||||||
|
public $location;
|
||||||
|
|
||||||
public $socpeopleassigned = array(); // Array of contact ids
|
/**
|
||||||
|
* @var int Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events)
|
||||||
|
*/
|
||||||
|
public $transparency;
|
||||||
|
|
||||||
public $otherassigned = array(); // Array of other contact emails (not user, not contact)
|
/**
|
||||||
|
* @var int (0 By default)
|
||||||
|
*/
|
||||||
|
public $priority;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int[] Array of user ids
|
||||||
|
*/
|
||||||
|
public $userassigned = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Id of user owner = fk_user_action into table
|
||||||
|
*/
|
||||||
|
public $userownerid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Id of user done (deprecated)
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public $userdoneid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int[] Array of contact ids
|
||||||
|
*/
|
||||||
|
public $socpeopleassigned = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int[] Array of other contact emails (not user, not contact)
|
||||||
|
*/
|
||||||
|
public $otherassigned = array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object user of owner
|
* @var User Object user of owner
|
||||||
* @var User
|
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @see userownerid
|
* @see userownerid
|
||||||
*/
|
*/
|
||||||
public $usertodo;
|
public $usertodo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object user that did action
|
* @var User Object user that did action
|
||||||
* @var User
|
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @see userdoneid
|
* @see userdoneid
|
||||||
*/
|
*/
|
||||||
public $userdone;
|
public $userdone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int thirdparty id linked to action
|
||||||
|
*/
|
||||||
public $socid;
|
public $socid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int socpeople id linked to action
|
||||||
|
*/
|
||||||
public $contactid;
|
public $contactid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Company linked to action (optional)
|
* @var Societe|null Company linked to action (optional)
|
||||||
* @var Societe|null
|
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @see socid
|
* @see socid
|
||||||
*/
|
*/
|
||||||
public $societe;
|
public $societe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contact linked to action (optional)
|
* @var Contact|null Contact linked to action (optional)
|
||||||
* @var Contact|null
|
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @see contactid
|
* @see contactid
|
||||||
*/
|
*/
|
||||||
public $contact;
|
public $contact;
|
||||||
|
|
||||||
// Properties for links to other objects
|
// Properties for links to other objects
|
||||||
|
/**
|
||||||
|
* @var int Id of linked object
|
||||||
|
*/
|
||||||
public $fk_element; // Id of record
|
public $fk_element; // Id of record
|
||||||
public $elementid; // Id of record alternative for API
|
|
||||||
public $elementtype; // Type of record. This if property ->element of object linked to.
|
|
||||||
|
|
||||||
// Ical
|
/**
|
||||||
|
* @var int Id of record alternative for API
|
||||||
|
*/
|
||||||
|
public $elementid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Type of record. This if property ->element of object linked to.
|
||||||
|
*/
|
||||||
|
public $elementtype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Ical name
|
||||||
|
*/
|
||||||
public $icalname;
|
public $icalname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Ical color
|
||||||
|
*/
|
||||||
public $icalcolor;
|
public $icalcolor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array Actions
|
||||||
|
*/
|
||||||
public $actions=array();
|
public $actions=array();
|
||||||
|
|
||||||
// Fields for emails
|
/**
|
||||||
|
* @var string Email msgid
|
||||||
|
*/
|
||||||
public $email_msgid;
|
public $email_msgid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Email from
|
||||||
|
*/
|
||||||
public $email_from;
|
public $email_from;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Email sender
|
||||||
|
*/
|
||||||
public $email_sender;
|
public $email_sender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Email to
|
||||||
|
*/
|
||||||
public $email_to;
|
public $email_to;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Email tocc
|
||||||
|
*/
|
||||||
public $email_tocc;
|
public $email_tocc;
|
||||||
|
/**
|
||||||
|
* @var string Email tobcc
|
||||||
|
*/
|
||||||
public $email_tobcc;
|
public $email_tobcc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Email subject
|
||||||
|
*/
|
||||||
public $email_subject;
|
public $email_subject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Email errors to
|
||||||
|
*/
|
||||||
public $errors_to;
|
public $errors_to;
|
||||||
|
|
||||||
|
|
||||||
@ -1067,13 +1163,13 @@ class ActionComm extends CommonObject
|
|||||||
$sql = "SELECT count(a.id) as nb";
|
$sql = "SELECT count(a.id) as nb";
|
||||||
}
|
}
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
if (! $user->rights->societe->client->voir && ! $user->socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||||
$sql.= " WHERE 1 = 1";
|
$sql.= " WHERE 1 = 1";
|
||||||
if(empty($load_state_board)) $sql.= " AND a.percent >= 0 AND a.percent < 100";
|
if(empty($load_state_board)) $sql.= " AND a.percent >= 0 AND a.percent < 100";
|
||||||
$sql.= " AND a.entity IN (".getEntity('agenda').")";
|
$sql.= " AND a.entity IN (".getEntity('agenda').")";
|
||||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
if (! $user->rights->societe->client->voir && ! $user->socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
||||||
if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
|
if ($user->socid) $sql.=" AND a.fk_soc = ".$user->socid;
|
||||||
if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
|
if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@ -1344,7 +1440,6 @@ class ActionComm extends CommonObject
|
|||||||
$linkstart = '';
|
$linkstart = '';
|
||||||
$linkend = '';
|
$linkend = '';
|
||||||
}
|
}
|
||||||
//print 'rrr'.$this->libelle.'rrr'.$this->label.'rrr'.$withpicto;
|
|
||||||
|
|
||||||
if ($withpicto == 2)
|
if ($withpicto == 2)
|
||||||
{
|
{
|
||||||
@ -1463,7 +1558,7 @@ class ActionComm extends CommonObject
|
|||||||
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
|
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
|
||||||
$sql.= " u.firstname, u.lastname, u.email,";
|
$sql.= " u.firstname, u.lastname, u.email,";
|
||||||
$sql.= " s.nom as socname,";
|
$sql.= " s.nom as socname,";
|
||||||
$sql.= " c.id as type_id, c.code as type_code, c.libelle";
|
$sql.= " c.id as type_id, c.code as type_code, c.libelle as type_label";
|
||||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
|
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
|
||||||
@ -1568,7 +1663,7 @@ class ActionComm extends CommonObject
|
|||||||
$event['location']=$obj->location;
|
$event['location']=$obj->location;
|
||||||
$event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy)
|
$event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy)
|
||||||
$event['punctual']=$obj->punctual;
|
$event['punctual']=$obj->punctual;
|
||||||
$event['category']=$obj->libelle; // libelle type action
|
$event['category']=$obj->type_label;
|
||||||
$event['email']=$obj->email;
|
$event['email']=$obj->email;
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||||
@ -1579,6 +1674,22 @@ class ActionComm extends CommonObject
|
|||||||
$event['created']=$this->db->jdate($obj->datec)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
|
$event['created']=$this->db->jdate($obj->datec)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
|
||||||
$event['modified']=$this->db->jdate($obj->datem)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
|
$event['modified']=$this->db->jdate($obj->datem)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600));
|
||||||
|
|
||||||
|
// TODO: find a way to call "$this->fetch_userassigned();" without override "$this" properties
|
||||||
|
$this->id = $obj->id;
|
||||||
|
$this->fetch_userassigned();
|
||||||
|
|
||||||
|
$assignedUserArray = array();
|
||||||
|
|
||||||
|
foreach($this->userassigned as $key => $value)
|
||||||
|
{
|
||||||
|
$assignedUser = new User($this->db);
|
||||||
|
$assignedUser->fetch($value['id']);
|
||||||
|
|
||||||
|
$assignedUserArray[$key]=$assignedUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
$event['assignedUsers']=$assignedUserArray;
|
||||||
|
|
||||||
if ($qualified && $datestart)
|
if ($qualified && $datestart)
|
||||||
{
|
{
|
||||||
$eventarray[]=$event;
|
$eventarray[]=$event;
|
||||||
|
|||||||
@ -338,6 +338,7 @@ class AgendaEvents extends DolibarrApi
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
unset($object->note); // alreaydy into note_private
|
||||||
unset($object->usermod);
|
unset($object->usermod);
|
||||||
unset($object->libelle);
|
unset($object->libelle);
|
||||||
unset($object->context);
|
unset($object->context);
|
||||||
@ -350,6 +351,11 @@ class AgendaEvents extends DolibarrApi
|
|||||||
unset($object->origin_id);
|
unset($object->origin_id);
|
||||||
unset($object->ref_ext);
|
unset($object->ref_ext);
|
||||||
unset($object->statut);
|
unset($object->statut);
|
||||||
|
unset($object->state_code);
|
||||||
|
unset($object->state_id);
|
||||||
|
unset($object->state);
|
||||||
|
unset($object->region);
|
||||||
|
unset($object->region_code);
|
||||||
unset($object->country);
|
unset($object->country);
|
||||||
unset($object->country_id);
|
unset($object->country_id);
|
||||||
unset($object->country_code);
|
unset($object->country_code);
|
||||||
@ -378,6 +384,9 @@ class AgendaEvents extends DolibarrApi
|
|||||||
unset($object->contact);
|
unset($object->contact);
|
||||||
unset($object->societe);
|
unset($object->societe);
|
||||||
|
|
||||||
|
unset($object->actions);
|
||||||
|
unset($object->lines);
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,8 +45,8 @@ $confirm = GETPOST('confirm', 'alpha');
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
unset($_GET["action"]);
|
unset($_GET["action"]);
|
||||||
$action='';
|
$action='';
|
||||||
@ -159,7 +159,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'id', $linkback, ($user->socid?0:1), 'id', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,7 @@ if (! $sortfield) $sortfield="a.datec";
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("search_socid", "int")?GETPOST("search_socid", "int"):GETPOST("socid", "int");
|
$socid = GETPOST("search_socid", "int")?GETPOST("search_socid", "int"):GETPOST("socid", "int");
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
||||||
if ($socid < 0) $socid='';
|
if ($socid < 0) $socid='';
|
||||||
|
|
||||||
@ -614,7 +614,7 @@ if ($resql)
|
|||||||
$event->type_label=$obj->type_label;
|
$event->type_label=$obj->type_label;
|
||||||
$event->type_color=$obj->type_color;
|
$event->type_color=$obj->type_color;
|
||||||
|
|
||||||
$event->libelle=$obj->label;
|
$event->libelle=$obj->label; // deprecated
|
||||||
$event->label=$obj->label;
|
$event->label=$obj->label;
|
||||||
$event->percentage=$obj->percent;
|
$event->percentage=$obj->percent;
|
||||||
$event->authorid=$obj->fk_user_author; // user id of creator
|
$event->authorid=$obj->fk_user_author; // user id of creator
|
||||||
@ -720,7 +720,7 @@ if ($showbirthday)
|
|||||||
$event->datep=dol_mktime(0, 0, 0, $datearray['mon'], $datearray['mday'], $year, true); // For full day events, date are also GMT but they wont but converted during output
|
$event->datep=dol_mktime(0, 0, 0, $datearray['mon'], $datearray['mday'], $year, true); // For full day events, date are also GMT but they wont but converted during output
|
||||||
$event->datef=$event->datep;
|
$event->datef=$event->datep;
|
||||||
$event->type_code='BIRTHDAY';
|
$event->type_code='BIRTHDAY';
|
||||||
$event->libelle=$langs->trans("Birthday").' '.dolGetFirstLastname($obj->firstname, $obj->lastname);
|
$event->label=$langs->trans("Birthday").' '.dolGetFirstLastname($obj->firstname, $obj->lastname);
|
||||||
$event->percentage=100;
|
$event->percentage=100;
|
||||||
$event->fulldayevent=1;
|
$event->fulldayevent=1;
|
||||||
|
|
||||||
@ -949,9 +949,9 @@ if (count($listofextcals))
|
|||||||
$event->datef=$dateend+$usertime;
|
$event->datef=$dateend+$usertime;
|
||||||
$event->type_code="ICALEVENT";
|
$event->type_code="ICALEVENT";
|
||||||
|
|
||||||
if($icalevent['SUMMARY']) $event->libelle=$icalevent['SUMMARY'];
|
if($icalevent['SUMMARY']) $event->label=$icalevent['SUMMARY'];
|
||||||
elseif($icalevent['DESCRIPTION']) $event->libelle=dol_nl2br($icalevent['DESCRIPTION'], 1);
|
elseif($icalevent['DESCRIPTION']) $event->label=dol_nl2br($icalevent['DESCRIPTION'], 1);
|
||||||
else $event->libelle = $langs->trans("ExtSiteNoLabel");
|
else $event->label = $langs->trans("ExtSiteNoLabel");
|
||||||
|
|
||||||
$event->date_start_in_calendar=$event->datep;
|
$event->date_start_in_calendar=$event->datep;
|
||||||
|
|
||||||
@ -1554,7 +1554,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
|
|
||||||
// Show title
|
// Show title
|
||||||
$titletoshow = $daterange;
|
$titletoshow = $daterange;
|
||||||
$titletoshow.=($titletoshow?' ':'').$event->libelle;
|
$titletoshow.=($titletoshow?' ':'').($event->label?$event->label:$event->libelle);
|
||||||
|
|
||||||
if ($event->type_code == 'ICALEVENT') print $titletoshow;
|
if ($event->type_code == 'ICALEVENT') print $titletoshow;
|
||||||
else
|
else
|
||||||
@ -1735,5 +1735,18 @@ function sort_events_by_date($a, $b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If both events have the same start time, longest first
|
// If both events have the same start time, longest first
|
||||||
|
|
||||||
|
if(! is_numeric($b->datef))
|
||||||
|
{
|
||||||
|
// when event B have no end timestamp, event B should sort be before event A (All day events on top)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! is_numeric($a->datef))
|
||||||
|
{
|
||||||
|
// when event A have no end timestamp , event A should sort be before event B (All day events on top)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return $b->datef - $a->datef;
|
return $b->datef - $a->datef;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,10 +39,10 @@ $langs->load("commercial");
|
|||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
|
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
|
||||||
@ -102,7 +102,7 @@ if (! empty($conf->projet->enabled))
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'id', $linkback, ($user->socid?0:1), 'id', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if (! $sortfield)
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("search_socid", 'int')?GETPOST("search_socid", 'int'):GETPOST("socid", 'int');
|
$socid = GETPOST("search_socid", 'int')?GETPOST("search_socid", 'int'):GETPOST("socid", 'int');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
||||||
if ($socid < 0) $socid='';
|
if ($socid < 0) $socid='';
|
||||||
|
|
||||||
@ -138,13 +138,16 @@ $arrayfields=array(
|
|||||||
'a.tms'=>array('label'=>'DateModification', 'checked'=>0)
|
'a.tms'=>array('label'=>'DateModification', 'checked'=>0)
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
if (! empty($extrafields->attributes[$object->table_element]['list'][$key]))
|
||||||
|
$arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key])!=3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$object->fields = dol_sort_array($object->fields, 'position');
|
||||||
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -485,7 +488,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['a.tms']['checked'])) print '<td class="liste_titre"></td>';
|
if (! empty($arrayfields['a.tms']['checked'])) print '<td class="liste_titre"></td>';
|
||||||
if (! empty($arrayfields['a.percent']['checked'])) {
|
if (! empty($arrayfields['a.percent']['checked'])) {
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2);
|
$formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2);
|
||||||
print ajax_combobox('selectstatus');
|
print ajax_combobox('selectstatus');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ if (! $sortfield) $sortfield="a.datec";
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("socid", "int");
|
$socid = GETPOST("socid", "int");
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
||||||
if ($socid < 0) $socid='';
|
if ($socid < 0) $socid='';
|
||||||
|
|
||||||
@ -616,12 +616,12 @@ $typeofevents=array();
|
|||||||
// Load array of colors by type
|
// Load array of colors by type
|
||||||
$colorsbytype=array();
|
$colorsbytype=array();
|
||||||
$labelbytype=array();
|
$labelbytype=array();
|
||||||
$sql="SELECT code, color, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm";
|
$sql="SELECT code, color, libelle as label FROM ".MAIN_DB_PREFIX."c_actioncomm ORDER BY position";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$colorsbytype[$obj->code]=$obj->color;
|
$colorsbytype[$obj->code]=$obj->color;
|
||||||
$labelbytype[$obj->code]=$obj->libelle;
|
$labelbytype[$obj->code]=$obj->label;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop on each user to show calendar
|
// Loop on each user to show calendar
|
||||||
|
|||||||
@ -65,7 +65,7 @@ if (! $sortfield) $sortfield="a.datec";
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("search_socid", "int")?GETPOST("search_socid", "int"):GETPOST("socid", "int");
|
$socid = GETPOST("search_socid", "int")?GETPOST("search_socid", "int"):GETPOST("socid", "int");
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
|
||||||
if ($socid < 0) $socid='';
|
if ($socid < 0) $socid='';
|
||||||
|
|
||||||
@ -752,12 +752,12 @@ while($currentdaytoshow<$lastdaytoshow) {
|
|||||||
// Load array of colors by type
|
// Load array of colors by type
|
||||||
$colorsbytype=array();
|
$colorsbytype=array();
|
||||||
$labelbytype=array();
|
$labelbytype=array();
|
||||||
$sql="SELECT code, color, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm ORDER BY position";
|
$sql="SELECT code, color, libelle as label FROM ".MAIN_DB_PREFIX."c_actioncomm ORDER BY position";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$colorsbytype[$obj->code]=$obj->color;
|
$colorsbytype[$obj->code]=$obj->color;
|
||||||
$labelbytype[$obj->code]=$obj->libelle;
|
$labelbytype[$obj->code]=$obj->label;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop on each user to show calendar
|
// Loop on each user to show calendar
|
||||||
|
|||||||
@ -49,7 +49,7 @@ if (! $sortfield) $sortfield="a.datep";
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
$result = restrictedArea($user, 'agenda', $socid, '', 'myactions');
|
$result = restrictedArea($user, 'agenda', $socid, '', 'myactions');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ if (! empty($conf->notification->enabled)) $langs->load("mails");
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
||||||
if ($user->societe_id > 0) $id=$user->societe_id;
|
if ($user->socid > 0) $id=$user->socid;
|
||||||
$result = restrictedArea($user, 'societe', $id, '&societe');
|
$result = restrictedArea($user, 'societe', $id, '&societe');
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -240,7 +240,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
|
dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
|
|
||||||
@ -387,7 +387,7 @@ if ($object->id > 0)
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans("CustomerRelativeDiscountShort");
|
print $langs->trans("CustomerRelativeDiscountShort");
|
||||||
print '<td><td class="right">';
|
print '<td><td class="right">';
|
||||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
if ($user->rights->societe->creer && !$user->socid > 0)
|
||||||
{
|
{
|
||||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
@ -401,7 +401,7 @@ if ($object->id > 0)
|
|||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print $langs->trans("CustomerAbsoluteDiscountShort");
|
print $langs->trans("CustomerAbsoluteDiscountShort");
|
||||||
print '<td><td class="right">';
|
print '<td><td class="right">';
|
||||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
if ($user->rights->societe->creer && !$user->socid > 0)
|
||||||
{
|
{
|
||||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
}
|
}
|
||||||
@ -1274,7 +1274,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add invoice
|
// Add invoice
|
||||||
if ($user->societe_id == 0)
|
if ($user->socid == 0)
|
||||||
{
|
{
|
||||||
if (! empty($conf->deplacement->enabled) && $object->status==1)
|
if (! empty($conf->deplacement->enabled) && $object->status==1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -47,7 +47,7 @@ $begin=GETPOST('begin', 'alpha');
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->socid) $socid=$user->socid;
|
||||||
$result = restrictedArea($user, 'societe', $socid, '');
|
$result = restrictedArea($user, 'societe', $socid, '');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -51,10 +51,10 @@ $bid=GETPOST('bid', 'int');
|
|||||||
|
|
||||||
// Securite acces client
|
// Securite acces client
|
||||||
$socid=GETPOST('socid', 'int');
|
$socid=GETPOST('socid', 'int');
|
||||||
if (isset($user->societe_id) && $user->societe_id > 0)
|
if (isset($user->socid) && $user->socid > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$max=3;
|
$max=3;
|
||||||
@ -120,6 +120,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
{
|
{
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($listofsearchfields as $key => $value)
|
foreach($listofsearchfields as $key => $value)
|
||||||
@ -132,6 +133,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
@ -559,10 +561,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
|
|||||||
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
|
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
|
||||||
$sql.= ", s.code_fournisseur";
|
$sql.= ", s.code_fournisseur";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.fournisseur = 1";
|
$sql.= " WHERE s.fournisseur = 1";
|
||||||
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
||||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (! $user->rights->societe->client->voir && ! $user->socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||||
$sql.= " ORDER BY s.datec DESC";
|
$sql.= " ORDER BY s.datec DESC";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user