Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into
dev_NEW_ClassOrderDeliverStatusOnStockVentil Conflicts: htdocs/langs/en_US/workflow.lang
This commit is contained in:
commit
a39290022f
@ -424,7 +424,7 @@ if ($rowid && $action != 'edit')
|
|||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
||||||
if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
// Link for paypal payment
|
// Link for paypal payment
|
||||||
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
||||||
|
|||||||
@ -56,7 +56,7 @@ $conditions = array(
|
|||||||
'SOCIETE' => 1,
|
'SOCIETE' => 1,
|
||||||
'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)),
|
'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)),
|
||||||
'MAILING' => ! empty($conf->mailing->enabled),
|
'MAILING' => ! empty($conf->mailing->enabled),
|
||||||
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)),
|
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)),
|
||||||
'USERSIGN' => 1,
|
'USERSIGN' => 1,
|
||||||
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
||||||
);
|
);
|
||||||
|
|||||||
@ -169,11 +169,11 @@ else if ($action == 'addcat')
|
|||||||
else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
||||||
{
|
{
|
||||||
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string
|
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string
|
||||||
$doubleapproval = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL','alpha');
|
$doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED','alpha');
|
||||||
$doubleapproval = price2num($doubleapproval );
|
$doubleapproval = price2num($doubleapproval );
|
||||||
|
|
||||||
$res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
$res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||||
$res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_DOUBLE_APPROVAL",$doubleapproval,'chaine',0,'',$conf->entity);
|
$res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED",$doubleapproval,'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
// TODO We add/delete permission here until permission can have a condition on a global var
|
// TODO We add/delete permission here until permission can have a condition on a global var
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
|
||||||
@ -189,7 +189,7 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
|||||||
$newmodule->rights[$r][4] = 'commande';
|
$newmodule->rights[$r][4] = 'commande';
|
||||||
$newmodule->rights[$r][5] = 'approve2';
|
$newmodule->rights[$r][5] = 'approve2';
|
||||||
|
|
||||||
if ($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)
|
if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
|
||||||
{
|
{
|
||||||
$newmodule->insert_permissions(1);
|
$newmodule->insert_permissions(1);
|
||||||
}
|
}
|
||||||
@ -474,18 +474,18 @@ print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
|||||||
print '<td width="80"> </td>';
|
print '<td width="80"> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=false;
|
$var=false;
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
//if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||||
{
|
//{
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("UseDoubleApproval").'<br>';
|
print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'<br>';
|
||||||
print $langs->trans("IfSetToYesDontForgetPermission");
|
print $langs->trans("IfSetToYesDontForgetPermission");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input type="text" size="3" name="SUPPLIER_ORDER_DOUBLE_APPROVAL" value="'.$conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL.'">';
|
print '<input type="text" size="3" name="SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED" value="'.$conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED.'">';
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
}
|
//}
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'><td colspan="2">';
|
print '<tr '.$bc[$var].'><td colspan="2">';
|
||||||
print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')<br>';
|
print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')<br>';
|
||||||
|
|||||||
@ -94,7 +94,7 @@ dol_fiche_head($head, 'supplierpayment', $langs->trans("Suppliers"), 0, 'company
|
|||||||
|
|
||||||
if (empty($conf->global->SUPPLIER_PAYMENT_ADDON)) $conf->global->SUPPLIER_PAYMENT_ADDON = 'mod_supplier_payment_bronan';
|
if (empty($conf->global->SUPPLIER_PAYMENT_ADDON)) $conf->global->SUPPLIER_PAYMENT_ADDON = 'mod_supplier_payment_bronan';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("PaymentsNumberingModule"));
|
print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', '');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -76,6 +76,7 @@ $workflowcodes=array(
|
|||||||
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('family'=>'create', 'position'=>10, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'),
|
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('family'=>'create', 'position'=>10, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'),
|
||||||
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('family'=>'create', 'position'=>20, 'enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'),
|
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('family'=>'create', 'position'=>20, 'enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'),
|
||||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'),
|
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'),
|
||||||
|
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'),
|
||||||
// For the following 2 options, if module invoice is disabled, they does not exists, so "Classify billed" for order must be done manually from order card.
|
// For the following 2 options, if module invoice is disabled, they does not exists, so "Classify billed" for order must be done manually from order card.
|
||||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>40, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
|
'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>40, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
|
||||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>50, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
|
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>50, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
|
||||||
|
|||||||
@ -2324,9 +2324,9 @@ if ($action == 'create')
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
$somethingshown = $form->showLinkedObjectBlock($object);
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object);
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('propal'));
|
||||||
if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
// print '</td><td valign="top" width="50%">';
|
// print '</td><td valign="top" width="50%">';
|
||||||
|
|||||||
@ -2589,9 +2589,9 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
$somethingshown = $form->showLinkedObjectBlock($object);
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
//$linktoelem = $form->showLinkToObjectBlock($object);
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
|
||||||
//if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|||||||
@ -134,14 +134,6 @@ if (empty($reshook))
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
// Link invoice to order
|
|
||||||
if (GETPOST('linkedOrder') && empty($cancel) && $id > 0)
|
|
||||||
{
|
|
||||||
$object->fetch($id);
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
$result = $object->add_object_linked('commande', GETPOST('linkedOrder'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action clone object
|
// Action clone object
|
||||||
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->facture->creer) {
|
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->facture->creer) {
|
||||||
// if (1 == 0 && empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"])) {
|
// if (1 == 0 && empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"])) {
|
||||||
@ -4030,9 +4022,9 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
$somethingshown = $form->showLinkedObjectBlock($object);
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice'));
|
||||||
if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
// Link for paypal payment
|
// Link for paypal payment
|
||||||
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
||||||
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
|
||||||
|
|||||||
@ -1996,8 +1996,8 @@ else
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
$somethingshown = $form->showLinkedObjectBlock($object);
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object);
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat'));
|
||||||
if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2015-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,22 +18,29 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/actions_dellink.inc.php
|
* \file htdocs/core/actions_dellink.inc.php
|
||||||
* \brief Code for actions on deleting link between elements
|
* \brief Code for actions on linking and deleting link between elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// $action must be defined
|
// $action must be defined
|
||||||
// $object must be defined
|
// $object must be defined
|
||||||
// $permissiondellink must be defined
|
// $permissiondellink must be defined
|
||||||
// $uploaddir (example $conf->projet->dir_output . "/";)
|
|
||||||
|
|
||||||
$dellinkid = GETPOST('dellinkid','int');
|
$dellinkid = GETPOST('dellinkid','int');
|
||||||
|
$addlinkid = GETPOST('idtolinkto','int');
|
||||||
|
|
||||||
// Set public note
|
// Link invoice to order
|
||||||
|
if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel') && $id > 0 && $addlinkid > 0)
|
||||||
|
{
|
||||||
|
$object->fetch($id);
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
$result = $object->add_object_linked(GETPOST('addlink'), $addlinkid);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete link
|
||||||
if ($action == 'dellink' && ! empty($permissiondellink) && ! GETPOST('cancel') && $dellinkid > 0)
|
if ($action == 'dellink' && ! empty($permissiondellink) && ! GETPOST('cancel') && $dellinkid > 0)
|
||||||
{
|
{
|
||||||
$result=$object->deleteObjectLinked(0, '', 0, '', $dellinkid);
|
$result=$object->deleteObjectLinked(0, '', 0, '', $dellinkid);
|
||||||
if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
|
if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2380,6 +2380,10 @@ abstract class CommonObject
|
|||||||
$origin = (! empty($origin) ? $origin : $this->origin);
|
$origin = (! empty($origin) ? $origin : $this->origin);
|
||||||
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
|
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
|
||||||
|
|
||||||
|
// Special case
|
||||||
|
if ($origin == 'order') $origin='commande';
|
||||||
|
if ($origin == 'invoice') $origin='facture';
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
||||||
@ -2564,7 +2568,10 @@ abstract class CommonObject
|
|||||||
// Set classfile
|
// Set classfile
|
||||||
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
|
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
|
||||||
|
|
||||||
if ($objecttype == 'invoice_supplier') {
|
if ($objecttype == 'order') {
|
||||||
|
$classfile = 'commande'; $classname = 'Commande';
|
||||||
|
}
|
||||||
|
else if ($objecttype == 'invoice_supplier') {
|
||||||
$classfile = 'fournisseur.facture'; $classname = 'FactureFournisseur';
|
$classfile = 'fournisseur.facture'; $classname = 'FactureFournisseur';
|
||||||
}
|
}
|
||||||
else if ($objecttype == 'order_supplier') {
|
else if ($objecttype == 'order_supplier') {
|
||||||
@ -2584,15 +2591,18 @@ abstract class CommonObject
|
|||||||
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype))
|
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype))
|
||||||
{
|
{
|
||||||
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||||
|
//print '/'.$classpath.'/'.$classfile.'.class.php';
|
||||||
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
|
if (class_exists($classname))
|
||||||
{
|
{
|
||||||
$object = new $classname($this->db);
|
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
|
||||||
$ret = $object->fetch($objectid);
|
{
|
||||||
if ($ret >= 0)
|
$object = new $classname($this->db);
|
||||||
{
|
$ret = $object->fetch($objectid);
|
||||||
$this->linkedObjects[$objecttype][$i] = $object;
|
if ($ret >= 0)
|
||||||
}
|
{
|
||||||
|
$this->linkedObjects[$objecttype][$i] = $object;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -203,7 +203,7 @@ class Form
|
|||||||
$ret.=$doleditor->Create(1);
|
$ret.=$doleditor->Create(1);
|
||||||
}
|
}
|
||||||
$ret.='</td>';
|
$ret.='</td>';
|
||||||
|
|
||||||
$ret.='<td align="left">';
|
$ret.='<td align="left">';
|
||||||
$ret.='<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">';
|
$ret.='<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">';
|
||||||
if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='<br>'."\n";
|
if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='<br>'."\n";
|
||||||
@ -493,7 +493,7 @@ class Form
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate select HTML to choose massaction
|
* Generate select HTML to choose massaction
|
||||||
*
|
*
|
||||||
* @param string $selected Selected value
|
* @param string $selected Selected value
|
||||||
* @param int $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
|
* @param int $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
|
||||||
* @return string Select list
|
* @return string Select list
|
||||||
@ -501,9 +501,9 @@ class Form
|
|||||||
function selectMassAction($selected, $arrayofaction)
|
function selectMassAction($selected, $arrayofaction)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$hookmanager;
|
global $conf,$langs,$hookmanager;
|
||||||
|
|
||||||
if (count($arrayofaction) == 0) return;
|
if (count($arrayofaction) == 0) return;
|
||||||
|
|
||||||
$disabled=0;
|
$disabled=0;
|
||||||
$ret='<div class="centpercent center"><select class="flat hideobject massaction massactionselect" name="massaction"'.($disabled?' disabled="disabled"':'').'>';
|
$ret='<div class="centpercent center"><select class="flat hideobject massaction massactionselect" name="massaction"'.($disabled?' disabled="disabled"':'').'>';
|
||||||
$ret.='<option value="0"'.($disabled?' disabled="disabled"':'').'>-- '.$langs->trans("SelectAction").' --</option>';
|
$ret.='<option value="0"'.($disabled?' disabled="disabled"':'').'>-- '.$langs->trans("SelectAction").' --</option>';
|
||||||
@ -515,7 +515,7 @@ class Form
|
|||||||
// Warning: if you set submit button to disabled, post using Enter will no more work
|
// Warning: if you set submit button to disabled, post using Enter will no more work
|
||||||
$ret.='<input type="submit" name="confirmmassaction" class="button hideobject massaction massactionconfirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
|
$ret.='<input type="submit" name="confirmmassaction" class="button hideobject massaction massactionconfirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
|
||||||
$ret.='</div>';
|
$ret.='</div>';
|
||||||
|
|
||||||
$ret.='<!-- JS CODE TO ENABLE mass action select -->
|
$ret.='<!-- JS CODE TO ENABLE mass action select -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function initCheckForSelect()
|
function initCheckForSelect()
|
||||||
@ -534,7 +534,7 @@ class Form
|
|||||||
jQuery(".massaction").hide();
|
jQuery(".massaction").hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
initCheckForSelect();
|
initCheckForSelect();
|
||||||
jQuery(".checkforselect").click(function() {
|
jQuery(".checkforselect").click(function() {
|
||||||
@ -556,10 +556,10 @@ class Form
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
';
|
';
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return combo list of activated countries, into language of user
|
* Return combo list of activated countries, into language of user
|
||||||
*
|
*
|
||||||
@ -1029,9 +1029,9 @@ class Form
|
|||||||
$textifempty='';
|
$textifempty='';
|
||||||
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
||||||
//if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
//if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
||||||
if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT))
|
if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT))
|
||||||
{
|
{
|
||||||
if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty);
|
if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty);
|
||||||
else $textifempty.=$langs->trans("All");
|
else $textifempty.=$langs->trans("All");
|
||||||
}
|
}
|
||||||
if ($showempty) $out.= '<option value="-1">'.$textifempty.'</option>'."\n";
|
if ($showempty) $out.= '<option value="-1">'.$textifempty.'</option>'."\n";
|
||||||
@ -1350,7 +1350,7 @@ class Form
|
|||||||
* @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list
|
* @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list
|
||||||
* @param string $enableonlytext If option $enableonly is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
|
* @param string $enableonlytext If option $enableonly is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
|
||||||
* @param string $morecss More css
|
* @param string $morecss More css
|
||||||
* @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
|
* @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
|
||||||
* @return string HTML select string
|
* @return string HTML select string
|
||||||
* @see select_dolgroups
|
* @see select_dolgroups
|
||||||
*/
|
*/
|
||||||
@ -1881,7 +1881,7 @@ class Form
|
|||||||
$outlabel=$objp->label;
|
$outlabel=$objp->label;
|
||||||
$outdesc=$objp->description;
|
$outdesc=$objp->description;
|
||||||
$outbarcode=$objp->barcode;
|
$outbarcode=$objp->barcode;
|
||||||
|
|
||||||
$outtype=$objp->fk_product_type;
|
$outtype=$objp->fk_product_type;
|
||||||
$outdurationvalue=$outtype == Product::TYPE_SERVICE?substr($objp->duration,0,dol_strlen($objp->duration)-1):'';
|
$outdurationvalue=$outtype == Product::TYPE_SERVICE?substr($objp->duration,0,dol_strlen($objp->duration)-1):'';
|
||||||
$outdurationunit=$outtype == Product::TYPE_SERVICE?substr($objp->duration,-1):'';
|
$outdurationunit=$outtype == Product::TYPE_SERVICE?substr($objp->duration,-1):'';
|
||||||
@ -1898,13 +1898,13 @@ class Form
|
|||||||
$opt.= $objp->ref;
|
$opt.= $objp->ref;
|
||||||
if ($outbarcode) $opt.=' ('.$outbarcode.')';
|
if ($outbarcode) $opt.=' ('.$outbarcode.')';
|
||||||
$opt.=' - '.dol_trunc($label,$maxlengtharticle).' - ';
|
$opt.=' - '.dol_trunc($label,$maxlengtharticle).' - ';
|
||||||
|
|
||||||
$objRef = $objp->ref;
|
$objRef = $objp->ref;
|
||||||
if (! empty($filterkey) && $filterkey != '') $objRef=preg_replace('/('.preg_quote($filterkey).')/i','<strong>$1</strong>',$objRef,1);
|
if (! empty($filterkey) && $filterkey != '') $objRef=preg_replace('/('.preg_quote($filterkey).')/i','<strong>$1</strong>',$objRef,1);
|
||||||
$outval.=$objRef;
|
$outval.=$objRef;
|
||||||
if ($outbarcode) $outval.=' ('.$outbarcode.')';
|
if ($outbarcode) $outval.=' ('.$outbarcode.')';
|
||||||
$outval.=' - '.dol_trunc($label,$maxlengtharticle).' - ';
|
$outval.=' - '.dol_trunc($label,$maxlengtharticle).' - ';
|
||||||
|
|
||||||
$found=0;
|
$found=0;
|
||||||
|
|
||||||
// Multiprice
|
// Multiprice
|
||||||
@ -1986,9 +1986,9 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Price by customer
|
// Price by customer
|
||||||
if (empty($hidepriceinlabel) && !empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
if (empty($hidepriceinlabel) && !empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
{
|
{
|
||||||
if (!empty($objp->idprodcustprice))
|
if (!empty($objp->idprodcustprice))
|
||||||
{
|
{
|
||||||
$found = 1;
|
$found = 1;
|
||||||
|
|
||||||
@ -2032,7 +2032,12 @@ class Form
|
|||||||
if (! empty($conf->stock->enabled) && isset($objp->stock) && $objp->fk_product_type == 0)
|
if (! empty($conf->stock->enabled) && isset($objp->stock) && $objp->fk_product_type == 0)
|
||||||
{
|
{
|
||||||
$opt.= ' - '.$langs->trans("Stock").':'.$objp->stock;
|
$opt.= ' - '.$langs->trans("Stock").':'.$objp->stock;
|
||||||
$outval.=' - '.$langs->transnoentities("Stock").':'.$objp->stock;
|
|
||||||
|
if ($objp->stock > 0) {
|
||||||
|
$outval.= ' - <span class="product_line_stock_ok">'.$langs->transnoentities("Stock").':'.$objp->stock.'</span>';
|
||||||
|
}elseif ($objp->stock <= 0) {
|
||||||
|
$outval.= ' - <span class="product_line_stock_too_low">'.$langs->transnoentities("Stock").':'.$objp->stock.'</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($outdurationvalue && $outdurationunit)
|
if ($outdurationvalue && $outdurationunit)
|
||||||
@ -2066,7 +2071,7 @@ class Form
|
|||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
global $price_level, $status, $finished;
|
global $price_level, $status, $finished;
|
||||||
|
|
||||||
$selected_input_value='';
|
$selected_input_value='';
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
|
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
|
||||||
{
|
{
|
||||||
@ -2198,11 +2203,11 @@ class Form
|
|||||||
if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','<strong>$1</strong>',$label,1);
|
if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','<strong>$1</strong>',$label,1);
|
||||||
|
|
||||||
$opt.=$objp->ref;
|
$opt.=$objp->ref;
|
||||||
if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn))
|
if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn))
|
||||||
$opt.=' ('.$objp->ref_fourn.')';
|
$opt.=' ('.$objp->ref_fourn.')';
|
||||||
$opt.=' - ';
|
$opt.=' - ';
|
||||||
$outval.=$objRef;
|
$outval.=$objRef;
|
||||||
if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn))
|
if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn))
|
||||||
$outval.=' ('.$objRefFourn.')';
|
$outval.=' ('.$objRefFourn.')';
|
||||||
$outval.=' - ';
|
$outval.=' - ';
|
||||||
$opt.=dol_trunc($label, 72).' - ';
|
$opt.=dol_trunc($label, 72).' - ';
|
||||||
@ -2805,7 +2810,7 @@ class Form
|
|||||||
{
|
{
|
||||||
// If not good status
|
// If not good status
|
||||||
if ($active >= 0 && $arraytypes['active'] != $active) continue;
|
if ($active >= 0 && $arraytypes['active'] != $active) continue;
|
||||||
|
|
||||||
// On passe si on a demande de filtrer sur des modes de paiments particuliers
|
// On passe si on a demande de filtrer sur des modes de paiments particuliers
|
||||||
if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue;
|
if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue;
|
||||||
|
|
||||||
@ -3168,13 +3173,13 @@ class Form
|
|||||||
$langs->load("categories");
|
$langs->load("categories");
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
|
|
||||||
// For backward compatibility
|
// For backward compatibility
|
||||||
if (is_numeric($type))
|
if (is_numeric($type))
|
||||||
{
|
{
|
||||||
dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
|
dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cat = new Categorie($this->db);
|
$cat = new Categorie($this->db);
|
||||||
$cate_arbo = $cat->get_full_arbo($type,$excludeafterid);
|
$cate_arbo = $cat->get_full_arbo($type,$excludeafterid);
|
||||||
|
|
||||||
@ -3794,7 +3799,7 @@ class Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form with multicurrency code
|
* Show form with multicurrency code
|
||||||
*
|
*
|
||||||
@ -3824,7 +3829,7 @@ class Form
|
|||||||
print !empty($selected) ? currency_name($selected,1) : ' ';
|
print !empty($selected) ? currency_name($selected,1) : ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form with multicurrency rate
|
* Show form with multicurrency rate
|
||||||
*
|
*
|
||||||
@ -3837,7 +3842,7 @@ class Form
|
|||||||
function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='')
|
function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='')
|
||||||
{
|
{
|
||||||
global $langs, $mysoc, $conf;
|
global $langs, $mysoc, $conf;
|
||||||
|
|
||||||
if ($htmlname != "none")
|
if ($htmlname != "none")
|
||||||
{
|
{
|
||||||
print '<form method="POST" action="'.$page.'">';
|
print '<form method="POST" action="'.$page.'">';
|
||||||
@ -4068,7 +4073,7 @@ class Form
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array of currencies in user language
|
* Return array of currencies in user language
|
||||||
*
|
*
|
||||||
* @param string $selected preselected currency code
|
* @param string $selected preselected currency code
|
||||||
* @param string $htmlname name of HTML select list
|
* @param string $htmlname name of HTML select list
|
||||||
* @param integer $useempty 1=Add empty line
|
* @param integer $useempty 1=Add empty line
|
||||||
@ -4081,7 +4086,7 @@ class Form
|
|||||||
$langs->loadCacheCurrencies(''); // Load ->cache_currencies
|
$langs->loadCacheCurrencies(''); // Load ->cache_currencies
|
||||||
|
|
||||||
$TCurrency = array();
|
$TCurrency = array();
|
||||||
|
|
||||||
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency';
|
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency';
|
||||||
$sql.= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
|
$sql.= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -4089,7 +4094,7 @@ class Form
|
|||||||
{
|
{
|
||||||
while ($obj = $db->fetch_object($resql)) $TCurrency[$obj->code] = $obj->code;
|
while ($obj = $db->fetch_object($resql)) $TCurrency[$obj->code] = $obj->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
$out='';
|
$out='';
|
||||||
$out.= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
$out.= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||||
if ($useempty) $out .= '<option value=""></option>';
|
if ($useempty) $out .= '<option value=""></option>';
|
||||||
@ -4101,19 +4106,19 @@ class Form
|
|||||||
{
|
{
|
||||||
if (!empty($selected) && $selected == $code_iso) $out.= '<option value="'.$code_iso.'" selected="selected">';
|
if (!empty($selected) && $selected == $code_iso) $out.= '<option value="'.$code_iso.'" selected="selected">';
|
||||||
else $out.= '<option value="'.$code_iso.'">';
|
else $out.= '<option value="'.$code_iso.'">';
|
||||||
|
|
||||||
$out.= $currency['label'];
|
$out.= $currency['label'];
|
||||||
$out.= ' ('.$langs->getCurrencySymbol($code_iso).')';
|
$out.= ' ('.$langs->getCurrencySymbol($code_iso).')';
|
||||||
$out.= '</option>';
|
$out.= '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$out.= '</select>';
|
$out.= '</select>';
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load into the cache vat rates of a country
|
* Load into the cache vat rates of a country
|
||||||
*
|
*
|
||||||
@ -4204,7 +4209,7 @@ class Form
|
|||||||
$defaulttx=preg_replace('/\s*\(.*\)/','',$defaulttx);
|
$defaulttx=preg_replace('/\s*\(.*\)/','',$defaulttx);
|
||||||
}
|
}
|
||||||
//var_dump($selectedrate.'-'.$defaulttx.'-'.$defaultnpr.'-'.$defaultcode);
|
//var_dump($selectedrate.'-'.$defaulttx.'-'.$defaultnpr.'-'.$defaultcode);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (is_object($societe_vendeuse) && ! $societe_vendeuse->country_code)
|
if (is_object($societe_vendeuse) && ! $societe_vendeuse->country_code)
|
||||||
{
|
{
|
||||||
@ -4263,7 +4268,7 @@ class Form
|
|||||||
|
|
||||||
// Now we get list
|
// Now we get list
|
||||||
$num = $this->load_cache_vatrates($code_country); // If no vat defined, return -1 with message into this->error
|
$num = $this->load_cache_vatrates($code_country); // If no vat defined, return -1 with message into this->error
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
|
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
|
||||||
@ -4304,7 +4309,7 @@ class Form
|
|||||||
$return.= '"';
|
$return.= '"';
|
||||||
if ($defaultcode) // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
|
if ($defaultcode) // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
|
||||||
{
|
{
|
||||||
if ($defaultcode == $rate['code']) $return.= ' selected';
|
if ($defaultcode == $rate['code']) $return.= ' selected';
|
||||||
}
|
}
|
||||||
elseif ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr)
|
elseif ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr)
|
||||||
{
|
{
|
||||||
@ -4313,7 +4318,7 @@ class Form
|
|||||||
$return.= '>'.vatrate($rate['libtva']);
|
$return.= '>'.vatrate($rate['libtva']);
|
||||||
//$return.=($rate['code']?' '.$rate['code']:'');
|
//$return.=($rate['code']?' '.$rate['code']:'');
|
||||||
$return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used)
|
$return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used)
|
||||||
|
|
||||||
$return.= '</option>';
|
$return.= '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4617,7 +4622,7 @@ class Form
|
|||||||
{
|
{
|
||||||
$tmparray=dol_getdate($adddateof);
|
$tmparray=dol_getdate($adddateof);
|
||||||
$retstring.=' - <button class="dpInvisibleButtons datenowlink" id="dateofinvoice" type="button" name="_dateofinvoice" value="now" onclick="jQuery(\'#re\').val(\''.dol_print_date($adddateof,'day').'\');jQuery(\'#reday\').val(\''.$tmparray['mday'].'\');jQuery(\'#remonth\').val(\''.$tmparray['mon'].'\');jQuery(\'#reyear\').val(\''.$tmparray['year'].'\');">'.$langs->trans("DateInvoice").'</a>';
|
$retstring.=' - <button class="dpInvisibleButtons datenowlink" id="dateofinvoice" type="button" name="_dateofinvoice" value="now" onclick="jQuery(\'#re\').val(\''.dol_print_date($adddateof,'day').'\');jQuery(\'#reday\').val(\''.$tmparray['mday'].'\');jQuery(\'#remonth\').val(\''.$tmparray['mon'].'\');jQuery(\'#reyear\').val(\''.$tmparray['year'].'\');">'.$langs->trans("DateInvoice").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($nooutput)) return $retstring;
|
if (! empty($nooutput)) return $retstring;
|
||||||
|
|
||||||
@ -4822,19 +4827,19 @@ class Form
|
|||||||
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0)
|
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
global $delayedhtmlcontent;
|
global $delayedhtmlcontent;
|
||||||
|
|
||||||
$tmpplugin='select2';
|
$tmpplugin='select2';
|
||||||
|
|
||||||
$out='<input type="text" class="'.$htmlname.($morecss?' '.$morecss:'').'" '.($moreparam?$moreparam.' ':'').'name="'.$htmlname.'">';
|
$out='<input type="text" class="'.$htmlname.($morecss?' '.$morecss:'').'" '.($moreparam?$moreparam.' ':'').'name="'.$htmlname.'">';
|
||||||
|
|
||||||
// TODO Use an internal dolibarr component instead of select2
|
// TODO Use an internal dolibarr component instead of select2
|
||||||
$outdelayed='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
$outdelayed='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
'.($callurlonselect ? 'var saveRemoteData = [];':'').'
|
'.($callurlonselect ? 'var saveRemoteData = [];':'').'
|
||||||
|
|
||||||
$(".'.$htmlname.'").select2({
|
$(".'.$htmlname.'").select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
dir: "ltr",
|
dir: "ltr",
|
||||||
@ -4869,7 +4874,7 @@ class Form
|
|||||||
},*/
|
},*/
|
||||||
cache: true
|
cache: true
|
||||||
},
|
},
|
||||||
dropdownCssClass: "css-'.$htmlname.'",
|
dropdownCssClass: "css-'.$htmlname.'",
|
||||||
placeholder: "'.dol_escape_js($placeholder).'",
|
placeholder: "'.dol_escape_js($placeholder).'",
|
||||||
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
||||||
minimumInputLength: '.$minimumInputLength.',
|
minimumInputLength: '.$minimumInputLength.',
|
||||||
@ -4877,9 +4882,9 @@ class Form
|
|||||||
return escapeMarkup(result.text);
|
return escapeMarkup(result.text);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
'.($callurlonselect ? '
|
'.($callurlonselect ? '
|
||||||
$(".'.$htmlname.'").change(function() {
|
$(".'.$htmlname.'").change(function() {
|
||||||
var selected = $(".'.$htmlname.'").select2("val");
|
var selected = $(".'.$htmlname.'").select2("val");
|
||||||
$(".'.$htmlname.'").select2("val",""); /* reset visible combo value */
|
$(".'.$htmlname.'").select2("val",""); /* reset visible combo value */
|
||||||
$.each( saveRemoteData, function( key, value ) {
|
$.each( saveRemoteData, function( key, value ) {
|
||||||
@ -4890,7 +4895,7 @@ class Form
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});' : '' ) . '
|
});' : '' ) . '
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
@ -4926,7 +4931,7 @@ class Form
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
// Add code for jquery to use multiselect
|
// Add code for jquery to use multiselect
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
||||||
{
|
{
|
||||||
@ -5013,9 +5018,9 @@ class Form
|
|||||||
static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage)
|
static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage)
|
||||||
{
|
{
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) return '';
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) return '';
|
||||||
|
|
||||||
$tmpvar="MAIN_SELECTEDFIELDS_".$varpage;
|
$tmpvar="MAIN_SELECTEDFIELDS_".$varpage;
|
||||||
if (! empty($user->conf->$tmpvar))
|
if (! empty($user->conf->$tmpvar))
|
||||||
{
|
{
|
||||||
@ -5029,33 +5034,33 @@ class Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//var_dump($array);
|
//var_dump($array);
|
||||||
|
|
||||||
$lis='';
|
$lis='';
|
||||||
$listcheckedstring='';
|
$listcheckedstring='';
|
||||||
|
|
||||||
foreach($array as $key => $val)
|
foreach($array as $key => $val)
|
||||||
{
|
{
|
||||||
/* var_dump($val);
|
/* var_dump($val);
|
||||||
var_dump(array_key_exists('enabled', $val));
|
var_dump(array_key_exists('enabled', $val));
|
||||||
var_dump(!$val['enabled']);*/
|
var_dump(!$val['enabled']);*/
|
||||||
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled'])
|
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled'])
|
||||||
{
|
{
|
||||||
unset($array[$key]); // We don't want this field
|
unset($array[$key]); // We don't want this field
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($val['label'])
|
if ($val['label'])
|
||||||
{
|
{
|
||||||
$lis.='<li><input type="checkbox" value="'.$key.'"'.(empty($val['checked'])?'':' checked="checked"').'/>'.dol_escape_htmltag($val['label']).'</li>';
|
$lis.='<li><input type="checkbox" value="'.$key.'"'.(empty($val['checked'])?'':' checked="checked"').'/>'.dol_escape_htmltag($val['label']).'</li>';
|
||||||
$listcheckedstring.=(empty($val['checked'])?'':$key.',');
|
$listcheckedstring.=(empty($val['checked'])?'':$key.',');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$out ='<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
|
$out ='<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
|
||||||
|
|
||||||
<dl class="dropdown">
|
<dl class="dropdown">
|
||||||
<dt>
|
<dt>
|
||||||
<a href="#">
|
<a href="#">
|
||||||
'.img_picto('','list').'
|
'.img_picto('','list').'
|
||||||
<input type="hidden" class="'.$htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
|
<input type="hidden" class="'.$htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
|
||||||
</a>
|
</a>
|
||||||
</dt>
|
</dt>
|
||||||
@ -5067,41 +5072,41 @@ class Form
|
|||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(".dropdown dt a").on(\'click\', function () {
|
$(".dropdown dt a").on(\'click\', function () {
|
||||||
$(".dropdown dd ul").slideToggle(\'fast\');
|
$(".dropdown dd ul").slideToggle(\'fast\');
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".dropdown dd ul li a").on(\'click\', function () {
|
$(".dropdown dd ul li a").on(\'click\', function () {
|
||||||
$(".dropdown dd ul").hide();
|
$(".dropdown dd ul").hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
function getSelectedValue(id) {
|
function getSelectedValue(id) {
|
||||||
return $("#" + id).find("dt a span.value").html();
|
return $("#" + id).find("dt a span.value").html();
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).bind(\'click\', function (e) {
|
$(document).bind(\'click\', function (e) {
|
||||||
var $clicked = $(e.target);
|
var $clicked = $(e.target);
|
||||||
if (!$clicked.parents().hasClass("dropdown")) $(".dropdown dd ul").hide();
|
if (!$clicked.parents().hasClass("dropdown")) $(".dropdown dd ul").hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(\'.multiselectcheckbox'.$htmlname.' input[type="checkbox"]\').on(\'click\', function () {
|
$(\'.multiselectcheckbox'.$htmlname.' input[type="checkbox"]\').on(\'click\', function () {
|
||||||
console.log("A new field was added/removed")
|
console.log("A new field was added/removed")
|
||||||
$("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\')
|
$("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\')
|
||||||
var title = $(this).val() + ",";
|
var title = $(this).val() + ",";
|
||||||
if ($(this).is(\':checked\')) {
|
if ($(this).is(\':checked\')) {
|
||||||
$(\'.'.$htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
|
$(\'.'.$htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(\'.'.$htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
|
$(\'.'.$htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
|
||||||
}
|
}
|
||||||
// Now, we submit page
|
// Now, we submit page
|
||||||
$(this).parents(\'form:first\').submit();
|
$(this).parents(\'form:first\').submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
';
|
';
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
@ -5185,7 +5190,7 @@ class Form
|
|||||||
$tplpath = $element.'/'.$subelement;
|
$tplpath = $element.'/'.$subelement;
|
||||||
}
|
}
|
||||||
$tplname='linkedobjectblock';
|
$tplname='linkedobjectblock';
|
||||||
|
|
||||||
// To work with non standard path
|
// To work with non standard path
|
||||||
if ($objecttype == 'facture') {
|
if ($objecttype == 'facture') {
|
||||||
$tplpath = 'compta/'.$element;
|
$tplpath = 'compta/'.$element;
|
||||||
@ -5223,17 +5228,17 @@ class Form
|
|||||||
else if ($objecttype == 'subscription') {
|
else if ($objecttype == 'subscription') {
|
||||||
$tplpath = 'adherents';
|
$tplpath = 'adherents';
|
||||||
}
|
}
|
||||||
|
|
||||||
global $linkedObjectBlock;
|
global $linkedObjectBlock;
|
||||||
$linkedObjectBlock = $objects;
|
$linkedObjectBlock = $objects;
|
||||||
|
|
||||||
if (empty($numoutput))
|
if (empty($numoutput))
|
||||||
{
|
{
|
||||||
$numoutput++;
|
$numoutput++;
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print load_fiche_titre($langs->trans('RelatedObjects'), '', '');
|
print load_fiche_titre($langs->trans('RelatedObjects'), '', '');
|
||||||
|
|
||||||
print '<table class="noborder allwidth">';
|
print '<table class="noborder allwidth">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -5246,7 +5251,7 @@ class Form
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output template part (modules that overwrite templates must declare this into descriptor)
|
// Output template part (modules that overwrite templates must declare this into descriptor)
|
||||||
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/'.$tplpath.'/tpl'));
|
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/'.$tplpath.'/tpl'));
|
||||||
foreach($dirtpls as $reldir)
|
foreach($dirtpls as $reldir)
|
||||||
@ -5256,23 +5261,24 @@ class Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($numoutput)
|
if ($numoutput)
|
||||||
{
|
{
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $num;
|
return $num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show block with links to link to other objects.
|
* Show block with links to link to other objects.
|
||||||
*
|
*
|
||||||
* @param CommonObject $object Object we want to show links to
|
* @param CommonObject $object Object we want to show links to
|
||||||
* @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order')
|
* @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order'). null or array() if no restriction.
|
||||||
* @return string <0 if KO, >0 if OK
|
* @param array $excludelinksto Do not show links of this type, for exemple array('order') or array('supplier_order'). null or array() if no exclusion.
|
||||||
|
* @return string <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function showLinkToObjectBlock($object, $restrictlinksto=array())
|
function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinksto=array())
|
||||||
{
|
{
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
global $bc;
|
global $bc;
|
||||||
@ -5281,202 +5287,90 @@ class Form
|
|||||||
|
|
||||||
if (! is_object($object->thirdparty)) $object->fetch_thirdparty();
|
if (! is_object($object->thirdparty)) $object->fetch_thirdparty();
|
||||||
|
|
||||||
|
$possiblelinks=array(
|
||||||
if (((! is_array($restrictlinksto)) || in_array('order',$restrictlinksto))
|
'propal'=>array('enabled'=>$conf->propale->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
||||||
&& ! empty($conf->commande->enabled))
|
'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
||||||
|
'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.facnumber as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
||||||
|
'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
||||||
|
'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
||||||
|
'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
||||||
|
'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
|
||||||
|
'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id)
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($possiblelinks as $key => $possiblelink)
|
||||||
{
|
{
|
||||||
$linktoelem.=($linktoelem?' ':'').'<a href="#linktoorder" id="linktoorder">' . $langs->trans('LinkedOrder') . '</a>';
|
$num = 0;
|
||||||
|
|
||||||
print '
|
if (! empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || ! in_array($key, $excludelinksto)))
|
||||||
<script type="text/javascript" language="javascript">
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
jQuery("#linktoorder").click(function() {
|
|
||||||
jQuery("#orderlist").toggle();
|
|
||||||
jQuery("#linktoorder").toggle();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
';
|
|
||||||
|
|
||||||
print '<div id="orderlist"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
|
||||||
|
|
||||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_client, c.total_ht";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
|
|
||||||
$sql .= ", " . MAIN_DB_PREFIX . "commande as c";
|
|
||||||
$sql .= ' WHERE c.fk_soc = s.rowid AND c.fk_soc = ' . $object->thirdparty->id . '';
|
|
||||||
|
|
||||||
$resqlorderlist = $this->db->query($sql);
|
|
||||||
if ($resqlorderlist)
|
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows($resqlorderlist);
|
print '<div id="'.$key.'list"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
||||||
$i = 0;
|
$sql = $possiblelink['sql'];
|
||||||
|
$resqllist = $this->db->query($sql);
|
||||||
print '<br><form action="" method="POST" name="LinkedOrder">';
|
if ($resqllist)
|
||||||
print '<table class="noborder">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td class="nowrap"></td>';
|
|
||||||
print '<td align="center">' . $langs->trans("Ref") . '</td>';
|
|
||||||
print '<td align="left">' . $langs->trans("RefCustomer") . '</td>';
|
|
||||||
print '<td align="left">' . $langs->trans("AmountHTShort") . '</td>';
|
|
||||||
print '<td align="left">' . $langs->trans("Company") . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
{
|
||||||
$objp = $this->db->fetch_object($resqlorderlist);
|
$num = $this->db->num_rows($resqllist);
|
||||||
|
$i = 0;
|
||||||
$var = ! $var;
|
|
||||||
print '<tr ' . $bc [$var] . '>';
|
print '<br><form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
|
||||||
print '<td aling="left">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
print '<input type="radio" name="linkedOrder" value=' . $objp->rowid . '>';
|
print '<input type="hidden" name="action" value="addlink">';
|
||||||
print '</td>';
|
print '<input type="hidden" name="addlink" value="'.$key.'">';
|
||||||
print '<td align="center">' . $objp->ref . '</td>';
|
print '<table class="noborder">';
|
||||||
print '<td>' . $objp->ref_client . '</td>';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>' . price($objp->total_ht) . '</td>';
|
print '<td class="nowrap"></td>';
|
||||||
print '<td>' . $objp->name . '</td>';
|
print '<td align="center">' . $langs->trans("Ref") . '</td>';
|
||||||
|
print '<td align="left">' . $langs->trans("RefCustomer") . '</td>';
|
||||||
|
print '<td align="left">' . $langs->trans("AmountHTShort") . '</td>';
|
||||||
|
print '<td align="left">' . $langs->trans("Company") . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
while ($i < $num)
|
||||||
$i ++;
|
{
|
||||||
|
$objp = $this->db->fetch_object($resqlorderlist);
|
||||||
|
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr ' . $bc [$var] . '>';
|
||||||
|
print '<td aling="left">';
|
||||||
|
print '<input type="radio" name="idtolinkto" value=' . $objp->rowid . '>';
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center">' . $objp->ref . '</td>';
|
||||||
|
print '<td>' . $objp->ref_client . '</td>';
|
||||||
|
print '<td>' . price($objp->total_ht) . '</td>';
|
||||||
|
print '<td>' . $objp->name . '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
$this->db->free($resqllist);
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</div>';
|
||||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
|
if ($num > 0)
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
$this->db->free($resqlorderlist);
|
|
||||||
} else {
|
|
||||||
dol_print_error($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((in_array('fichinter',$restrictlinksto)) && ! empty($conf->ficheinter->enabled))
|
|
||||||
{
|
|
||||||
$linktoelem.=($linktoelem?' ':'').'<a href="#" id="linktoorder">' . $langs->trans('LinkedFichinter') . '</a>';
|
|
||||||
|
|
||||||
print '
|
|
||||||
<script type="text/javascript" language="javascript">
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
jQuery("#linktoorder").click(function() {
|
|
||||||
jQuery("#orderlist").toggle();
|
|
||||||
jQuery("#linktoorder").toggle();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
';
|
|
||||||
|
|
||||||
print '<div id="orderlist"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
|
||||||
|
|
||||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.client, f.rowid, f.ref";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
|
|
||||||
$sql .= ", " . MAIN_DB_PREFIX . "fichinter as f";
|
|
||||||
$sql .= ' WHERE f.fk_soc = s.rowid';
|
|
||||||
|
|
||||||
$resqlorderlist = $this->db->query($sql);
|
|
||||||
if ($resqlorderlist)
|
|
||||||
{
|
|
||||||
$num = $this->db->num_rows($resqlorderlist);
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
print '<br><form action="" method="POST" name="LinkedFichinter">';
|
|
||||||
print '<table class="noborder">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td class="nowrap"></td>';
|
|
||||||
print '<td align="center">' . $langs->trans("Ref") . '</td>';
|
|
||||||
print '<td align="left">' . $langs->trans("Company") . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
{
|
||||||
$objp = $this->db->fetch_object($resqlorderlist);
|
print '
|
||||||
|
<!-- Add js to show linkto box for '.$key.' ('.$num.' records) -->
|
||||||
$var = ! $var;
|
<script type="text/javascript" language="javascript">
|
||||||
print '<tr ' . $bc [$var] . '>';
|
jQuery(document).ready(function() {
|
||||||
print '<td aling="left">';
|
jQuery("#linkto'.$key.'").click(function() {
|
||||||
print '<input type="radio" name="LinkedFichinter" value=' . $objp->rowid . '>';
|
jQuery("#'.$key.'list").toggle();
|
||||||
print '<td align="center">' . $objp->ref . '</td>';
|
jQuery("#linkto'.$key.'").toggle();
|
||||||
print '<td>' . $objp->name . '</td>';
|
});
|
||||||
print '</td>';
|
});
|
||||||
print '</tr>';
|
</script>
|
||||||
|
';
|
||||||
$i ++;
|
}
|
||||||
}
|
|
||||||
print '</table>';
|
$linktoelem.=($linktoelem?' ':'');
|
||||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
|
if ($num > 0) $linktoelem.='<a href="#linkto'.$key.'" id="linkto'.$key.'">' . $langs->trans($possiblelink['label']) .' ('.$num.')</a>';
|
||||||
print '</form>';
|
//else $linktoelem.=$langs->trans($possiblelink['label']);
|
||||||
$this->db->free($resqlorderlist);
|
else $linktoelem.='<a href="#linkto'.$key.'" class="disabled" id="linkto'.$key.'">' . $langs->trans($possiblelink['label']) . '</a>';
|
||||||
} else {
|
|
||||||
dol_print_error($this->db);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((! is_array($restrictlinksto)) || in_array('supplier_order',$restrictlinksto))
|
|
||||||
&& ! empty($conf->fournisseur->enabled))
|
|
||||||
{
|
|
||||||
$linktoelem.=($linktoelem?' ':'').'<a href="#linktoorder" id="linktoorder">' . $langs->trans('LinkedOrder') . '</a>';
|
|
||||||
|
|
||||||
print '
|
|
||||||
<script type="text/javascript" language="javascript">
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
jQuery("#linktoorder").click(function() {
|
|
||||||
jQuery("#orderlist").toggle();
|
|
||||||
jQuery("#linktoorder").toggle();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
';
|
|
||||||
|
|
||||||
print '<div id="orderlist"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
|
||||||
|
|
||||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_supplier, c.total_ht";
|
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
|
|
||||||
$sql .= ", " . MAIN_DB_PREFIX . "commande_fournisseur as c";
|
|
||||||
$sql .= ' WHERE c.fk_soc = s.rowid AND c.fk_soc = ' . $object->thirdparty->id;
|
|
||||||
|
|
||||||
$resqlorderlist = $this->db->query($sql);
|
|
||||||
if ($resqlorderlist)
|
|
||||||
{
|
|
||||||
$num = $this->db->num_rows($resqlorderlist);
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
print '<br><form action="" method="POST" name="LinkedOrder">';
|
|
||||||
print '<table class="noborder">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td class="nowrap"></td>';
|
|
||||||
print '<td align="center">' . $langs->trans("Ref") . '</td>';
|
|
||||||
print '<td align="left">' . $langs->trans("RefSupplier") . '</td>';
|
|
||||||
print '<td align="left">' . $langs->trans("AmountHTShort") . '</td>';
|
|
||||||
print '<td align="left">' . $langs->trans("Company") . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $this->db->fetch_object($resqlorderlist);
|
|
||||||
|
|
||||||
$var = ! $var;
|
|
||||||
print '<tr ' . $bc [$var] . '>';
|
|
||||||
print '<td aling="left">';
|
|
||||||
print '<input type="radio" name="linkedOrder" value=' . $objp->rowid . '>';
|
|
||||||
print '</td>';
|
|
||||||
print '<td align="center">' . $objp->ref . '</td>';
|
|
||||||
print '<td>' . $objp->ref_supplier . '</td>';
|
|
||||||
print '<td>' . price($objp->total_ht) . '</td>';
|
|
||||||
print '<td>' . $objp->name . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
$i ++;
|
|
||||||
}
|
|
||||||
print '</table>';
|
|
||||||
print '<br><div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
|
|
||||||
print '</form>';
|
|
||||||
$this->db->free($resqlorderlist);
|
|
||||||
} else {
|
|
||||||
dol_print_error($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return $linktoelem;
|
return $linktoelem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5607,9 +5501,9 @@ class Form
|
|||||||
|
|
||||||
//print "xx".$previous_ref."x".$next_ref;
|
//print "xx".$previous_ref."x".$next_ref;
|
||||||
$ret.='<div style="vertical-align: middle">';
|
$ret.='<div style="vertical-align: middle">';
|
||||||
|
|
||||||
if ($morehtmlleft) $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
|
if ($morehtmlleft) $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
|
||||||
|
|
||||||
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
|
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
|
||||||
|
|
||||||
// For thirdparty and contact, the ref is the id, so we show something else
|
// For thirdparty and contact, the ref is the id, so we show something else
|
||||||
@ -5629,7 +5523,7 @@ class Form
|
|||||||
$ret.='</div>';
|
$ret.='</div>';
|
||||||
|
|
||||||
if ($morehtmlright) $ret.='<div class="inline-block floatleft">'.$morehtmlright.'</div>';
|
if ($morehtmlright) $ret.='<div class="inline-block floatleft">'.$morehtmlright.'</div>';
|
||||||
|
|
||||||
if ($previous_ref || $next_ref || $morehtml)
|
if ($previous_ref || $next_ref || $morehtml)
|
||||||
{
|
{
|
||||||
$ret.='<div class="pagination"><ul>';
|
$ret.='<div class="pagination"><ul>';
|
||||||
@ -5649,7 +5543,7 @@ class Form
|
|||||||
}
|
}
|
||||||
if ($morehtmlstatus) $ret.='<div class="statusref">'.$morehtmlstatus.'</div>';
|
if ($morehtmlstatus) $ret.='<div class="statusref">'.$morehtmlstatus.'</div>';
|
||||||
$ret.='</div>';
|
$ret.='</div>';
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5708,7 +5602,7 @@ class Form
|
|||||||
if ($modulepart=='societe')
|
if ($modulepart=='societe')
|
||||||
{
|
{
|
||||||
$dir=$conf->societe->multidir_output[$entity];
|
$dir=$conf->societe->multidir_output[$entity];
|
||||||
if (! empty($object->logo))
|
if (! empty($object->logo))
|
||||||
{
|
{
|
||||||
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
|
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
|
||||||
else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
|
else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
|
||||||
@ -5743,7 +5637,7 @@ class Form
|
|||||||
else if ($modulepart=='memberphoto')
|
else if ($modulepart=='memberphoto')
|
||||||
{
|
{
|
||||||
$dir=$conf->adherent->dir_output;
|
$dir=$conf->adherent->dir_output;
|
||||||
if (! empty($object->photo))
|
if (! empty($object->photo))
|
||||||
{
|
{
|
||||||
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
|
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
|
||||||
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
|
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
|
||||||
@ -5752,11 +5646,11 @@ class Form
|
|||||||
}
|
}
|
||||||
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
||||||
$email=$object->email;
|
$email=$object->email;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$dir=$conf->$modulepart->dir_output;
|
$dir=$conf->$modulepart->dir_output;
|
||||||
if (! empty($object->photo))
|
if (! empty($object->photo))
|
||||||
{
|
{
|
||||||
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
|
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
|
||||||
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
|
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
|
||||||
@ -5934,10 +5828,10 @@ class Form
|
|||||||
* @param int $addcheckuncheckall Add the check all/uncheck all checkbox (use javascript) and code to manage this
|
* @param int $addcheckuncheckall Add the check all/uncheck all checkbox (use javascript) and code to manage this
|
||||||
* @param string $cssclass CSS class
|
* @param string $cssclass CSS class
|
||||||
* @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes
|
* @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0)
|
function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$out='';
|
$out='';
|
||||||
|
|||||||
@ -619,6 +619,9 @@ class FormFile
|
|||||||
$out.= ' target="_blank">';
|
$out.= ' target="_blank">';
|
||||||
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
|
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
|
||||||
$out.= '</a>'."\n";
|
$out.= '</a>'."\n";
|
||||||
|
|
||||||
|
$out.= $this->showPreview($file,$modulepart,$relativepath);
|
||||||
|
|
||||||
$out.= '</td>';
|
$out.= '</td>';
|
||||||
|
|
||||||
// Show file size
|
// Show file size
|
||||||
@ -739,6 +742,8 @@ class FormFile
|
|||||||
$out.= img_mime($relativepath, $file["name"]);
|
$out.= img_mime($relativepath, $file["name"]);
|
||||||
$out.= '</a>'."\n";
|
$out.= '</a>'."\n";
|
||||||
|
|
||||||
|
$out.= $this->showPreview($file,$modulepart,$relativepath);
|
||||||
|
|
||||||
$this->infofiles['nboffiles']++;
|
$this->infofiles['nboffiles']++;
|
||||||
$this->infofiles['files'][]=$file['fullname'];
|
$this->infofiles['files'][]=$file['fullname'];
|
||||||
$ext=pathinfo($file["name"], PATHINFO_EXTENSION);
|
$ext=pathinfo($file["name"], PATHINFO_EXTENSION);
|
||||||
@ -859,6 +864,9 @@ class FormFile
|
|||||||
//print dol_trunc($file['name'],$maxlength,'middle');
|
//print dol_trunc($file['name'],$maxlength,'middle');
|
||||||
print $file['name'];
|
print $file['name'];
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
|
print $this->showPreview($file,$modulepart,$filepath);
|
||||||
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td align="right" width="80px">'.dol_print_size($file['size'],1,1).'</td>';
|
print '<td align="right" width="80px">'.dol_print_size($file['size'],1,1).'</td>';
|
||||||
print '<td align="center" width="130px">'.dol_print_date($file['date'],"dayhour","tzuser").'</td>';
|
print '<td align="center" width="130px">'.dol_print_date($file['date'],"dayhour","tzuser").'</td>';
|
||||||
@ -1320,5 +1328,30 @@ class FormFile
|
|||||||
return $nboflinks;
|
return $nboflinks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show detail icon with link for preview
|
||||||
|
* @param array $file File
|
||||||
|
* @param string $modulepart propal, facture, facture_fourn, ...
|
||||||
|
* @param string $relativepath Relative path of docs
|
||||||
|
* @return string $out Output string with HTML
|
||||||
|
*/
|
||||||
|
public function showPreview($file, $modulepart, $relativepath){
|
||||||
|
global $langs, $conf;
|
||||||
|
|
||||||
|
if (empty($conf->use_javascript_ajax)) return '';
|
||||||
|
|
||||||
|
$out='';
|
||||||
|
|
||||||
|
$mime_preview = array('jpeg', 'png', 'gif', 'tiff', 'pdf', 'plain', 'css');
|
||||||
|
$num_mime = array_search(dol_mimetype($file['name'], '', 1), $mime_preview);
|
||||||
|
|
||||||
|
if( $num_mime!== false){
|
||||||
|
$out.= ' <a href="javascript:document_preview(\''.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).'\',\''.dol_mimetype($file['name']).'\', \''.$file['name'].'\')">';
|
||||||
|
$out.= img_picto($langs->trans('Preview'), 'detail').'</a>';
|
||||||
|
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -149,7 +149,7 @@ class FormProjets
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$minmax='';
|
$minmax='maxwidth500';
|
||||||
|
|
||||||
// Use select2 selector
|
// Use select2 selector
|
||||||
$nodatarole='';
|
$nodatarole='';
|
||||||
@ -314,7 +314,7 @@ class FormProjets
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$minmax='';
|
$minmax='maxwidth500';
|
||||||
|
|
||||||
// Use select2 selector
|
// Use select2 selector
|
||||||
$nodatarole='';
|
$nodatarole='';
|
||||||
@ -324,7 +324,7 @@ class FormProjets
|
|||||||
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
|
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
|
||||||
$out.=$comboenhancement;
|
$out.=$comboenhancement;
|
||||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||||
$minmax='minwidth200';
|
$minmax='minwidth200 maxwidth500';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($option_only)) {
|
if (empty($option_only)) {
|
||||||
|
|||||||
@ -948,6 +948,65 @@ function copyToClipboard(text,text2)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function show document preview
|
||||||
|
* @params string file File path
|
||||||
|
* @params string type mime file
|
||||||
|
* @params string title
|
||||||
|
*/
|
||||||
|
function document_preview(file, type, title){
|
||||||
|
|
||||||
|
var ValidImageTypes = ["image/gif", "image/jpeg", "image/png"];
|
||||||
|
|
||||||
|
if ($.inArray(type, ValidImageTypes) < 0) {
|
||||||
|
var width='85%';
|
||||||
|
var object_width='100%';
|
||||||
|
var height = $( window ).height()*0.90;
|
||||||
|
var object_height='98%';
|
||||||
|
|
||||||
|
show_preview();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var object_width=0;
|
||||||
|
var object_height=0;
|
||||||
|
|
||||||
|
var img = new Image();
|
||||||
|
|
||||||
|
img.onload = function() {
|
||||||
|
object_width = this.width;
|
||||||
|
object_height = this.height;
|
||||||
|
|
||||||
|
width = $( window ).width()*0.90;
|
||||||
|
if(object_width < width){
|
||||||
|
width = object_width + 30
|
||||||
|
}
|
||||||
|
height = $( window ).height()*0.85;
|
||||||
|
if(object_height < height){
|
||||||
|
height = object_height + 80
|
||||||
|
}
|
||||||
|
|
||||||
|
show_preview();
|
||||||
|
|
||||||
|
};
|
||||||
|
img.src = file;
|
||||||
|
|
||||||
|
}
|
||||||
|
function show_preview(){
|
||||||
|
|
||||||
|
var newElem = '<object data="'+file+'" type="'+type+'" width="'+object_width+'" height="'+object_height+'"></object>';
|
||||||
|
|
||||||
|
$("#dialogforpopup").html(newElem);
|
||||||
|
$("#dialogforpopup").dialog({
|
||||||
|
closeOnEscape: true,
|
||||||
|
resizable: true,
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
modal: true,
|
||||||
|
title: title
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Provide a function to get an URL GET parameter in javascript
|
* Provide a function to get an URL GET parameter in javascript
|
||||||
*
|
*
|
||||||
|
|||||||
@ -261,7 +261,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->rights[$r][4] = 'commande';
|
$this->rights[$r][4] = 'commande';
|
||||||
$this->rights[$r][5] = 'export';
|
$this->rights[$r][5] = 'export';
|
||||||
|
|
||||||
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL))
|
if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED))
|
||||||
{
|
{
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 1190;
|
$this->rights[$r][0] = 1190;
|
||||||
@ -449,7 +449,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->export_permission[$r]=array(array("fournisseur","commande","export"));
|
$this->export_permission[$r]=array(array("fournisseur","commande","export"));
|
||||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.date_approve'=>'DateApprove','f.date_approve2'=>'DateApprove2','f.note_public'=>"NotePublic",'f.note_private'=>"NotePrivate",'ua1.login'=>'ApprovedBy','ua2.login'=>'ApprovedBy2','fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId',
|
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.date_approve'=>'DateApprove','f.date_approve2'=>'DateApprove2','f.note_public'=>"NotePublic",'f.note_private'=>"NotePrivate",'ua1.login'=>'ApprovedBy','ua2.login'=>'ApprovedBy2','fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId',
|
||||||
'p.ref'=>'ProductRef','p.label'=>'ProductLabel','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel');
|
'p.ref'=>'ProductRef','p.label'=>'ProductLabel','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel');
|
||||||
if (empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL))
|
if (empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED))
|
||||||
{
|
{
|
||||||
unset($this->export_fields_array['f.date_approve2']);
|
unset($this->export_fields_array['f.date_approve2']);
|
||||||
unset($this->export_fields_array['ua2.login']);
|
unset($this->export_fields_array['ua2.login']);
|
||||||
|
|||||||
@ -37,6 +37,16 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
|||||||
var $prefix='CF';
|
var $prefix='CF';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 5.0) $this->prefix = 'PO'; // We use correct standard code "PO = Purchase Order"
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return description of numbering module
|
* Return description of numbering module
|
||||||
*
|
*
|
||||||
|
|||||||
@ -144,6 +144,19 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->propal->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL))
|
||||||
|
{
|
||||||
|
$object->fetchObjectLinked('','propal',$object->id,$object->element);
|
||||||
|
if (! empty($object->linkedObjects))
|
||||||
|
{
|
||||||
|
foreach($object->linkedObjects['propal'] as $element)
|
||||||
|
{
|
||||||
|
$ret=$element->classifyBilled($user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// classify supplier order delivery status
|
// classify supplier order delivery status
|
||||||
|
|||||||
@ -1836,8 +1836,8 @@ else if ($id || $ref)
|
|||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
//$linktoelem = $form->showLinkToObjectBlock($object);
|
//$linktoelem = $form->showLinkToObjectBlock($object);
|
||||||
//if ($linktoelem) print '<br>'.$linktoelem;
|
//if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -831,6 +831,7 @@ if ($action == "addline" && $user->rights->expensereport->creer)
|
|||||||
|
|
||||||
$object_ligne = new ExpenseReportLine($db);
|
$object_ligne = new ExpenseReportLine($db);
|
||||||
|
|
||||||
|
$vatrate = GETPOST('vatrate');
|
||||||
$object_ligne->comments = GETPOST('comments');
|
$object_ligne->comments = GETPOST('comments');
|
||||||
$qty = GETPOST('qty','int');
|
$qty = GETPOST('qty','int');
|
||||||
if (empty($qty)) $qty=1;
|
if (empty($qty)) $qty=1;
|
||||||
@ -843,10 +844,13 @@ if ($action == "addline" && $user->rights->expensereport->creer)
|
|||||||
|
|
||||||
$object_ligne->fk_c_type_fees = GETPOST('fk_c_type_fees');
|
$object_ligne->fk_c_type_fees = GETPOST('fk_c_type_fees');
|
||||||
|
|
||||||
$object_ligne->fk_c_tva = GETPOST('fk_c_tva');
|
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
|
||||||
|
if (empty($vatrate)) $vatrate = "0.000";
|
||||||
|
|
||||||
$object_ligne->vatrate = price2num($vatrate);
|
$object_ligne->vatrate = price2num($vatrate);
|
||||||
|
|
||||||
$object_ligne->fk_projet = $fk_projet;
|
$object_ligne->fk_projet = $fk_projet;
|
||||||
|
|
||||||
|
|
||||||
if (! GETPOST('fk_c_type_fees') > 0)
|
if (! GETPOST('fk_c_type_fees') > 0)
|
||||||
{
|
{
|
||||||
@ -854,10 +858,11 @@ if ($action == "addline" && $user->rights->expensereport->creer)
|
|||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '')
|
|
||||||
|
if ($vatrate < 0 || $vatrate == '')
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("VAT")), null, 'errors');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1096,7 +1101,7 @@ if ($action == 'create')
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">'.$langs->trans("DateStart").'</td>';
|
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("DateStart").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1);
|
$form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1211,7 +1216,7 @@ else
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1374,7 +1379,7 @@ else
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1683,7 +1688,8 @@ else
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '<td style="text-align:center;">'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).'</td>';
|
// print '<td style="text-align:center;">'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).'</td>';
|
||||||
|
print '<td style="text-align:center;">'.($langs->trans(($objp->type_fees_code)) == $objp->type_fees_code ? $objp->type_fees_libelle : $langs->trans(($objp->type_fees_code))).'</td>';
|
||||||
print '<td style="text-align:left;">'.$objp->comments.'</td>';
|
print '<td style="text-align:left;">'.$objp->comments.'</td>';
|
||||||
print '<td style="text-align:right;">'.vatrate($objp->vatrate,true).'</td>';
|
print '<td style="text-align:right;">'.vatrate($objp->vatrate,true).'</td>';
|
||||||
print '<td style="text-align:right;">'.price($objp->value_unit).'</td>';
|
print '<td style="text-align:right;">'.price($objp->value_unit).'</td>';
|
||||||
@ -1789,7 +1795,7 @@ else
|
|||||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||||
if (! empty($conf->projet->enabled)) print '<td>'.$langs->trans('Project').'</td>';
|
if (! empty($conf->projet->enabled)) print '<td>'.$langs->trans('Project').'</td>';
|
||||||
print '<td align="center">'.$langs->trans('Type').'</td>';
|
print '<td align="center">'.$langs->trans('Type').'</td>';
|
||||||
print '<td>'.$langs->trans('Description').'</td>';
|
print '<td colspan="2">'.$langs->trans('Description').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('VAT').'</td>';
|
print '<td align="right">'.$langs->trans('VAT').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('PriceUTTC').'</td>';
|
print '<td align="right">'.$langs->trans('PriceUTTC').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||||
@ -1818,7 +1824,7 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Add comments
|
// Add comments
|
||||||
print '<td>';
|
print '<td colspan="2">';
|
||||||
print '<textarea class="flat_ndf centpercent" name="comments">'.$comments.'</textarea>';
|
print '<textarea class="flat_ndf centpercent" name="comments">'.$comments.'</textarea>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -2068,11 +2074,9 @@ if ($action != 'create' && $action != 'edit' && ($id || $ref))
|
|||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelements=array();
|
$linktoelements=array();
|
||||||
if($conf->global->EXPENSES_LINK_TO_INTERVENTION) $linktoelements[]='fichinter';
|
if (! empty($conf->global->EXPENSES_LINK_TO_INTERVENTION)) $linktoelements[]='fichinter';
|
||||||
$linktoelem='';
|
$linktoelem = $form->showLinkToObjectBlock($object, $linktoelements, array('expensereport'));
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object,$linktoelements);
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
if ($linktoelem) print '<br>'.$linktoelem;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ $result = restrictedArea($user, 'expensereport', $id, '');
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader('', $langs->trans("ExpenseReport"));
|
||||||
|
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1681,9 +1681,9 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
$somethingshown = $form->showLinkedObjectBlock($object);
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
//$linktoelem = $form->showLinkToObjectBlock($object);
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter'));
|
||||||
//if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
public $date;
|
public $date;
|
||||||
public $date_valid;
|
public $date_valid;
|
||||||
public $date_approve;
|
public $date_approve;
|
||||||
public $date_approve2; // Used when SUPPLIER_ORDER_DOUBLE_APPROVAL is set
|
public $date_approve2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set
|
||||||
public $date_commande;
|
public $date_commande;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,7 +101,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
public $user_author_id;
|
public $user_author_id;
|
||||||
public $user_valid_id;
|
public $user_valid_id;
|
||||||
public $user_approve_id;
|
public $user_approve_id;
|
||||||
public $user_approve_id2; // Used when SUPPLIER_ORDER_DOUBLE_APPROVAL is set
|
public $user_approve_id2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set
|
||||||
|
|
||||||
//Incoterms
|
//Incoterms
|
||||||
public $fk_incoterms;
|
public $fk_incoterms;
|
||||||
@ -718,7 +718,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
*
|
*
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param int $idwarehouse Id of warhouse for stock change
|
* @param int $idwarehouse Id of warhouse for stock change
|
||||||
* @param int $secondlevel 0=Standard approval, 1=Second level approval (used when option SUPPLIER_ORDER_DOUBLE_APPROVAL is set)
|
* @param int $secondlevel 0=Standard approval, 1=Second level approval (used when option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function approve($user, $idwarehouse=0, $secondlevel=0)
|
public function approve($user, $idwarehouse=0, $secondlevel=0)
|
||||||
@ -761,7 +761,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
{
|
{
|
||||||
$sql.= " date_approve='".$this->db->idate($now)."',";
|
$sql.= " date_approve='".$this->db->idate($now)."',";
|
||||||
$sql.= " fk_user_approve = ".$user->id;
|
$sql.= " fk_user_approve = ".$user->id;
|
||||||
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $this->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)
|
if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $this->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
|
||||||
{
|
{
|
||||||
if (empty($this->user_approve_id2))
|
if (empty($this->user_approve_id2))
|
||||||
{
|
{
|
||||||
@ -1081,6 +1081,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql.= ", note_public";
|
$sql.= ", note_public";
|
||||||
$sql.= ", entity";
|
$sql.= ", entity";
|
||||||
$sql.= ", fk_soc";
|
$sql.= ", fk_soc";
|
||||||
|
$sql.= ", fk_projet";
|
||||||
$sql.= ", date_creation";
|
$sql.= ", date_creation";
|
||||||
$sql.= ", date_livraison";
|
$sql.= ", date_livraison";
|
||||||
$sql.= ", fk_user_author";
|
$sql.= ", fk_user_author";
|
||||||
@ -1102,6 +1103,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql.= ", '".$this->db->escape($this->note_public)."'";
|
$sql.= ", '".$this->db->escape($this->note_public)."'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ", ".$this->socid;
|
$sql.= ", ".$this->socid;
|
||||||
|
$sql.= ", ".($this->fk_project > 0 ? $this->fk_project : "null");
|
||||||
$sql.= ", '".$this->db->idate($now)."'";
|
$sql.= ", '".$this->db->idate($now)."'";
|
||||||
$sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null");
|
$sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null");
|
||||||
$sql.= ", ".$user->id;
|
$sql.= ", ".$user->id;
|
||||||
|
|||||||
@ -971,7 +971,8 @@ if (empty($reshook))
|
|||||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||||
$object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int');
|
$object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int');
|
||||||
|
$object->fk_project = GETPOST('projectid');
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -2659,7 +2660,7 @@ elseif (! empty($object->id))
|
|||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->commande->approuver)
|
if ($user->rights->fournisseur->commande->approuver)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL && ! empty($object->user_approve_id))
|
if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && ! empty($object->user_approve_id))
|
||||||
{
|
{
|
||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("FirstApprovalAlreadyDone")).'">'.$langs->trans("ApproveOrder").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("FirstApprovalAlreadyDone")).'">'.$langs->trans("ApproveOrder").'</a>';
|
||||||
}
|
}
|
||||||
@ -2674,8 +2675,8 @@ elseif (! empty($object->id))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second approval (if option SUPPLIER_ORDER_DOUBLE_APPROVAL is set)
|
// Second approval (if option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set)
|
||||||
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)
|
if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
|
||||||
{
|
{
|
||||||
if ($object->statut == 1)
|
if ($object->statut == 1)
|
||||||
{
|
{
|
||||||
@ -2732,7 +2733,7 @@ elseif (! empty($object->id))
|
|||||||
$buttonshown++;
|
$buttonshown++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! $buttonshown && $user->rights->fournisseur->commande->approve2 && ! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL))
|
if (! $buttonshown && $user->rights->fournisseur->commande->approve2 && ! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED))
|
||||||
{
|
{
|
||||||
if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY)
|
if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY)
|
||||||
|| (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) && $user->id == $object->user_approve_id2))
|
|| (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) && $user->id == $object->user_approve_id2))
|
||||||
@ -2834,8 +2835,8 @@ elseif (! empty($object->id))
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
$somethingshown = $form->showLinkedObjectBlock($object);
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
//$linktoelem = $form->showLinkToObjectBlock($object);
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('order_supplier'));
|
||||||
//if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|||||||
@ -2240,9 +2240,9 @@ else
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
$somethingshown = $form->showLinkedObjectBlock($object);
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object,array('supplier_order'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice_supplier'));
|
||||||
if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
//print '</td><td valign="top" width="50%">';
|
//print '</td><td valign="top" width="50%">';
|
||||||
|
|||||||
@ -546,19 +546,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
/*
|
print "</tr>\n";
|
||||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref,f.rowid","",$param,"",$sortfield,$sortorder);
|
|
||||||
if (empty($conf->global->SUPPLIER_INVOICE_HIDE_REF_SUPPLIER)) print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"ref_supplier","",$param,"",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef,f.rowid","",$param,'align="center"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"f.libelle","",$param,"",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
|
||||||
if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","",$param,'align="right"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
|
||||||
*/ print "</tr>\n";
|
|
||||||
|
|
||||||
// Line for filters
|
// Line for filters
|
||||||
|
|
||||||
|
|||||||
@ -179,7 +179,7 @@ FeatureDisabledInDemo=Feature disabled in demo
|
|||||||
Rights=Permissions
|
Rights=Permissions
|
||||||
BoxesDesc=Widgets are components showing some information that you can add to personalize some pages. You can choose between showing the widget or not by selecting target page and clicking 'Activate', or by clicking the dustbin to disable it.
|
BoxesDesc=Widgets are components showing some information that you can add to personalize some pages. You can choose between showing the widget or not by selecting target page and clicking 'Activate', or by clicking the dustbin to disable it.
|
||||||
OnlyActiveElementsAreShown=Only elements from <a href="%s">enabled modules</a> are shown.
|
OnlyActiveElementsAreShown=Only elements from <a href="%s">enabled modules</a> are shown.
|
||||||
ModulesDesc=Dolibarr modules define which functionality is enabled in software. Some modules require permissions you must grant to users, after enabling module. Click on button on/off in column "Status" to enable a module/feature.
|
ModulesDesc=Dolibarr modules define which functionality is enabled in software. Some modules require permissions you must grant to users, after enabling module. Click on button on/off to enable a module/feature.
|
||||||
ModulesMarketPlaceDesc=You can find more modules to download on external websites on the Internet...
|
ModulesMarketPlaceDesc=You can find more modules to download on external websites on the Internet...
|
||||||
ModulesMarketPlaces=More modules...
|
ModulesMarketPlaces=More modules...
|
||||||
DoliStoreDesc=DoliStore, the official market place for Dolibarr ERP/CRM external modules
|
DoliStoreDesc=DoliStore, the official market place for Dolibarr ERP/CRM external modules
|
||||||
@ -390,6 +390,8 @@ EnableAndSetupModuleCron=If you want to have this recurring invoice beeing gener
|
|||||||
ModuleCompanyCodeAquarium=Return an accountancy code built by:<br>%s followed by third party supplier code for a supplier accountancy code,<br>%s followed by third party customer code for a customer accountancy code.
|
ModuleCompanyCodeAquarium=Return an accountancy code built by:<br>%s followed by third party supplier code for a supplier accountancy code,<br>%s followed by third party customer code for a customer accountancy code.
|
||||||
ModuleCompanyCodePanicum=Return an empty accountancy code.
|
ModuleCompanyCodePanicum=Return an empty accountancy code.
|
||||||
ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code.
|
ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code.
|
||||||
|
Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce an third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1 validation, 2=first approval and 3=second approval if amount is enough).<br>Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval is always required.
|
||||||
|
UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than...
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
Module0Name=Users & groups
|
Module0Name=Users & groups
|
||||||
|
|||||||
@ -256,6 +256,7 @@ DurationDays=days
|
|||||||
Year=Year
|
Year=Year
|
||||||
Month=Month
|
Month=Month
|
||||||
Week=Week
|
Week=Week
|
||||||
|
WeekShort=Week
|
||||||
Day=Day
|
Day=Day
|
||||||
Hour=Hour
|
Hour=Hour
|
||||||
Minute=Minute
|
Minute=Minute
|
||||||
@ -643,6 +644,14 @@ NewAttribute=New attribute
|
|||||||
AttributeCode=Attribute code
|
AttributeCode=Attribute code
|
||||||
URLPhoto=URL of photo/logo
|
URLPhoto=URL of photo/logo
|
||||||
SetLinkToAnotherThirdParty=Link to another third party
|
SetLinkToAnotherThirdParty=Link to another third party
|
||||||
|
LinkToProposal=Link to proposal
|
||||||
|
LinkToOrder=Link to order
|
||||||
|
LinkToInvoice=Link to invoice
|
||||||
|
LinkToSupplierOrder=Link to supplier order
|
||||||
|
LinkToSupplierProposal=Link to supplier proposal
|
||||||
|
LinkToSupplierInvoice=Link to supplier invoice
|
||||||
|
LinkToContract=Link to contract
|
||||||
|
LinkToIntervention=Link to intervention
|
||||||
CreateDraft=Create draft
|
CreateDraft=Create draft
|
||||||
SetToDraft=Back to draft
|
SetToDraft=Back to draft
|
||||||
ClickToEdit=Click to edit
|
ClickToEdit=Click to edit
|
||||||
|
|||||||
@ -174,7 +174,7 @@ ProjectOpenedProjectByOppStatus=Open project/lead by opportunity status
|
|||||||
ProjectsStatistics=Statistics on projects/leads
|
ProjectsStatistics=Statistics on projects/leads
|
||||||
TaskAssignedToEnterTime=Task assigned. Entering time on this task should be possible.
|
TaskAssignedToEnterTime=Task assigned. Entering time on this task should be possible.
|
||||||
IdTaskTime=Id task time
|
IdTaskTime=Id task time
|
||||||
YouCanCompleteRef=If you want to complete the ref with some information (to use it as search filters), it is recommanded to add a - character to separate it, so the automatic numbering will still work correctly for next projects. For example %s-ABC. You may also prefer to add search keys into label.
|
YouCanCompleteRef=If you want to complete the ref with some information (to use it as search filters), it is recommanded to add a - character to separate it, so the automatic numbering will still work correctly for next projects. For example %s-ABC. You may also prefer to add search keys into label. But best practice may be to add a dedicated field, also called complementary attributes.
|
||||||
OpenedProjectsByThirdparties=Open projects by thirdparties
|
OpenedProjectsByThirdparties=Open projects by thirdparties
|
||||||
OnlyOpportunitiesShort=Only opportunities
|
OnlyOpportunitiesShort=Only opportunities
|
||||||
OpenedOpportunitiesShort=Open opportunities
|
OpenedOpportunitiesShort=Open opportunities
|
||||||
|
|||||||
@ -36,7 +36,6 @@ ListOfSupplierOrders=List of supplier orders
|
|||||||
MenuOrdersSupplierToBill=Supplier orders to invoice
|
MenuOrdersSupplierToBill=Supplier orders to invoice
|
||||||
NbDaysToDelivery=Delivery delay in days
|
NbDaysToDelivery=Delivery delay in days
|
||||||
DescNbDaysToDelivery=The biggest deliver delay of the products from this order
|
DescNbDaysToDelivery=The biggest deliver delay of the products from this order
|
||||||
UseDoubleApproval=Use double approval when amount (without tax) is higher than (The second approval can be done by any user with the dedicated permission. Set to 0 for no double approval)
|
|
||||||
SupplierReputation=Supplier reputation
|
SupplierReputation=Supplier reputation
|
||||||
DoNotOrderThisProductToThisSupplier=Do not order
|
DoNotOrderThisProductToThisSupplier=Do not order
|
||||||
NotTheGoodQualitySupplier=Wrong quality
|
NotTheGoodQualitySupplier=Wrong quality
|
||||||
|
|||||||
@ -9,4 +9,5 @@ descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice af
|
|||||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid
|
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid
|
||||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid
|
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid
|
||||||
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated
|
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated
|
||||||
|
descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer invoice is validated
|
||||||
descWORKFLOW_SUPPLIER_ORDER_CLASSIFY_RECEIPT_ORDER=Classify supplier order status to Partially or Totally delivered on manual stock dispatch
|
descWORKFLOW_SUPPLIER_ORDER_CLASSIFY_RECEIPT_ORDER=Classify supplier order status to Partially or Totally delivered on manual stock dispatch
|
||||||
@ -50,6 +50,7 @@ if (! $sortorder) $sortorder="DESC";
|
|||||||
if (! $sortfield) $sortfield="f.datef";
|
if (! $sortfield) $sortfield="f.datef";
|
||||||
|
|
||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
|
if ($socid > 0) $object->fetch($socid);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('thirdpartymargins','globalcard'));
|
$hookmanager->initHooks(array('thirdpartymargins','globalcard'));
|
||||||
@ -72,8 +73,10 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
$invoicestatic=new Facture($db);
|
$invoicestatic=new Facture($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title=$langs->trans("ThirdParty").' - '.$langs->trans("Margins");
|
||||||
|
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Files");
|
||||||
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||||
llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Margins"),$help_url);
|
llxHeader('',$title,$help_url);
|
||||||
|
|
||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -366,8 +366,8 @@ print '<tr><td class="fieldrequired">'.$langs->trans("Fieldimport_key").'</td><t
|
|||||||
// Example 2 : Adding links to objects
|
// Example 2 : Adding links to objects
|
||||||
//$somethingshown=$form->showLinkedObjectBlock($object);
|
//$somethingshown=$form->showLinkedObjectBlock($object);
|
||||||
//$linktoelem = $form->showLinkToObjectBlock($object);
|
//$linktoelem = $form->showLinkToObjectBlock($object);
|
||||||
//if ($linktoelem) print '<br>'.$linktoelem;
|
//if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -292,7 +292,7 @@ $param=($mode?'&mode='.$mode:'');
|
|||||||
|
|
||||||
// Show navigation bar
|
// Show navigation bar
|
||||||
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
||||||
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week." </span>\n";
|
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("WeekShort")." ".$week." </span>\n";
|
||||||
$nav.="<a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
|
$nav.="<a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
|
||||||
$nav.=" (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
$nav.=" (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
||||||
$nav.='<br>'.$form->select_date(-1,'',0,0,2,"addtime",1,0,1).' ';
|
$nav.='<br>'.$form->select_date(-1,'',0,0,2,"addtime",1,0,1).' ';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2011-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
@ -373,7 +373,7 @@ print '<br>';
|
|||||||
* Projects Numbering model
|
* Projects Numbering model
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ProjectsNumberingModules"));
|
print load_fiche_titre($langs->trans("ProjectsNumberingModules"), '', '');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -477,7 +477,7 @@ print '</table><br>';
|
|||||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||||
{
|
{
|
||||||
// Task numbering module
|
// Task numbering module
|
||||||
print load_fiche_titre($langs->trans("TasksNumberingModules"));
|
print load_fiche_titre($langs->trans("TasksNumberingModules"), '', '');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -583,7 +583,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
* Document templates generators
|
* Document templates generators
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ProjectsModelModule"));
|
print load_fiche_titre($langs->trans("ProjectsModelModule"), '', '');
|
||||||
|
|
||||||
// Defini tableau def de modele
|
// Defini tableau def de modele
|
||||||
$type='project';
|
$type='project';
|
||||||
@ -742,7 +742,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
* Modeles documents for Task
|
* Modeles documents for Task
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("TaskModelModule"));
|
print load_fiche_titre($langs->trans("TaskModelModule"), '', '');
|
||||||
|
|
||||||
// Defini tableau def de modele
|
// Defini tableau def de modele
|
||||||
$type='project_task';
|
$type='project_task';
|
||||||
@ -894,7 +894,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("Other"));
|
print load_fiche_titre($langs->trans("Other"), '', '');
|
||||||
|
|
||||||
// Other options
|
// Other options
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -499,7 +499,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
// Public
|
// Public
|
||||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
$array=array(0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject"));
|
$array=array(0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject"));
|
||||||
print $form->selectarray('public',$array,$object->public);
|
print $form->selectarray('public',$array,GETPOST('public')?GETPOST('public'):(isset($conf->global->PROJECT_DEFAULT_PUBLIC)?$conf->global->PROJECT_DEFAULT_PUBLIC:$object->public));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
@ -517,7 +517,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
// Opportunity status
|
// Opportunity status
|
||||||
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td>';
|
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formproject->selectOpportunityStatus('opp_status',$object->opp_status);
|
print $formproject->selectOpportunityStatus('opp_status', GETPOST('opp_status')?GETPOST('opp_status'):$object->opp_status);
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Opportunity probability
|
// Opportunity probability
|
||||||
|
|||||||
@ -888,7 +888,7 @@ foreach ($listofreferent as $key => $value)
|
|||||||
|
|
||||||
if (canApplySubtotalOn($tablename))
|
if (canApplySubtotalOn($tablename))
|
||||||
{
|
{
|
||||||
$breakline='<tr class="liste_total">';
|
$breakline='<tr class="liste_total liste_sub_total">';
|
||||||
$breakline.='<td colspan="2">';
|
$breakline.='<td colspan="2">';
|
||||||
$breakline.='</td>';
|
$breakline.='</td>';
|
||||||
$breakline.='<td>';
|
$breakline.='<td>';
|
||||||
|
|||||||
@ -57,8 +57,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title=$langs->trans("ThirdParty").' - '.$langs->trans("Notes");
|
||||||
|
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Files");
|
||||||
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||||
llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Notes"),$help_url);
|
llxHeader('',$title,$help_url);
|
||||||
|
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1809,9 +1809,10 @@ if ($action == 'create')
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object);
|
$somethingshown = $form->showLinkedObjectBlock($object);
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
//$linktoelem = $form->showLinkToObjectBlock($object);
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_proposal'));
|
||||||
//if ($linktoelem) print '<br>'.$linktoelem;
|
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 223 B |
@ -2763,6 +2763,9 @@ input.liste_titre {
|
|||||||
form.liste_total div {
|
form.liste_total div {
|
||||||
border-top: 1px solid #DDDDDD;
|
border-top: 1px solid #DDDDDD;
|
||||||
}
|
}
|
||||||
|
tr.liste_sub_total, tr.liste_sub_total td {
|
||||||
|
border-bottom: 2px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
.tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair {
|
.tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair {
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 223 B |
@ -2645,7 +2645,9 @@ input.liste_titre {
|
|||||||
padding: 4px;
|
padding: 4px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
tr.liste_sub_total, tr.liste_sub_total td {
|
||||||
|
border-bottom: 2px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
.tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair {
|
.tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair {
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user