Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 4.0
This commit is contained in:
commit
bfa8630feb
@ -10,7 +10,7 @@ php:
|
|||||||
- '5.3'
|
- '5.3'
|
||||||
- '5.4'
|
- '5.4'
|
||||||
- '5.5'
|
- '5.5'
|
||||||
- '5.6'
|
- '5.6.29'
|
||||||
- '7.0'
|
- '7.0'
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
|
|||||||
22
ChangeLog
22
ChangeLog
@ -12,6 +12,28 @@ Upgrading to any other version or any other database system is abolutely require
|
|||||||
make a Dolibarr upgrade.
|
make a Dolibarr upgrade.
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 4.0.6 to 4.0.5 *****
|
||||||
|
FIX: #6613 Default subject for Supplier proposal emails is filled with a non-existing key
|
||||||
|
FIX: #6623 User card shows "Return to list" link even if the user has no rights to list users
|
||||||
|
FIX: #6636 Complete fix
|
||||||
|
FIX: #6669 User with no permission to edit customer invoices can see a edit button in project entry
|
||||||
|
FIX: #6671 Cannot remove thirdparty type with "#" in its name
|
||||||
|
FIX: #6673 Missing "nature" table header in thirdparty list
|
||||||
|
FIX: #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list
|
||||||
|
FIX: #6677 Expired contracts dashboard box does not show the name of the thirdparty
|
||||||
|
FIX: #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode
|
||||||
|
FIX: #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it
|
||||||
|
FIX: #6813
|
||||||
|
FIX: Correction with author and validator user on orders
|
||||||
|
FIX: doactions hook missing in invoice model page
|
||||||
|
FIX: dont get empty "Incoterms : - " string if no incoterm
|
||||||
|
FIX: dont lose supplier ref if no supplier price in database
|
||||||
|
FIX: forgotten parameter for right multicompany use
|
||||||
|
FIX: global $dateSelector isn't the good one, then date selector on objectline_create tpl was hidden
|
||||||
|
FIX: limit+1 dosn't show Total line
|
||||||
|
FIX: supplier order line were always created with rang = 0
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 4.0.5 to 4.0.4 *****
|
***** ChangeLog for 4.0.5 to 4.0.4 *****
|
||||||
FIX: #6234
|
FIX: #6234
|
||||||
FIX: #6259
|
FIX: #6259
|
||||||
|
|||||||
@ -353,10 +353,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
// TODO Copy file or ask to install package ?
|
// TODO Copy file or ask to install package ?
|
||||||
//CustomMessage('YouWillInstallDoliWamp')+#13#13
|
//CustomMessage('YouWillInstallDoliWamp')+#13#13
|
||||||
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://ccc">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
|
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30679">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
|
||||||
end;
|
end;
|
||||||
|
// Pb seems similar with msvcp110.dll
|
||||||
|
//vcredist_x64.exe
|
||||||
|
|
||||||
|
|
||||||
// If we have a new database version, we should only copy old my.ini file into new directory
|
// If we have a new database version, we should only copy old my.ini file into new directory
|
||||||
// and change only all basedir= strings to use new version. Like this, data dir is still correct.
|
// and change only all basedir= strings to use new version. Like this, data dir is still correct.
|
||||||
// Install of service and stop/start scripts are already rebuild by installer.
|
// Install of service and stop/start scripts are already rebuild by installer.
|
||||||
|
|||||||
@ -19,7 +19,7 @@ use Cwd;
|
|||||||
# Change this to defined target for option 98 and 99
|
# Change this to defined target for option 98 and 99
|
||||||
$PROJECT="dolibarr";
|
$PROJECT="dolibarr";
|
||||||
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||||
$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||||
|
|
||||||
|
|
||||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||||
@ -518,6 +518,7 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/forceproject*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
||||||
|
|||||||
@ -282,6 +282,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$refcomp=$societestatic->getNomUrl(1,'',24);
|
$refcomp=$societestatic->getNomUrl(1,'',24);
|
||||||
|
|
||||||
$paiement = $facturestatic->getSommePaiement(); // Payment already done
|
$paiement = $facturestatic->getSommePaiement(); // Payment already done
|
||||||
|
$paiement+= $facturestatic->getSumDepositsUsed();
|
||||||
|
$paiement+= $facturestatic->getSumCreditNotesUsed();
|
||||||
}
|
}
|
||||||
if ($obj->family == 'social_contribution')
|
if ($obj->family == 'social_contribution')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1998,7 +1998,7 @@ if ($action == 'create')
|
|||||||
if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts();
|
if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts();
|
||||||
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null));
|
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null));
|
||||||
$note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null));
|
$note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null));
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax))
|
if (! empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
@ -2197,7 +2197,7 @@ if ($action == 'create')
|
|||||||
if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid))))
|
if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid))))
|
||||||
{
|
{
|
||||||
// Deposit
|
// Deposit
|
||||||
if (empty($conf->global->INVOICE_DISABLE_DEPOSIT))
|
if (empty($conf->global->INVOICE_DISABLE_DEPOSIT))
|
||||||
{
|
{
|
||||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||||
$tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> ';
|
$tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> ';
|
||||||
@ -2208,7 +2208,7 @@ if ($action == 'create')
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
$desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3);
|
$desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3);
|
||||||
print '<table class="nobordernopadding"><tr><td>';
|
print '<table class="nobordernopadding"><tr><td>';
|
||||||
print $desc;
|
print $desc;
|
||||||
@ -2222,7 +2222,7 @@ if ($action == 'create')
|
|||||||
print '<td class="nowrap" style="padding-left: 5px">' . $langs->trans('Value') . ':<input type="text" id="valuedeposit" name="valuedeposit" size="3" value="' . GETPOST('valuedeposit', 'int') . '"/>';
|
print '<td class="nowrap" style="padding-left: 5px">' . $langs->trans('Value') . ':<input type="text" id="valuedeposit" name="valuedeposit" size="3" value="' . GETPOST('valuedeposit', 'int') . '"/>';
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2254,7 +2254,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replacement
|
// Replacement
|
||||||
if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT))
|
if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT))
|
||||||
{
|
{
|
||||||
print '<!-- replacement line -->';
|
print '<!-- replacement line -->';
|
||||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||||
@ -2301,7 +2301,7 @@ if ($action == 'create')
|
|||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
// Credit note
|
// Credit note
|
||||||
if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE))
|
if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE))
|
||||||
{
|
{
|
||||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||||
$tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : '');
|
$tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : '');
|
||||||
@ -2337,12 +2337,12 @@ if ($action == 'create')
|
|||||||
$text .= '</select>';
|
$text .= '</select>';
|
||||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
||||||
print $desc;
|
print $desc;
|
||||||
|
|
||||||
print '<div id="credit_note_options" class="clearboth">';
|
print '<div id="credit_note_options" class="clearboth">';
|
||||||
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||||
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2482,7 +2482,7 @@ class Facture extends CommonInvoice
|
|||||||
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
* @param string $fk_unit Code of the unit to use. Null to use the default one
|
||||||
* @return int < 0 if KO, > 0 if OK
|
* @return int < 0 if KO, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=0, $fk_unit = null)
|
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=100, $fk_unit = null)
|
||||||
{
|
{
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
// Deprecation warning
|
// Deprecation warning
|
||||||
|
|||||||
@ -201,7 +201,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOS
|
|||||||
$search_state="";
|
$search_state="";
|
||||||
$search_type='';
|
$search_type='';
|
||||||
$search_country='';
|
$search_country='';
|
||||||
$search_type_thirdparty='';
|
$search_type_thirdparty='';
|
||||||
$day='';
|
$day='';
|
||||||
$year='';
|
$year='';
|
||||||
$month='';
|
$month='';
|
||||||
@ -228,7 +228,7 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors');
|
setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && $massaction == 'confirm_presend' && GETPOST('modelselected')) // If we change the template, we must not send email, but keep on send email form
|
if (! $error && $massaction == 'confirm_presend' && GETPOST('modelselected')) // If we change the template, we must not send email, but keep on send email form
|
||||||
{
|
{
|
||||||
$massaction='presend';
|
$massaction='presend';
|
||||||
@ -240,7 +240,7 @@ if (empty($reshook))
|
|||||||
$nbignored = 0;
|
$nbignored = 0;
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
if (!$error && !isset($user->email))
|
if (!$error && !isset($user->email))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
@ -258,7 +258,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$objecttmp=new Facture($db); // must create new instance because instance is saved into $listofobjectref array for future use
|
$objecttmp=new Facture($db); // must create new instance because instance is saved into $listofobjectref array for future use
|
||||||
$result=$objecttmp->fetch($toselectid);
|
$result=$objecttmp->fetch($toselectid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$listoinvoicesid[$toselectid]=$toselectid;
|
$listoinvoicesid[$toselectid]=$toselectid;
|
||||||
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
||||||
@ -267,16 +267,16 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//var_dump($listofobjectthirdparties);exit;
|
//var_dump($listofobjectthirdparties);exit;
|
||||||
|
|
||||||
foreach ($listofobjectthirdparties as $thirdpartyid)
|
foreach ($listofobjectthirdparties as $thirdpartyid)
|
||||||
{
|
{
|
||||||
$result = $thirdparty->fetch($thirdpartyid);
|
$result = $thirdparty->fetch($thirdpartyid);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define recipient $sendto and $sendtocc
|
// Define recipient $sendto and $sendtocc
|
||||||
if (trim($_POST['sendto']))
|
if (trim($_POST['sendto']))
|
||||||
{
|
{
|
||||||
@ -314,9 +314,9 @@ if (empty($reshook))
|
|||||||
$sendtocc = $thirdparty->contact_get_property((int) $_POST['receivercc'],'email');
|
$sendtocc = $thirdparty->contact_get_property((int) $_POST['receivercc'],'email');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($listofobjectref[$thirdpartyid]); // Array of invoice for this thirdparty
|
//var_dump($listofobjectref[$thirdpartyid]); // Array of invoice for this thirdparty
|
||||||
|
|
||||||
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
||||||
$listofqualifiedinvoice=array();
|
$listofqualifiedinvoice=array();
|
||||||
$listofqualifiedref=array();
|
$listofqualifiedref=array();
|
||||||
@ -324,14 +324,14 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
//var_dump($object);
|
//var_dump($object);
|
||||||
//var_dump($thirdpartyid.' - '.$objectid.' - '.$object->statut);
|
//var_dump($thirdpartyid.' - '.$objectid.' - '.$object->statut);
|
||||||
|
|
||||||
if ($object->statut != Facture::STATUS_VALIDATED)
|
if ($object->statut != Facture::STATUS_VALIDATED)
|
||||||
{
|
{
|
||||||
$nbignored++;
|
$nbignored++;
|
||||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$object->ref).'</div><br>';
|
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$object->ref).'</div><br>';
|
||||||
continue; // Payment done or started or canceled
|
continue; // Payment done or started or canceled
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read document
|
// Read document
|
||||||
// TODO Use future field $object->fullpathdoc to know where is stored default file
|
// TODO Use future field $object->fullpathdoc to know where is stored default file
|
||||||
// TODO If not defined, use $object->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc.
|
// TODO If not defined, use $object->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc.
|
||||||
@ -347,39 +347,39 @@ if (empty($reshook))
|
|||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$sendto = $object->thirdparty->email;
|
$sendto = $object->thirdparty->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($sendto))
|
if (empty($sendto))
|
||||||
{
|
{
|
||||||
//print "No recipient for thirdparty ".$object->thirdparty->name;
|
//print "No recipient for thirdparty ".$object->thirdparty->name;
|
||||||
$nbignored++;
|
$nbignored++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dol_strlen($sendto))
|
if (dol_strlen($sendto))
|
||||||
{
|
{
|
||||||
// Create form object
|
// Create form object
|
||||||
$attachedfiles=array(
|
$attachedfiles=array(
|
||||||
'paths'=>array_merge($attachedfiles['paths'],array($file)),
|
'paths'=>array_merge($attachedfiles['paths'],array($file)),
|
||||||
'names'=>array_merge($attachedfiles['names'],array($filename)),
|
'names'=>array_merge($attachedfiles['names'],array($filename)),
|
||||||
'mimes'=>array_merge($attachedfiles['mimes'],array($mime))
|
'mimes'=>array_merge($attachedfiles['mimes'],array($mime))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$listofqualifiedinvoice[$objectid]=$object;
|
$listofqualifiedinvoice[$objectid]=$object;
|
||||||
$listofqualifiedref[$objectid]=$object->ref;
|
$listofqualifiedref[$objectid]=$object->ref;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$nbignored++;
|
$nbignored++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$resaction.='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div><br>';
|
$resaction.='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div><br>';
|
||||||
dol_syslog('Failed to read file: '.$file, LOG_WARNING);
|
dol_syslog('Failed to read file: '.$file, LOG_WARNING);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($listofqualifiedref);
|
//var_dump($listofqualifiedref);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($listofqualifiedinvoice) > 0)
|
if (count($listofqualifiedinvoice) > 0)
|
||||||
{
|
{
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
@ -389,7 +389,7 @@ if (empty($reshook))
|
|||||||
$message = GETPOST('message');
|
$message = GETPOST('message');
|
||||||
$sendtocc = GETPOST('sentocc');
|
$sendtocc = GETPOST('sentocc');
|
||||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||||
|
|
||||||
$substitutionarray=array(
|
$substitutionarray=array(
|
||||||
'__ID__' => join(', ',array_keys($listofqualifiedinvoice)),
|
'__ID__' => join(', ',array_keys($listofqualifiedinvoice)),
|
||||||
'__EMAIL__' => $thirdparty->email,
|
'__EMAIL__' => $thirdparty->email,
|
||||||
@ -400,16 +400,16 @@ if (empty($reshook))
|
|||||||
'__REF__' => join(', ',$listofqualifiedref),
|
'__REF__' => join(', ',$listofqualifiedref),
|
||||||
'__REFCLIENT__' => $thirdparty->name
|
'__REFCLIENT__' => $thirdparty->name
|
||||||
);
|
);
|
||||||
|
|
||||||
$subject=make_substitutions($subject, $substitutionarray);
|
$subject=make_substitutions($subject, $substitutionarray);
|
||||||
$message=make_substitutions($message, $substitutionarray);
|
$message=make_substitutions($message, $substitutionarray);
|
||||||
|
|
||||||
$filepath = $attachedfiles['paths'];
|
$filepath = $attachedfiles['paths'];
|
||||||
$filename = $attachedfiles['names'];
|
$filename = $attachedfiles['names'];
|
||||||
$mimetype = $attachedfiles['mimes'];
|
$mimetype = $attachedfiles['mimes'];
|
||||||
|
|
||||||
//var_dump($filepath);
|
//var_dump($filepath);
|
||||||
|
|
||||||
// Send mail
|
// Send mail
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||||
@ -423,9 +423,9 @@ if (empty($reshook))
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$resaction.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'<br>'; // Must not contain "
|
$resaction.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'<br>'; // Must not contain "
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Insert logs into agenda
|
// Insert logs into agenda
|
||||||
foreach($listofqualifiedinvoice as $invid => $object)
|
foreach($listofqualifiedinvoice as $invid => $object)
|
||||||
{
|
{
|
||||||
@ -438,7 +438,7 @@ if (empty($reshook))
|
|||||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialisation donnees
|
// Initialisation donnees
|
||||||
$object->sendtoid = 0;
|
$object->sendtoid = 0;
|
||||||
$object->actiontypecode = $actiontypecode;
|
$object->actiontypecode = $actiontypecode;
|
||||||
@ -446,14 +446,14 @@ if (empty($reshook))
|
|||||||
$object->actionmsg2 = $actionmsg2; // Short text
|
$object->actionmsg2 = $actionmsg2; // Short text
|
||||||
$object->fk_element = $invid;
|
$object->fk_element = $invid;
|
||||||
$object->elementtype = $object->element;
|
$object->elementtype = $object->element;
|
||||||
|
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
$interface=new Interfaces($db);
|
$interface=new Interfaces($db);
|
||||||
$result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf);
|
$result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf);
|
||||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
setEventMessages($db->lasterror(), $errors, 'errors');
|
setEventMessages($db->lasterror(), $errors, 'errors');
|
||||||
@ -484,7 +484,7 @@ if (empty($reshook))
|
|||||||
$resaction.=$langs->trans("NbSelected").': '.count($toselect)."\n<br>";
|
$resaction.=$langs->trans("NbSelected").': '.count($toselect)."\n<br>";
|
||||||
$resaction.=$langs->trans("NbIgnored").': '.($nbignored?$nbignored:0)."\n<br>";
|
$resaction.=$langs->trans("NbIgnored").': '.($nbignored?$nbignored:0)."\n<br>";
|
||||||
$resaction.=$langs->trans("NbSent").': '.($nbsent?$nbsent:0)."\n<br>";
|
$resaction.=$langs->trans("NbSent").': '.($nbsent?$nbsent:0)."\n<br>";
|
||||||
|
|
||||||
if ($nbsent)
|
if ($nbsent)
|
||||||
{
|
{
|
||||||
$action=''; // Do not show form post if there was at least one successfull sent
|
$action=''; // Do not show form post if there was at least one successfull sent
|
||||||
@ -497,7 +497,7 @@ if (empty($reshook))
|
|||||||
setEventMessages($resaction, null, 'warnings');
|
setEventMessages($resaction, null, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$action='list';
|
$action='list';
|
||||||
$massaction='';
|
$massaction='';
|
||||||
}
|
}
|
||||||
@ -507,7 +507,7 @@ if (empty($reshook))
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
$objecttmp=new Facture($db);
|
$objecttmp=new Facture($db);
|
||||||
$listofobjectid=array();
|
$listofobjectid=array();
|
||||||
$listofobjectthirdparties=array();
|
$listofobjectthirdparties=array();
|
||||||
@ -542,7 +542,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define output language (Here it is not used because we do only merging existing PDF)
|
// Define output language (Here it is not used because we do only merging existing PDF)
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang='';
|
$newlang='';
|
||||||
@ -607,12 +607,12 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors');
|
setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove file
|
// Remove file
|
||||||
if ($action == 'remove_file')
|
if ($action == 'remove_file')
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$upload_dir = $diroutputmassaction;
|
$upload_dir = $diroutputmassaction;
|
||||||
$file = $upload_dir . '/' . GETPOST('file');
|
$file = $upload_dir . '/' . GETPOST('file');
|
||||||
@ -621,10 +621,10 @@ if (empty($reshook))
|
|||||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -650,7 +650,7 @@ $sql.= " typent.code as typent_code,";
|
|||||||
$sql.= " state.code_departement as state_code, state.nom as state_name";
|
$sql.= " state.code_departement as state_code, state.nom as state_name";
|
||||||
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
|
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
|
||||||
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
||||||
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@ -795,7 +795,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql.= $db->plimit($limit,$offset);
|
$sql.= $db->plimit($limit + 1,$offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -804,7 +804,7 @@ if ($resql)
|
|||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
if ($socid)
|
if ($socid)
|
||||||
{
|
{
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
@ -842,11 +842,12 @@ if ($resql)
|
|||||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
|
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
@ -854,14 +855,14 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$massactionbutton,$num,$nbtotalofrecords,'title_accountancy.png',0,'','',$limit);
|
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$massactionbutton,$num,$nbtotalofrecords,'title_accountancy.png',0,'','',$limit);
|
||||||
|
|
||||||
if ($massaction == 'presend')
|
if ($massaction == 'presend')
|
||||||
{
|
{
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
|
|
||||||
if (! GETPOST('cancel'))
|
if (! GETPOST('cancel'))
|
||||||
{
|
{
|
||||||
$objecttmp=new Facture($db);
|
$objecttmp=new Facture($db);
|
||||||
$listofselectedid=array();
|
$listofselectedid=array();
|
||||||
@ -870,7 +871,7 @@ if ($resql)
|
|||||||
foreach($arrayofselected as $toselectid)
|
foreach($arrayofselected as $toselectid)
|
||||||
{
|
{
|
||||||
$result=$objecttmp->fetch($toselectid);
|
$result=$objecttmp->fetch($toselectid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$listofselectedid[$toselectid]=$toselectid;
|
$listofselectedid[$toselectid]=$toselectid;
|
||||||
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
||||||
@ -881,10 +882,10 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
|
|
||||||
dol_fiche_head(null, '', '');
|
dol_fiche_head(null, '', '');
|
||||||
|
|
||||||
$topicmail="SendBillRef";
|
$topicmail="SendBillRef";
|
||||||
@ -949,16 +950,16 @@ if ($resql)
|
|||||||
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||||
|
|
||||||
print $formmail->get_form();
|
print $formmail->get_form();
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
if ($user->rights->societe->client->voir || $socid)
|
if ($user->rights->societe->client->voir || $socid)
|
||||||
@ -1001,9 +1002,9 @@ if ($resql)
|
|||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($arrayfields['f.facnumber']['checked'])) print_liste_field_titre($arrayfields['f.facnumber']['label'],$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['f.facnumber']['checked'])) print_liste_field_titre($arrayfields['f.facnumber']['label'],$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['f.ref_client']['checked'])) print_liste_field_titre($arrayfields['f.ref_client']['label'],$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['f.ref_client']['checked'])) print_liste_field_titre($arrayfields['f.ref_client']['label'],$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder);
|
||||||
@ -1046,21 +1047,21 @@ if ($resql)
|
|||||||
// Filters lines
|
// Filters lines
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['f.facnumber']['checked']))
|
if (! empty($arrayfields['f.facnumber']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Ref customer
|
// Ref customer
|
||||||
if (! empty($arrayfields['f.ref_client']['checked']))
|
if (! empty($arrayfields['f.ref_client']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
|
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date invoice
|
// Date invoice
|
||||||
if (! empty($arrayfields['f.date']['checked']))
|
if (! empty($arrayfields['f.date']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
||||||
@ -1069,7 +1070,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date due
|
// Date due
|
||||||
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day_lim" value="'.$day_lim.'">';
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day_lim" value="'.$day_lim.'">';
|
||||||
@ -1079,7 +1080,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Thirpdarty
|
// Thirpdarty
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'"></td>';
|
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'"></td>';
|
||||||
}
|
}
|
||||||
@ -1109,7 +1110,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Payment mode
|
// Payment mode
|
||||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10);
|
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10);
|
||||||
@ -1222,21 +1223,21 @@ if ($resql)
|
|||||||
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
||||||
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
|
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
|
||||||
$remaintopay = $obj->total_ttc - $totalpay;
|
$remaintopay = $obj->total_ttc - $totalpay;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
if (! empty($arrayfields['f.facnumber']['checked']))
|
if (! empty($arrayfields['f.facnumber']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
|
|
||||||
$notetoshow=dol_string_nohtmltag(($user->societe_id>0?$obj->note_public:$obj->note_private),1);
|
$notetoshow=dol_string_nohtmltag(($user->societe_id>0?$obj->note_public:$obj->note_private),1);
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
|
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowrap">';
|
||||||
print $facturestatic->getNomUrl(1,'',200,0,$notetoshow);
|
print $facturestatic->getNomUrl(1,'',200,0,$notetoshow);
|
||||||
print $obj->increment;
|
print $obj->increment;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||||
if (! empty($obj->note_private))
|
if (! empty($obj->note_private))
|
||||||
{
|
{
|
||||||
@ -1251,11 +1252,11 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Customer ref
|
// Customer ref
|
||||||
if (! empty($arrayfields['f.ref_client']['checked']))
|
if (! empty($arrayfields['f.ref_client']['checked']))
|
||||||
{
|
{
|
||||||
@ -1264,7 +1265,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
if (! empty($arrayfields['f.date']['checked']))
|
if (! empty($arrayfields['f.date']['checked']))
|
||||||
{
|
{
|
||||||
@ -1273,7 +1274,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date limit
|
// Date limit
|
||||||
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
||||||
{
|
{
|
||||||
@ -1285,7 +1286,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
@ -1339,7 +1340,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
||||||
{
|
{
|
||||||
@ -1348,7 +1349,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (! empty($arrayfields['f.total_ht']['checked']))
|
if (! empty($arrayfields['f.total_ht']['checked']))
|
||||||
{
|
{
|
||||||
@ -1389,7 +1390,7 @@ if ($resql)
|
|||||||
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
|
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
|
||||||
$totalarray['totalrtp'] += $remaintopay;
|
$totalarray['totalrtp'] += $remaintopay;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
@ -1431,12 +1432,12 @@ if ($resql)
|
|||||||
// Status
|
// Status
|
||||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="right" class="nowrap">';
|
print '<td align="right" class="nowrap">';
|
||||||
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
|
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowrap" align="center">';
|
||||||
$selected=0;
|
$selected=0;
|
||||||
@ -1444,7 +1445,7 @@ if ($resql)
|
|||||||
print '<input id="cb'.$obj->facid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.'"'.($selected?' checked="checked"':'').'>';
|
print '<input id="cb'.$obj->facid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.'"'.($selected?' checked="checked"':'').'>';
|
||||||
print '</td>' ;
|
print '</td>' ;
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -1471,20 +1472,20 @@ if ($resql)
|
|||||||
else print '<td></td>';
|
else print '<td></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -1492,15 +1493,15 @@ if ($resql)
|
|||||||
*/
|
*/
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||||
$urlsource.=str_replace('&','&',$param);
|
$urlsource.=str_replace('&','&',$param);
|
||||||
|
|
||||||
$filedir=$diroutputmassaction;
|
$filedir=$diroutputmassaction;
|
||||||
$genallowed=$user->rights->facture->lire;
|
$genallowed=$user->rights->facture->lire;
|
||||||
$delallowed=$user->rights->facture->lire;
|
$delallowed=$user->rights->facture->lire;
|
||||||
|
|
||||||
print '<br><a name="show_files"></a>';
|
print '<br><a name="show_files"></a>';
|
||||||
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
$paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
|
||||||
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
$title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_facture','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_facture','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -252,7 +252,7 @@ class BonPrelevement extends CommonObject
|
|||||||
function getErrorString($error)
|
function getErrorString($error)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
$errors[1027] = $langs->trans("DateInvalid");
|
$errors[1027] = $langs->trans("DateInvalid");
|
||||||
@ -920,7 +920,7 @@ class BonPrelevement extends CommonObject
|
|||||||
|
|
||||||
$dir=$conf->prelevement->dir_output.'/receipts';
|
$dir=$conf->prelevement->dir_output.'/receipts';
|
||||||
if (! is_dir($dir)) dol_mkdir($dir);
|
if (! is_dir($dir)) dol_mkdir($dir);
|
||||||
|
|
||||||
$this->filename = $dir.'/'.$ref.'.xml';
|
$this->filename = $dir.'/'.$ref.'.xml';
|
||||||
|
|
||||||
// Create withdraw receipt in database
|
// Create withdraw receipt in database
|
||||||
@ -1028,7 +1028,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$this->emetteur_bic = $account->bic;
|
$this->emetteur_bic = $account->bic;
|
||||||
|
|
||||||
$this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
|
$this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
|
||||||
|
|
||||||
$this->raison_sociale = $account->proprio;
|
$this->raison_sociale = $account->proprio;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1272,18 +1272,6 @@ class BonPrelevement extends CommonObject
|
|||||||
* section Debiteur (sepa Debiteurs bloc lines)
|
* section Debiteur (sepa Debiteurs bloc lines)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$tmp_invoices = array();
|
|
||||||
|
|
||||||
$sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1";
|
|
||||||
$resql=$this->db->query($sql);
|
|
||||||
if ($resql) {
|
|
||||||
while ($objfac = $this->db->fetch_object($resql)) {
|
|
||||||
$tmp_invoices[] = $objfac->fac;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$ListOfFactures = implode($tmp_invoices);
|
|
||||||
|
|
||||||
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
|
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
|
||||||
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
|
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
|
||||||
$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
|
$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
|
||||||
@ -1310,7 +1298,7 @@ class BonPrelevement extends CommonObject
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
|
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
|
||||||
$this->total = $this->total + $obj->somme;
|
$this->total = $this->total + $obj->somme;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -1581,11 +1569,11 @@ class BonPrelevement extends CommonObject
|
|||||||
$XML_DEBITOR .=' </FinInstnId>'.$CrLf;
|
$XML_DEBITOR .=' </FinInstnId>'.$CrLf;
|
||||||
$XML_DEBITOR .=' </DbtrAgt>'.$CrLf;
|
$XML_DEBITOR .=' </DbtrAgt>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <Dbtr>'.$CrLf;
|
$XML_DEBITOR .=' <Dbtr>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <Nm>'.strtoupper(dol_string_unaccent($row_nom)).'</Nm>'.$CrLf;
|
$XML_DEBITOR .=' <Nm>'.strtoupper(dolEscapeXML(dol_string_unaccent($row_nom))).'</Nm>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <PstlAdr>'.$CrLf;
|
$XML_DEBITOR .=' <PstlAdr>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
|
$XML_DEBITOR .=' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <AdrLine>'.dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""))).'</AdrLine>'.$CrLf;
|
$XML_DEBITOR .=' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""))),70,'right','UTF-8',true)).'</AdrLine>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <AdrLine>'.dol_string_unaccent($row_zip.' '.$row_town).'</AdrLine>'.$CrLf;
|
$XML_DEBITOR .=' <AdrLine>'.dolEscapeXML(dol_string_unaccent($row_zip.' '.$row_town)).'</AdrLine>'.$CrLf;
|
||||||
$XML_DEBITOR .=' </PstlAdr>'.$CrLf;
|
$XML_DEBITOR .=' </PstlAdr>'.$CrLf;
|
||||||
$XML_DEBITOR .=' </Dbtr>'.$CrLf;
|
$XML_DEBITOR .=' </Dbtr>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <DbtrAcct>'.$CrLf;
|
$XML_DEBITOR .=' <DbtrAcct>'.$CrLf;
|
||||||
@ -1680,7 +1668,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @return string String with SEPA Sender
|
* @return string String with SEPA Sender
|
||||||
*/
|
*/
|
||||||
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n')
|
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n')
|
||||||
{
|
{
|
||||||
// SEPA INITIALISATION
|
// SEPA INITIALISATION
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -1699,12 +1687,12 @@ class BonPrelevement extends CommonObject
|
|||||||
$this->emetteur_number_key = $account->cle_rib;
|
$this->emetteur_number_key = $account->cle_rib;
|
||||||
$this->emetteur_iban = $account->iban;
|
$this->emetteur_iban = $account->iban;
|
||||||
$this->emetteur_bic = $account->bic;
|
$this->emetteur_bic = $account->bic;
|
||||||
|
|
||||||
$this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
|
$this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
|
||||||
|
|
||||||
$this->raison_sociale = $account->proprio;
|
$this->raison_sociale = $account->proprio;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Récupération info demandeur
|
// Récupération info demandeur
|
||||||
$sql = "SELECT rowid, ref";
|
$sql = "SELECT rowid, ref";
|
||||||
$sql.= " FROM";
|
$sql.= " FROM";
|
||||||
|
|||||||
@ -1599,8 +1599,8 @@ class Contrat extends CommonObject
|
|||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$contractline = new ContratLigne($this->db);
|
$contractline = new ContratLigne($this->db);
|
||||||
$contractline->array_options=$array_option;
|
$contractline->array_options=$array_options;
|
||||||
$contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element);
|
$contractline->id= $rowid;
|
||||||
$result=$contractline->insertExtraFields();
|
$result=$contractline->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -39,7 +39,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
|||||||
require_once '../main.inc.php';
|
require_once '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php
|
if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("agenda");
|
$langs->load("agenda");
|
||||||
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
||||||
|
|||||||
@ -35,7 +35,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
|||||||
|
|
||||||
require_once '../main.inc.php';
|
require_once '../main.inc.php';
|
||||||
|
|
||||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php
|
if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
||||||
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -407,7 +408,7 @@ function dol_get_next_week($day, $week, $month, $year)
|
|||||||
{
|
{
|
||||||
$tmparray = dol_get_first_day_week($day, $month, $year);
|
$tmparray = dol_get_first_day_week($day, $month, $year);
|
||||||
|
|
||||||
$time=dol_mktime(12,0,0,$month,$tmparray['first_day'],$year,1,0);
|
$time=dol_mktime(12,0,0,$tmparray['first_month'],$tmparray['first_day'],$tmparray['first_year'],1,0);
|
||||||
$time+=24*60*60*7;
|
$time+=24*60*60*7;
|
||||||
$tmparray=dol_getdate($time,true);
|
$tmparray=dol_getdate($time,true);
|
||||||
|
|
||||||
|
|||||||
@ -191,7 +191,7 @@ function getBrowserInfo($user_agent)
|
|||||||
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; }
|
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; }
|
||||||
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
|
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
|
||||||
elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; }
|
elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; }
|
||||||
|
|
||||||
if ($tablet) {
|
if ($tablet) {
|
||||||
$layout = 'tablet';
|
$layout = 'tablet';
|
||||||
} elseif ($phone) {
|
} elseif ($phone) {
|
||||||
@ -250,6 +250,9 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
|
|||||||
case 'int':
|
case 'int':
|
||||||
if (! is_numeric($out)) { $out=''; }
|
if (! is_numeric($out)) { $out=''; }
|
||||||
break;
|
break;
|
||||||
|
case 'intcomma':
|
||||||
|
if (preg_match('/[^0-9,]+/i',$out)) $out='';
|
||||||
|
break;
|
||||||
case 'alpha':
|
case 'alpha':
|
||||||
$out=trim($out);
|
$out=trim($out);
|
||||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||||
@ -266,7 +269,7 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
|
|||||||
break;
|
break;
|
||||||
case 'aZ09':
|
case 'aZ09':
|
||||||
$out=trim($out);
|
$out=trim($out);
|
||||||
if (preg_match('/[^a-z0-9]+/i',$out)) $out='';
|
if (preg_match('/[^a-z0-9_\-]+/i',$out)) $out='';
|
||||||
break;
|
break;
|
||||||
case 'array':
|
case 'array':
|
||||||
if (! is_array($out) || empty($out)) $out=array();
|
if (! is_array($out) || empty($out)) $out=array();
|
||||||
@ -287,13 +290,13 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
|
|||||||
* This prefix is unique for instance and avoid conflict between multi-instances,
|
* This prefix is unique for instance and avoid conflict between multi-instances,
|
||||||
* even when having two instances with one root dir or two instances in virtual servers
|
* even when having two instances with one root dir or two instances in virtual servers
|
||||||
*
|
*
|
||||||
* @param string $mode '' or 'email'
|
* @param string $mode '' or 'email'
|
||||||
* @return string A calculated prefix
|
* @return string A calculated prefix
|
||||||
*/
|
*/
|
||||||
function dol_getprefix($mode='')
|
function dol_getprefix($mode='')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// If MAIL_PREFIX_FOR_EMAIL_ID is set and prefix is for email
|
// If MAIL_PREFIX_FOR_EMAIL_ID is set and prefix is for email
|
||||||
if ($mode == 'email' && ! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID))
|
if ($mode == 'email' && ! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID))
|
||||||
{
|
{
|
||||||
@ -375,15 +378,15 @@ function dol_buildpath($path, $type=0)
|
|||||||
if ($type == 1) $res = DOL_URL_ROOT.'/'.$path; // Standard value
|
if ($type == 1) $res = DOL_URL_ROOT.'/'.$path; // Standard value
|
||||||
if ($type == 2) $res = DOL_MAIN_URL_ROOT.'/'.$path; // Standard value
|
if ($type == 2) $res = DOL_MAIN_URL_ROOT.'/'.$path; // Standard value
|
||||||
if ($type == 3) $res = DOL_URL_ROOT.'/'.$path;
|
if ($type == 3) $res = DOL_URL_ROOT.'/'.$path;
|
||||||
|
|
||||||
foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
||||||
{
|
{
|
||||||
if ($key == 'main')
|
if ($key == 'main')
|
||||||
{
|
{
|
||||||
if ($type == 3)
|
if ($type == 3)
|
||||||
{
|
{
|
||||||
global $dolibarr_main_url_root;
|
global $dolibarr_main_url_root;
|
||||||
|
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
@ -410,12 +413,12 @@ function dol_buildpath($path, $type=0)
|
|||||||
if ($type == 3)
|
if ($type == 3)
|
||||||
{
|
{
|
||||||
global $dolibarr_main_url_root;
|
global $dolibarr_main_url_root;
|
||||||
|
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
$res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax
|
$res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -954,7 +957,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
|||||||
$maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5);
|
$maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5);
|
||||||
if ($conf->browser->phone) $maxvisiblephotos=1;
|
if ($conf->browser->phone) $maxvisiblephotos=1;
|
||||||
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
|
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) {
|
if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) {
|
||||||
$nophoto='';
|
$nophoto='';
|
||||||
@ -964,17 +967,17 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
|||||||
$nophoto='/public/theme/common/nophoto.png';
|
$nophoto='/public/theme/common/nophoto.png';
|
||||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'"></div>';
|
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'"></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
|
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
|
||||||
}
|
}
|
||||||
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
|
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
|
||||||
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||||
$morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
|
$morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
|
||||||
}
|
}
|
||||||
elseif ($object->element == 'product')
|
elseif ($object->element == 'product')
|
||||||
{
|
{
|
||||||
//$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Sell").') ';
|
//$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Sell").') ';
|
||||||
@ -996,7 +999,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
|||||||
}
|
}
|
||||||
if (! empty($object->name_alias)) $morehtmlref.='<div class="refidno">'.$object->name_alias.'</div>'; // For thirdparty
|
if (! empty($object->name_alias)) $morehtmlref.='<div class="refidno">'.$object->name_alias.'</div>'; // For thirdparty
|
||||||
if (! empty($object->label)) $morehtmlref.='<div class="refidno">'.$object->label.'</div>'; // For product
|
if (! empty($object->label)) $morehtmlref.='<div class="refidno">'.$object->label.'</div>'; // For product
|
||||||
if ($object->element != 'product')
|
if ($object->element != 'product')
|
||||||
{
|
{
|
||||||
$morehtmlref.='<div class="refidno">';
|
$morehtmlref.='<div class="refidno">';
|
||||||
$morehtmlref.=$object->getBannerAddress('refaddress',$object);
|
$morehtmlref.=$object->getBannerAddress('refaddress',$object);
|
||||||
@ -1181,9 +1184,9 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
|
|||||||
$reduceformat=(! empty($conf->dol_optimize_smallscreen) && in_array($format,array('day','dayhour')))?1:0;
|
$reduceformat=(! empty($conf->dol_optimize_smallscreen) && in_array($format,array('day','dayhour')))?1:0;
|
||||||
$formatwithoutreduce = preg_replace('/reduceformat/','',$format);
|
$formatwithoutreduce = preg_replace('/reduceformat/','',$format);
|
||||||
if ($formatwithoutreduce != $format) { $format = $formatwithoutreduce; $reduceformat=1; } // so format 'dayreduceformat' is processed like day
|
if ($formatwithoutreduce != $format) { $format = $formatwithoutreduce; $reduceformat=1; } // so format 'dayreduceformat' is processed like day
|
||||||
|
|
||||||
// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
|
// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
|
||||||
// TODO Add format daysmallyear and dayhoursmallyear
|
// TODO Add format daysmallyear and dayhoursmallyear
|
||||||
if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short);
|
if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short);
|
||||||
else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short);
|
else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short);
|
||||||
else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration);
|
else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration);
|
||||||
@ -1954,7 +1957,7 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie',
|
|||||||
print '<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>';
|
print '<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->use_javascript_ajax)) return;
|
if (empty($conf->use_javascript_ajax)) return;
|
||||||
$jsgraphlib='flot';
|
$jsgraphlib='flot';
|
||||||
$datacolor=array();
|
$datacolor=array();
|
||||||
@ -2123,7 +2126,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if ($size==0 || ! empty($conf->global->MAIN_DISABLE_TRUNC)) return $string;
|
if ($size==0 || ! empty($conf->global->MAIN_DISABLE_TRUNC)) return $string;
|
||||||
|
|
||||||
if (empty($stringencoding)) $stringencoding='UTF-8';
|
if (empty($stringencoding)) $stringencoding='UTF-8';
|
||||||
// reduce for small screen
|
// reduce for small screen
|
||||||
if ($conf->dol_optimize_smallscreen==1 && $display==1) $size = round($size/3);
|
if ($conf->dol_optimize_smallscreen==1 && $display==1) $size = round($size/3);
|
||||||
@ -3073,7 +3076,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois
|
|||||||
* @param string $options parametres complementaires lien ('' par defaut)
|
* @param string $options parametres complementaires lien ('' par defaut)
|
||||||
* @param string $sortfield champ de tri ('' par defaut)
|
* @param string $sortfield champ de tri ('' par defaut)
|
||||||
* @param string $sortorder ordre de tri ('' par defaut)
|
* @param string $sortorder ordre de tri ('' par defaut)
|
||||||
* @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction()
|
* @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction()
|
||||||
* @param int $num number of records found by select with limit+1
|
* @param int $num number of records found by select with limit+1
|
||||||
* @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to no show number.
|
* @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to no show number.
|
||||||
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
|
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
|
||||||
@ -3087,11 +3090,11 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois
|
|||||||
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
|
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$savlimit = $limit;
|
$savlimit = $limit;
|
||||||
$savtotalnboflines = $totalnboflines;
|
$savtotalnboflines = $totalnboflines;
|
||||||
$totalnboflines=abs($totalnboflines);
|
$totalnboflines=abs($totalnboflines);
|
||||||
|
|
||||||
if ($picto == 'setup') $picto='title_setup.png';
|
if ($picto == 'setup') $picto='title_setup.png';
|
||||||
if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif';
|
if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif';
|
||||||
if ($limit < 0) $limit = $conf->liste_limit;
|
if ($limit < 0) $limit = $conf->liste_limit;
|
||||||
@ -3104,7 +3107,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
|||||||
$nextpage = 0;
|
$nextpage = 0;
|
||||||
}
|
}
|
||||||
//print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage;
|
//print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage;
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Begin title '".$titre."' -->\n";
|
print "<!-- Begin title '".$titre."' -->\n";
|
||||||
print '<table width="100%" border="0" class="notopnoleftnoright'.($morecss?' '.$morecss:'').'" style="margin-bottom: 6px;"><tr>';
|
print '<table width="100%" border="0" class="notopnoleftnoright'.($morecss?' '.$morecss:'').'" style="margin-bottom: 6px;"><tr>';
|
||||||
@ -3203,7 +3206,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
|
|||||||
//$pagesizechoices.=',0:'.$langs->trans("All"); // Not yet supported
|
//$pagesizechoices.=',0:'.$langs->trans("All"); // Not yet supported
|
||||||
//$pagesizechoices.=',2:2';
|
//$pagesizechoices.=',2:2';
|
||||||
if (! empty($conf->global->MAIN_PAGESIZE_CHOICES)) $pagesizechoices=$conf->global->MAIN_PAGESIZE_CHOICES;
|
if (! empty($conf->global->MAIN_PAGESIZE_CHOICES)) $pagesizechoices=$conf->global->MAIN_PAGESIZE_CHOICES;
|
||||||
|
|
||||||
print '<li class="pagination">';
|
print '<li class="pagination">';
|
||||||
print '<select class="flat selectlimit" name="limit">';
|
print '<select class="flat selectlimit" name="limit">';
|
||||||
$tmpchoice=explode(',',$pagesizechoices);
|
$tmpchoice=explode(',',$pagesizechoices);
|
||||||
@ -3243,7 +3246,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
|
|||||||
</script>
|
</script>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
print '</li>';
|
print '</li>';
|
||||||
}
|
}
|
||||||
if ($page > 0)
|
if ($page > 0)
|
||||||
{
|
{
|
||||||
@ -3282,7 +3285,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
|
|||||||
function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
|
function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
|
||||||
{
|
{
|
||||||
$morelabel='';
|
$morelabel='';
|
||||||
|
|
||||||
if (preg_match('/%/',$rate))
|
if (preg_match('/%/',$rate))
|
||||||
{
|
{
|
||||||
$rate=str_replace('%','',$rate);
|
$rate=str_replace('%','',$rate);
|
||||||
@ -3485,7 +3488,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Output a dimension with best unit
|
* Output a dimension with best unit
|
||||||
*
|
*
|
||||||
* @param float $dimension Dimension
|
* @param float $dimension Dimension
|
||||||
* @param int $unit Unit of dimension (0, -3, ...)
|
* @param int $unit Unit of dimension (0, -3, ...)
|
||||||
* @param string $type 'weight', 'volume', ...
|
* @param string $type 'weight', 'volume', ...
|
||||||
@ -3497,16 +3500,16 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
|
|||||||
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no')
|
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no')
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
||||||
|
|
||||||
if (($forceunitoutput == 'no' && $dimension < 1/10000) || (is_numeric($forceunitoutput) && $forceunitoutput == -6))
|
if (($forceunitoutput == 'no' && $dimension < 1/10000) || (is_numeric($forceunitoutput) && $forceunitoutput == -6))
|
||||||
{
|
{
|
||||||
$dimension = $dimension * 1000000;
|
$dimension = $dimension * 1000000;
|
||||||
$unit = $unit - 6;
|
$unit = $unit - 6;
|
||||||
}
|
}
|
||||||
elseif (($forceunitoutput == 'no' && $dimension < 1/10) || (is_numeric($forceunitoutput) && $forceunitoutput == -3))
|
elseif (($forceunitoutput == 'no' && $dimension < 1/10) || (is_numeric($forceunitoutput) && $forceunitoutput == -3))
|
||||||
{
|
{
|
||||||
$dimension = $dimension * 1000;
|
$dimension = $dimension * 1000;
|
||||||
$unit = $unit - 3;
|
$unit = $unit - 3;
|
||||||
}
|
}
|
||||||
elseif (($forceunitoutput == 'no' && $dimension > 100000000) || (is_numeric($forceunitoutput) && $forceunitoutput == 6))
|
elseif (($forceunitoutput == 'no' && $dimension > 100000000) || (is_numeric($forceunitoutput) && $forceunitoutput == 6))
|
||||||
{
|
{
|
||||||
@ -3518,9 +3521,9 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=
|
|||||||
$dimension = $dimension / 1000;
|
$dimension = $dimension / 1000;
|
||||||
$unit = $unit + 3;
|
$unit = $unit + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret=price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type);
|
$ret=price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3551,12 +3554,12 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
|||||||
$vatratecleaned = trim($reg[1]);
|
$vatratecleaned = trim($reg[1]);
|
||||||
$vatratecode = $reg[2];
|
$vatratecode = $reg[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if ($thirdparty_buyer->country_code != $thirdparty_seller->country_code)
|
/*if ($thirdparty_buyer->country_code != $thirdparty_seller->country_code)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// Some test to guess with no need to make database access
|
// Some test to guess with no need to make database access
|
||||||
if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe
|
if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe
|
||||||
{
|
{
|
||||||
@ -3597,7 +3600,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
|||||||
{
|
{
|
||||||
$conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY = 1;
|
$conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search local taxes
|
// Search local taxes
|
||||||
if (! empty($conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY))
|
if (! empty($conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY))
|
||||||
{
|
{
|
||||||
@ -3654,7 +3657,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
|||||||
if ($local==1) return $obj->localtax1;
|
if ($local==1) return $obj->localtax1;
|
||||||
elseif ($local==2) return $obj->localtax2;
|
elseif ($local==2) return $obj->localtax2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3714,7 +3717,7 @@ function get_localtax_by_third($local)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get vat rate and npr from id.
|
* Get vat rate and npr from id.
|
||||||
* You can call getLocalTaxesFromRate after to get other fields
|
* You can call getLocalTaxesFromRate after to get other fields
|
||||||
*
|
*
|
||||||
* @param int $vatrowid Line ID into vat rate table.
|
* @param int $vatrowid Line ID into vat rate table.
|
||||||
* @return array array(localtax_type1(1-6 / 0 if not found), rate of localtax1, ...)
|
* @return array array(localtax_type1(1-6 / 0 if not found), rate of localtax1, ...)
|
||||||
@ -3768,7 +3771,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
|||||||
$vatratecleaned = $reg[1];
|
$vatratecleaned = $reg[1];
|
||||||
$vatratecode = $reg[2];
|
$vatratecode = $reg[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search local taxes
|
// Search local taxes
|
||||||
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy";
|
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t";
|
||||||
@ -3781,7 +3784,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
|||||||
$sql.= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
|
$sql.= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
|
||||||
if ($vatratecode) $sql.= " AND t.code ='".$vatratecode."'";
|
if ($vatratecode) $sql.= " AND t.code ='".$vatratecode."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -4188,7 +4191,7 @@ function yn($yesno, $case=1, $color=0)
|
|||||||
/**
|
/**
|
||||||
* Return a path to have a directory according to object.
|
* Return a path to have a directory according to object.
|
||||||
* New usage: $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart')
|
* New usage: $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart')
|
||||||
* Old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/"
|
* Old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/"
|
||||||
*
|
*
|
||||||
* @param string $num Id of object (deprecated, $object will be used in future)
|
* @param string $num Id of object (deprecated, $object will be used in future)
|
||||||
* @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future)
|
* @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future)
|
||||||
@ -4205,7 +4208,7 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
|
|||||||
$path = '';
|
$path = '';
|
||||||
|
|
||||||
$arrayforoldpath=array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier','mailing');
|
$arrayforoldpath=array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier','mailing');
|
||||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[]='product';
|
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[]='product';
|
||||||
if (! empty($level) && in_array($modulepart, $arrayforoldpath))
|
if (! empty($level) && in_array($modulepart, $arrayforoldpath))
|
||||||
{
|
{
|
||||||
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
|
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
|
||||||
@ -4357,7 +4360,7 @@ function dolGetFirstLineOfText($text)
|
|||||||
{
|
{
|
||||||
$firstline=preg_replace('/<br[^>]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters
|
$firstline=preg_replace('/<br[^>]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters
|
||||||
$firstline=preg_replace('/<div[^>]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters
|
$firstline=preg_replace('/<div[^>]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -5383,11 +5386,11 @@ function printCommonFooter($zone='private')
|
|||||||
{
|
{
|
||||||
print '<!-- Reposition management (does not work if a redirect is done after action of submission) -->'."\n";
|
print '<!-- Reposition management (does not work if a redirect is done after action of submission) -->'."\n";
|
||||||
print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() {'."\n";
|
print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() {'."\n";
|
||||||
|
|
||||||
print '<!-- If page_y set, we set scollbar with it -->'."\n";
|
print '<!-- If page_y set, we set scollbar with it -->'."\n";
|
||||||
print "page_y=getParameterByName('page_y', 0);";
|
print "page_y=getParameterByName('page_y', 0);";
|
||||||
print "if (page_y > 0) $('html, body').scrollTop(page_y);\n";
|
print "if (page_y > 0) $('html, body').scrollTop(page_y);\n";
|
||||||
|
|
||||||
print '<!-- Set handler to add page_y param on some a href links -->'."\n";
|
print '<!-- Set handler to add page_y param on some a href links -->'."\n";
|
||||||
print 'jQuery(".reposition").click(function() {
|
print 'jQuery(".reposition").click(function() {
|
||||||
var page_y = $(document).scrollTop();
|
var page_y = $(document).scrollTop();
|
||||||
@ -5395,7 +5398,7 @@ function printCommonFooter($zone='private')
|
|||||||
this.href=this.href+\'&page_y=\'+page_y;
|
this.href=this.href+\'&page_y=\'+page_y;
|
||||||
});'."\n";
|
});'."\n";
|
||||||
print '});'."\n";
|
print '});'."\n";
|
||||||
|
|
||||||
if (empty($conf->dol_use_jmobile))
|
if (empty($conf->dol_use_jmobile))
|
||||||
{
|
{
|
||||||
print '<!-- Set handler to switch left menu page -->'."\n";
|
print '<!-- Set handler to switch left menu page -->'."\n";
|
||||||
@ -5404,10 +5407,10 @@ function printCommonFooter($zone='private')
|
|||||||
if ($conf->theme == 'md') print " $('.login_block').toggle();";
|
if ($conf->theme == 'md') print " $('.login_block').toggle();";
|
||||||
print '});'."\n";
|
print '});'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Google Analytics (need Google module)
|
// Google Analytics (need Google module)
|
||||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
||||||
{
|
{
|
||||||
@ -5620,15 +5623,15 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
|||||||
$tmpcrit=trim($tmpcrit);
|
$tmpcrit=trim($tmpcrit);
|
||||||
$tmpcrit2=$tmpcrit;
|
$tmpcrit2=$tmpcrit;
|
||||||
$tmpbefore='%'; $tmpafter='%';
|
$tmpbefore='%'; $tmpafter='%';
|
||||||
if (preg_match('/^[\^\$]/', $tmpcrit))
|
if (preg_match('/^[\^\$]/', $tmpcrit))
|
||||||
{
|
{
|
||||||
$tmpbefore='';
|
$tmpbefore='';
|
||||||
$tmpcrit2 = preg_replace('/^[\^\$]/', '', $tmpcrit2);
|
$tmpcrit2 = preg_replace('/^[\^\$]/', '', $tmpcrit2);
|
||||||
}
|
}
|
||||||
if (preg_match('/[\^\$]$/', $tmpcrit))
|
if (preg_match('/[\^\$]$/', $tmpcrit))
|
||||||
{
|
{
|
||||||
$tmpafter='';
|
$tmpafter='';
|
||||||
$tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2);
|
$tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2);
|
||||||
}
|
}
|
||||||
$newres .= $tmpbefore;
|
$newres .= $tmpbefore;
|
||||||
$newres .= $db->escape($tmpcrit2);
|
$newres .= $db->escape($tmpcrit2);
|
||||||
|
|||||||
@ -48,22 +48,22 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
* @var string Publisher name
|
* @var string Publisher name
|
||||||
*/
|
*/
|
||||||
public $editor_name;
|
public $editor_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string URL of module at publisher site
|
* @var string URL of module at publisher site
|
||||||
*/
|
*/
|
||||||
public $editor_web;
|
public $editor_web;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Family
|
* @var string Family
|
||||||
*/
|
*/
|
||||||
public $family;
|
public $family;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int module_position
|
* @var int module_position
|
||||||
*/
|
*/
|
||||||
public $module_position=500;
|
public $module_position=500;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Module name
|
* @var string Module name
|
||||||
*/
|
*/
|
||||||
@ -171,7 +171,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
* @var string Module description (long text)
|
* @var string Module description (long text)
|
||||||
*/
|
*/
|
||||||
public $descriptionlong;
|
public $descriptionlong;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[] Module language files
|
* @var string[] Module language files
|
||||||
*/
|
*/
|
||||||
@ -211,7 +211,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
* @var bool Module is enabled globally (Multicompany support)
|
* @var bool Module is enabled globally (Multicompany support)
|
||||||
*/
|
*/
|
||||||
public $core_enabled;
|
public $core_enabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Relative path to module style sheet
|
* @var string Relative path to module style sheet
|
||||||
* @deprecated
|
* @deprecated
|
||||||
@ -219,8 +219,8 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
*/
|
*/
|
||||||
public $style_sheet = '';
|
public $style_sheet = '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Define names, constants, directories, boxes, permissions
|
* Constructor. Define names, constants, directories, boxes, permissions
|
||||||
*
|
*
|
||||||
@ -468,9 +468,9 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
if (empty($this->descriptionlong)) return '';
|
if (empty($this->descriptionlong)) return '';
|
||||||
|
|
||||||
// If module description translation does not exist using its unique id, we can use its name to find translation
|
// If module description translation does not exist using its unique id, we can use its name to find translation
|
||||||
if (is_array($this->langfiles))
|
if (is_array($this->langfiles))
|
||||||
{
|
{
|
||||||
@ -481,7 +481,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
}
|
}
|
||||||
return $langs->trans($this->descriptionlong);
|
return $langs->trans($this->descriptionlong);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gives the publisher name
|
* Gives the publisher name
|
||||||
*
|
*
|
||||||
@ -491,7 +491,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
{
|
{
|
||||||
return $this->editor_name;
|
return $this->editor_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gives the publisher url
|
* Gives the publisher url
|
||||||
*
|
*
|
||||||
@ -501,7 +501,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
{
|
{
|
||||||
return $this->editor_url;
|
return $this->editor_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gives module version (translated if param $translated is on)
|
* Gives module version (translated if param $translated is on)
|
||||||
* For 'experimental' modules, gives 'experimental' translation
|
* For 'experimental' modules, gives 'experimental' translation
|
||||||
@ -705,7 +705,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
}
|
}
|
||||||
sort($files);
|
sort($files);
|
||||||
foreach ($files as $file)
|
foreach ($files as $file)
|
||||||
{
|
{
|
||||||
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
|
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
|
||||||
{
|
{
|
||||||
@ -723,7 +723,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
}
|
}
|
||||||
sort($files);
|
sort($files);
|
||||||
foreach ($files as $file)
|
foreach ($files as $file)
|
||||||
{
|
{
|
||||||
if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
|
if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
|
||||||
{
|
{
|
||||||
@ -741,7 +741,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
}
|
}
|
||||||
sort($files);
|
sort($files);
|
||||||
foreach ($files as $file)
|
foreach ($files as $file)
|
||||||
{
|
{
|
||||||
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
|
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
|
||||||
{
|
{
|
||||||
@ -759,7 +759,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
$files[] = $file;
|
$files[] = $file;
|
||||||
}
|
}
|
||||||
sort($files);
|
sort($files);
|
||||||
foreach ($files as $file)
|
foreach ($files as $file)
|
||||||
{
|
{
|
||||||
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
|
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
|
||||||
{
|
{
|
||||||
@ -899,19 +899,19 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
//$titre = $this->boxes[$key][0];
|
//$titre = $this->boxes[$key][0];
|
||||||
$file = $this->boxes[$key]['file'];
|
$file = $this->boxes[$key]['file'];
|
||||||
//$note = $this->boxes[$key][2];
|
//$note = $this->boxes[$key][2];
|
||||||
|
|
||||||
// TODO If the box is also included by another module and the other module is still on, we should not remove it.
|
// TODO If the box is also included by another module and the other module is still on, we should not remove it.
|
||||||
// For the moment, we manage this with hard coded exception
|
// For the moment, we manage this with hard coded exception
|
||||||
//print "Remove box ".$file.'<br>';
|
//print "Remove box ".$file.'<br>';
|
||||||
if ($file == 'box_graph_product_distribution.php')
|
if ($file == 'box_graph_product_distribution.php')
|
||||||
{
|
{
|
||||||
if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled))
|
if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled))
|
||||||
{
|
{
|
||||||
dol_syslog("We discard disabling of module ".$file." because another module still active require it.");
|
dol_syslog("We discard disabling of module ".$file." because another module still active require it.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility
|
if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility
|
||||||
|
|
||||||
if ($this->db->type == 'sqlite3') {
|
if ($this->db->type == 'sqlite3') {
|
||||||
@ -986,7 +986,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
$status = isset($this->cronjobs[$key]['status'])?$this->cronjobs[$key]['status']:'';
|
$status = isset($this->cronjobs[$key]['status'])?$this->cronjobs[$key]['status']:'';
|
||||||
$priority = isset($this->cronjobs[$key]['priority'])?$this->cronjobs[$key]['priority']:'';
|
$priority = isset($this->cronjobs[$key]['priority'])?$this->cronjobs[$key]['priority']:'';
|
||||||
$test = isset($this->cronjobs[$key]['test'])?$this->cronjobs[$key]['test']:''; // Line must be visible
|
$test = isset($this->cronjobs[$key]['test'])?$this->cronjobs[$key]['test']:''; // Line must be visible
|
||||||
|
|
||||||
// Search if boxes def already present
|
// Search if boxes def already present
|
||||||
$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob";
|
$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob";
|
||||||
$sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'";
|
$sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'";
|
||||||
@ -1124,55 +1124,55 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
*
|
*
|
||||||
* @return int Error count (0 if ok)
|
* @return int Error count (0 if ok)
|
||||||
*/
|
*/
|
||||||
function insert_tabs()
|
function insert_tabs()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$err=0;
|
$err=0;
|
||||||
|
|
||||||
if (! empty($this->tabs))
|
if (! empty($this->tabs))
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach ($this->tabs as $key => $value)
|
foreach ($this->tabs as $key => $value)
|
||||||
{
|
{
|
||||||
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
|
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
|
||||||
|
|
||||||
$entity=$conf->entity;
|
$entity=$conf->entity;
|
||||||
$newvalue = $value;
|
$newvalue = $value;
|
||||||
|
|
||||||
if (is_array($value))
|
if (is_array($value))
|
||||||
{
|
{
|
||||||
$newvalue = $value['data'];
|
$newvalue = $value['data'];
|
||||||
if (isset($value['entity'])) $entity = $value['entity'];
|
if (isset($value['entity'])) $entity = $value['entity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newvalue)
|
if ($newvalue)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
|
||||||
$sql.= "name";
|
$sql.= "name";
|
||||||
$sql.= ", type";
|
$sql.= ", type";
|
||||||
$sql.= ", value";
|
$sql.= ", value";
|
||||||
$sql.= ", note";
|
$sql.= ", note";
|
||||||
$sql.= ", visible";
|
$sql.= ", visible";
|
||||||
$sql.= ", entity";
|
$sql.= ", entity";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
$sql.= " VALUES (";
|
$sql.= " VALUES (";
|
||||||
$sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
|
$sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
|
||||||
$sql.= ", 'chaine'";
|
$sql.= ", 'chaine'";
|
||||||
$sql.= ", ".$this->db->encrypt($value,1);
|
$sql.= ", ".$this->db->encrypt($newvalue,1);
|
||||||
$sql.= ", null";
|
$sql.= ", null";
|
||||||
$sql.= ", '0'";
|
$sql.= ", '0'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$entity;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
||||||
$this->db->query($sql);
|
$this->db->query($sql);
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $err;
|
return $err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds constants
|
* Adds constants
|
||||||
|
|||||||
@ -1120,7 +1120,26 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// VAT
|
// VAT
|
||||||
|
// Situations totals migth be wrong on huge amounts
|
||||||
|
if ($object->situation_cycle_ref && $object->situation_counter > 1) {
|
||||||
|
|
||||||
|
$sum_pdf_tva = 0;
|
||||||
|
foreach($this->tva as $tvakey => $tvaval){
|
||||||
|
$sum_pdf_tva+=$tvaval; // sum VAT amounts to compare to object
|
||||||
|
}
|
||||||
|
|
||||||
|
if($sum_pdf_tva!=$object->total_tva) { // apply coef to recover the VAT object amount (the good one)
|
||||||
|
$coef_fix_tva = $object->total_tva / $sum_pdf_tva;
|
||||||
|
|
||||||
|
foreach($this->tva as $tvakey => $tvaval) {
|
||||||
|
$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
foreach($this->tva as $tvakey => $tvaval)
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey != 0) // On affiche pas taux 0
|
if ($tvakey != 0) // On affiche pas taux 0
|
||||||
|
|||||||
@ -35,7 +35,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
|||||||
|
|
||||||
require_once '../main.inc.php';
|
require_once '../main.inc.php';
|
||||||
|
|
||||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php
|
if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
||||||
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
||||||
@ -76,11 +76,11 @@ if ($conf->use_javascript_ajax && 1 == 2) // select2 is ko with jmobile
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$conf->global->MAIN_HTML5_PLACEHOLDER = 1;
|
$conf->global->MAIN_HTML5_PLACEHOLDER = 1;
|
||||||
|
|
||||||
|
|
||||||
$usedbyinclude = 1; // Used into next include
|
$usedbyinclude = 1; // Used into next include
|
||||||
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
|
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
|
||||||
|
|
||||||
$accesskeyalreadyassigned=array();
|
$accesskeyalreadyassigned=array();
|
||||||
foreach($arrayresult as $key => $val)
|
foreach($arrayresult as $key => $val)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -108,7 +108,7 @@ class Cronjob extends CommonObject
|
|||||||
if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun);
|
if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun);
|
||||||
if (isset($this->libname)) $this->libname = trim($this->libname);
|
if (isset($this->libname)) $this->libname = trim($this->libname);
|
||||||
if (isset($this->test)) $this->test = trim($this->test);
|
if (isset($this->test)) $this->test = trim($this->test);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
// Put here code to add a control on parameters values
|
// Put here code to add a control on parameters values
|
||||||
if (dol_strlen($this->datestart)==0) {
|
if (dol_strlen($this->datestart)==0) {
|
||||||
@ -363,9 +363,9 @@ class Cronjob extends CommonObject
|
|||||||
function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='')
|
function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$this->lines=array();
|
$this->lines=array();
|
||||||
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " t.rowid,";
|
$sql.= " t.rowid,";
|
||||||
$sql.= " t.entity,";
|
$sql.= " t.entity,";
|
||||||
@ -403,7 +403,7 @@ class Cronjob extends CommonObject
|
|||||||
if ($status == 2) $sql.= " AND t.status = 2";
|
if ($status == 2) $sql.= " AND t.status = 2";
|
||||||
//Manage filter
|
//Manage filter
|
||||||
if (is_array($filter) && count($filter)>0) {
|
if (is_array($filter) && count($filter)>0) {
|
||||||
foreach($filter as $key => $value)
|
foreach($filter as $key => $value)
|
||||||
{
|
{
|
||||||
if ($key == 't.rowid') $sql.= ' AND '.$key.' = '.$this->db->escape($value);
|
if ($key == 't.rowid') $sql.= ' AND '.$key.' = '.$this->db->escape($value);
|
||||||
else $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
else $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
||||||
@ -526,7 +526,7 @@ class Cronjob extends CommonObject
|
|||||||
if (empty($this->maxrun)) $this->maxrun=0;
|
if (empty($this->maxrun)) $this->maxrun=0;
|
||||||
if (isset($this->libname)) $this->libname = trim($this->libname);
|
if (isset($this->libname)) $this->libname = trim($this->libname);
|
||||||
if (isset($this->test)) $this->test = trim($this->test);
|
if (isset($this->test)) $this->test = trim($this->test);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
// Put here code to add a control on parameters values
|
// Put here code to add a control on parameters values
|
||||||
if (dol_strlen($this->datestart)==0) {
|
if (dol_strlen($this->datestart)==0) {
|
||||||
@ -837,8 +837,8 @@ class Cronjob extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Run a job.
|
* Run a job.
|
||||||
* Once job is finished, status and nb of run is updated.
|
* Once job is finished, status and nb of run is updated.
|
||||||
* This function does not plan the next run. This is done by function ->reprogram_jobs
|
* This function does not plan the next run. This is done by function ->reprogram_jobs
|
||||||
*
|
*
|
||||||
* @param string $userlogin User login
|
* @param string $userlogin User login
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
@ -853,7 +853,7 @@ class Cronjob extends CommonObject
|
|||||||
|
|
||||||
$langs->load('cron');
|
$langs->load('cron');
|
||||||
|
|
||||||
if (empty($userlogin))
|
if (empty($userlogin))
|
||||||
{
|
{
|
||||||
$this->error="User login is mandatory";
|
$this->error="User login is mandatory";
|
||||||
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
||||||
@ -914,16 +914,16 @@ class Cronjob extends CommonObject
|
|||||||
// load classes
|
// load classes
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$ret=dol_include_once($this->classesname);
|
$ret=dol_include_once($this->classesname);
|
||||||
if ($ret===false || (! class_exists($this->objectname)))
|
if ($ret===false || (! class_exists($this->objectname)))
|
||||||
{
|
{
|
||||||
$this->error=$langs->trans('CronCannotLoadClass',$this->classesname,$this->objectname);
|
$this->error=$langs->trans('CronCannotLoadClass',$this->classesname,$this->objectname);
|
||||||
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
||||||
$this->lastoutput = $this->error;
|
$this->lastoutput = $this->error;
|
||||||
$this->lastresult = -1;
|
$this->lastresult = -1;
|
||||||
$retval = $this->lastresult;
|
$retval = $this->lastresult;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// test if method exists
|
// test if method exists
|
||||||
@ -939,7 +939,7 @@ class Cronjob extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load langs
|
// Load langs
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -954,14 +954,14 @@ class Cronjob extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG);
|
dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG);
|
||||||
|
|
||||||
// Create Object for the call module
|
// Create Object for the call module
|
||||||
$object = new $this->objectname($this->db);
|
$object = new $this->objectname($this->db);
|
||||||
|
|
||||||
$params_arr = explode(", ",$this->params);
|
$params_arr = explode(", ",$this->params);
|
||||||
if (!is_array($params_arr))
|
if (!is_array($params_arr))
|
||||||
{
|
{
|
||||||
@ -971,8 +971,8 @@ class Cronjob extends CommonObject
|
|||||||
{
|
{
|
||||||
$result = call_user_func_array(array($object, $this->methodename), $params_arr);
|
$result = call_user_func_array(array($object, $this->methodename), $params_arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result===false || $result != 0)
|
if ($result === false || (! is_bool($result) && $result != 0))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR);
|
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR);
|
||||||
@ -989,7 +989,7 @@ class Cronjob extends CommonObject
|
|||||||
$this->lastresult=var_export($result,true);
|
$this->lastresult=var_export($result,true);
|
||||||
$retval = $this->lastresult;
|
$retval = $this->lastresult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->jobtype == 'function')
|
if($this->jobtype == 'function')
|
||||||
@ -1021,7 +1021,7 @@ class Cronjob extends CommonObject
|
|||||||
$result = call_user_func_array($this->methodename, $params_arr);
|
$result = call_user_func_array($this->methodename, $params_arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result === false || $result != 0)
|
if ($result === false || (! is_bool($result) && $result != 0))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
dol_syslog(get_class($this)."::run_jobs result=".$result, LOG_ERR);
|
dol_syslog(get_class($this)."::run_jobs result=".$result, LOG_ERR);
|
||||||
@ -1062,7 +1062,7 @@ class Cronjob extends CommonObject
|
|||||||
$this->lastoutput = ''; // Will be filled later
|
$this->lastoutput = ''; // Will be filled later
|
||||||
$this->lastresult = $retval;
|
$this->lastresult = $retval;
|
||||||
$retval = $this->lastresult;
|
$retval = $this->lastresult;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($execmethod == 2)
|
if ($execmethod == 2)
|
||||||
@ -1086,21 +1086,21 @@ class Cronjob extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update with result
|
// Update with result
|
||||||
if (is_array($output_arr) && count($output_arr)>0)
|
if (is_array($output_arr) && count($output_arr)>0)
|
||||||
{
|
{
|
||||||
foreach($output_arr as $val)
|
foreach($output_arr as $val)
|
||||||
{
|
{
|
||||||
$this->lastoutput.=$val."\n";
|
$this->lastoutput.=$val."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->lastresult=$retval;
|
$this->lastresult=$retval;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG);
|
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::run_jobs now we update job to track it is finished (with success or error)");
|
dol_syslog(get_class($this)."::run_jobs now we update job to track it is finished (with success or error)");
|
||||||
|
|
||||||
$this->datelastresult=dol_now();
|
$this->datelastresult=dol_now();
|
||||||
$result = $this->update($user); // This include begin/commit
|
$result = $this->update($user); // This include begin/commit
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1125,19 +1125,19 @@ class Cronjob extends CommonObject
|
|||||||
function reprogram_jobs($userlogin, $now)
|
function reprogram_jobs($userlogin, $now)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG);
|
dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG);
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
$user=new User($this->db);
|
$user=new User($this->db);
|
||||||
$result=$user->fetch('',$userlogin);
|
$result=$user->fetch('',$userlogin);
|
||||||
if ($result<0)
|
if ($result<0)
|
||||||
{
|
{
|
||||||
$this->error="User Error:".$user->error;
|
$this->error="User Error:".$user->error;
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (empty($user->id))
|
if (empty($user->id))
|
||||||
{
|
{
|
||||||
$this->error=" User user login:".$userlogin." do not exists";
|
$this->error=" User user login:".$userlogin." do not exists";
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
||||||
@ -1147,24 +1147,24 @@ class Cronjob extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG);
|
dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG);
|
||||||
|
|
||||||
|
|
||||||
if (empty($this->datenextrun))
|
if (empty($this->datenextrun))
|
||||||
{
|
{
|
||||||
if (empty($this->datestart)) $this->datenextrun = $now + ($this->frequency * $this->unitfrequency);
|
if (empty($this->datestart)) $this->datenextrun = $now + ($this->frequency * $this->unitfrequency);
|
||||||
else $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency);
|
else $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->datenextrun < $now && $this->frequency > 0 && $this->unitfrequency > 0)
|
if ($this->datenextrun < $now && $this->frequency > 0 && $this->unitfrequency > 0)
|
||||||
{
|
{
|
||||||
// Loop until date is after future
|
// Loop until date is after future
|
||||||
while ($this->datenextrun < $now)
|
while ($this->datenextrun < $now)
|
||||||
{
|
{
|
||||||
$this->datenextrun += ($this->frequency * $this->unitfrequency);
|
$this->datenextrun += ($this->frequency * $this->unitfrequency);
|
||||||
|
|
||||||
// TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit)
|
// TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency);
|
//$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency);
|
||||||
}
|
}
|
||||||
@ -1180,9 +1180,9 @@ class Cronjob extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::reprogram_jobs Job will be set to archived", LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs Job will be set to archived", LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->update($user);
|
$result = $this->update($user);
|
||||||
if ($result<0)
|
if ($result<0)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -38,7 +38,7 @@ $mainmenu=GETPOST('mainmenu', 'alpha');
|
|||||||
$leftmenu=GETPOST('leftmenu', 'alpha');
|
$leftmenu=GETPOST('leftmenu', 'alpha');
|
||||||
$idmenu=GETPOST('idmenu', 'int');
|
$idmenu=GETPOST('idmenu', 'int');
|
||||||
$theme=GETPOST('theme', 'alpha');
|
$theme=GETPOST('theme', 'alpha');
|
||||||
$codelang=GETPOST('lang', 'alpha');
|
$codelang=GETPOST('lang', 'aZ09');
|
||||||
|
|
||||||
print "
|
print "
|
||||||
<html>
|
<html>
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
||||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','4.0.6');
|
if (! defined('DOL_VERSION')) define('DOL_VERSION','4.0.7');
|
||||||
|
|
||||||
if (! defined('EURO')) define('EURO',chr(128));
|
if (! defined('EURO')) define('EURO',chr(128));
|
||||||
|
|
||||||
|
|||||||
@ -2585,19 +2585,29 @@ elseif (! empty($object->id))
|
|||||||
// Create bill
|
// Create bill
|
||||||
if (! empty($conf->facture->enabled))
|
if (! empty($conf->facture->enabled))
|
||||||
{
|
{
|
||||||
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->billed != 1)) // 2 means accepted
|
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->billed != 1)) // statut 2 means approved
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->facture->creer)
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && !empty($object->linkedObjectsIds['invoice_supplier']))
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not)
|
||||||
|
if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && $object->billed != 1) // statut 2 means approved
|
||||||
|
{
|
||||||
|
if (empty($conf->facture->enabled))
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
|
||||||
|
}
|
||||||
|
else if (!empty($object->linkedObjectsIds['invoice_supplier']))
|
||||||
|
{
|
||||||
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a remote order using WebService only if module is activated
|
// Create a remote order using WebService only if module is activated
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2012-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2012-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2014-2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -39,7 +39,6 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
|||||||
$myparam = GETPOST("myparam");
|
$myparam = GETPOST("myparam");
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$id=GETPOST('id', 'int');
|
$id=GETPOST('id', 'int');
|
||||||
$userid = GETPOST('userid')?GETPOST('userid'):$user->id;
|
|
||||||
|
|
||||||
// Protection if external user
|
// Protection if external user
|
||||||
if ($user->societe_id > 0) accessforbidden();
|
if ($user->societe_id > 0) accessforbidden();
|
||||||
@ -57,7 +56,8 @@ if ($action == 'create')
|
|||||||
$cp = new Holiday($db);
|
$cp = new Holiday($db);
|
||||||
|
|
||||||
// If no right to create a request
|
// If no right to create a request
|
||||||
if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all)))
|
$fuserid = GETPOST('fuserid');
|
||||||
|
if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans('CantCreateCP'), null, 'errors');
|
setEventMessages($langs->trans('CantCreateCP'), null, 'errors');
|
||||||
@ -82,7 +82,6 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$valideur = GETPOST('valideur');
|
$valideur = GETPOST('valideur');
|
||||||
$description = trim(GETPOST('description'));
|
$description = trim(GETPOST('description'));
|
||||||
$userID = GETPOST('userID');
|
|
||||||
|
|
||||||
// If no type
|
// If no type
|
||||||
if ($type <= 0)
|
if ($type <= 0)
|
||||||
@ -115,7 +114,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if there is already holiday for this period
|
// Check if there is already holiday for this period
|
||||||
$verifCP = $cp->verifDateHolidayCP($userID, $date_debut, $date_fin, $halfday);
|
$verifCP = $cp->verifDateHolidayCP($fuserid, $date_debut, $date_fin, $halfday);
|
||||||
if (! $verifCP)
|
if (! $verifCP)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("alreadyCPexist"), null, 'errors');
|
setEventMessages($langs->trans("alreadyCPexist"), null, 'errors');
|
||||||
@ -145,7 +144,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$cp->fk_user = $userid;
|
$cp->fk_user = $fuserid;
|
||||||
$cp->description = $description;
|
$cp->description = $description;
|
||||||
$cp->date_debut = $date_debut;
|
$cp->date_debut = $date_debut;
|
||||||
$cp->date_fin = $date_fin;
|
$cp->date_fin = $date_fin;
|
||||||
@ -689,7 +688,7 @@ llxHeader('', $langs->trans('CPTitreMenu'));
|
|||||||
if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create')
|
if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create')
|
||||||
{
|
{
|
||||||
// Si l'utilisateur n'a pas le droit de faire une demande
|
// Si l'utilisateur n'a pas le droit de faire une demande
|
||||||
if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all)))
|
if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
|
||||||
{
|
{
|
||||||
$errors[]=$langs->trans('CantCreateCP');
|
$errors[]=$langs->trans('CantCreateCP');
|
||||||
}
|
}
|
||||||
@ -769,7 +768,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
|||||||
// Formulaire de demande
|
// Formulaire de demande
|
||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n";
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n";
|
||||||
print '<input type="hidden" name="action" value="create" />'."\n";
|
print '<input type="hidden" name="action" value="create" />'."\n";
|
||||||
print '<input type="hidden" name="userID" value="'.$userid.'" />'."\n";
|
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
@ -800,10 +798,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
if (empty($user->rights->holiday->write_all))
|
if (empty($user->rights->holiday->write_all))
|
||||||
{
|
{
|
||||||
print $form->select_dolusers($userid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print $form->select_dolusers($fuserid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||||
print '<input type="hidden" name="userid" value="'.$userid.'">';
|
print '<input type="hidden" name="fuserid" value="'.($fuserid?$fuserid:$user->id).'">';
|
||||||
}
|
}
|
||||||
else print $form->select_dolusers(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0);
|
else print $form->select_dolusers(GETPOST('fuserid')?GETPOST('fuserid'):$user->id,'fuserid',0,'',0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -258,7 +258,7 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP 5.
|
|||||||
|
|
||||||
// Defini objet langs
|
// Defini objet langs
|
||||||
$langs = new Translate('..',$conf);
|
$langs = new Translate('..',$conf);
|
||||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang'));
|
if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09'));
|
||||||
else $langs->setDefaultLang('auto');
|
else $langs->setDefaultLang('auto');
|
||||||
|
|
||||||
$bc[false]=' class="bg1"';
|
$bc[false]=' class="bg1"';
|
||||||
@ -442,9 +442,9 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0)
|
|||||||
print '<div class="nextbutton" id="nextbutton">';
|
print '<div class="nextbutton" id="nextbutton">';
|
||||||
if ($nonext == '2')
|
if ($nonext == '2')
|
||||||
{
|
{
|
||||||
print $langs->trans("ErrorFoundDuringMigration", $_SERVER["REQUEST_URI"].'&ignoreerrors=1').'<br><br>';
|
print $langs->trans("ErrorFoundDuringMigration", $_SERVER["REQUEST_URI"].'&ignoreerrors=1').'<br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="submit" '.($nonext == '2' ? 'disabled="disabled" ':'').'value="'.$langs->trans("NextStep").' ->"';
|
print '<input type="submit" '.($nonext == '2' ? 'disabled="disabled" ':'').'value="'.$langs->trans("NextStep").' ->"';
|
||||||
if ($jscheckfunction) print ' onClick="return '.$jscheckfunction.'();"';
|
if ($jscheckfunction) print ' onClick="return '.$jscheckfunction.'();"';
|
||||||
print '></div>';
|
print '></div>';
|
||||||
|
|||||||
@ -62,6 +62,21 @@ ALTER TABLE llx_societe MODIFY COLUMN fk_currency varchar(3) NULL;
|
|||||||
ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
||||||
ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
|
ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00';
|
||||||
|
|
||||||
|
-- Clean corrupted values for tms
|
||||||
|
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
|
||||||
|
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
|
||||||
|
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
|
||||||
|
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
|
||||||
|
-- Remove default not null on date_fin
|
||||||
|
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
|
||||||
|
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
|
||||||
|
|
||||||
|
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
|
||||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments tinyint NOT NULL DEFAULT 1;
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments tinyint NOT NULL DEFAULT 1;
|
||||||
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN survey_link_visible;
|
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN survey_link_visible;
|
||||||
@ -189,9 +204,14 @@ CREATE TABLE llx_payment_salary (
|
|||||||
fk_user_modif integer
|
fk_user_modif integer
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
|
||||||
|
DELETE FROM llx_product_batch where fk_product_stock NOT IN (SELECT rowid from llx_product_stock);
|
||||||
|
|
||||||
ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock);
|
ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock);
|
||||||
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);
|
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);
|
||||||
|
|
||||||
|
DELETE FROM llx_expeditiondet_batch where fk_expeditiondet NOT IN (SELECT rowid from llx_expeditiondet);
|
||||||
|
|
||||||
ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet);
|
ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet);
|
||||||
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);
|
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);
|
||||||
|
|
||||||
|
|||||||
@ -611,3 +611,7 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14
|
|||||||
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
|
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
|
||||||
|
|
||||||
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
|
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
|
||||||
|
|
||||||
|
-- Negative buying prices
|
||||||
|
|
||||||
|
UPDATE llx_facturedet SET buy_price_ht = ABS(buy_price_ht)
|
||||||
|
|||||||
@ -545,4 +545,6 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178,
|
|||||||
-- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL;
|
-- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL;
|
||||||
-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL;
|
-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
|
ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
|
||||||
|
|
||||||
|
ALTER TABLE llx_user MODIFY COLUMN login varchar(50);
|
||||||
@ -33,7 +33,7 @@ create table llx_user
|
|||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_user_creat integer,
|
fk_user_creat integer,
|
||||||
fk_user_modif integer,
|
fk_user_modif integer,
|
||||||
login varchar(24) NOT NULL,
|
login varchar(50) NOT NULL,
|
||||||
pass varchar(128),
|
pass varchar(128),
|
||||||
pass_crypted varchar(128),
|
pass_crypted varchar(128),
|
||||||
pass_temp varchar(128), -- temporary password when asked for forget password
|
pass_temp varchar(128), -- temporary password when asked for forget password
|
||||||
|
|||||||
@ -567,7 +567,7 @@ if (! defined('NOLOGIN'))
|
|||||||
$paramsurl=array();
|
$paramsurl=array();
|
||||||
if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int');
|
if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int');
|
||||||
if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int');
|
if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int');
|
||||||
if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang','alpha');
|
if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang', 'aZ09');
|
||||||
header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):''));
|
header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):''));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -626,7 +626,7 @@ if (! defined('NOLOGIN'))
|
|||||||
$paramsurl=array();
|
$paramsurl=array();
|
||||||
if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int');
|
if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int');
|
||||||
if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int');
|
if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int');
|
||||||
if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang','alpha');
|
if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang', 'aZ09');
|
||||||
header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):''));
|
header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):''));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -246,7 +246,7 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
|
|||||||
// Set default language (must be after the setValues setting global $conf->global->MAIN_LANG_DEFAULT. Page main.inc.php will overwrite langs->defaultlang with user value later)
|
// Set default language (must be after the setValues setting global $conf->global->MAIN_LANG_DEFAULT. Page main.inc.php will overwrite langs->defaultlang with user value later)
|
||||||
if (! defined('NOREQUIRETRAN'))
|
if (! defined('NOREQUIRETRAN'))
|
||||||
{
|
{
|
||||||
$langcode=(GETPOST('lang')?GETPOST('lang','alpha',1):(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT));
|
$langcode=(GETPOST('lang', 'aZ09')?GETPOST('lang', 'aZ09', 1):(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT));
|
||||||
$langs->setDefaultLang($langcode);
|
$langs->setDefaultLang($langcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -141,7 +141,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
elseif ($user->rights->facture->lire)
|
elseif ($user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
||||||
$sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,";
|
$sql.= " f.facnumber, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,";
|
||||||
$sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
|
$sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
@ -232,23 +232,24 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$var=True;
|
$var=True;
|
||||||
while ($i < min($num,$conf->liste_limit))
|
while ($i < min($num,$conf->liste_limit))
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$invoicestatic->id=$objp->facid;
|
||||||
|
$invoicestatic->ref=$objp->facnumber;
|
||||||
|
$societestatic->fetch($objp->socid);
|
||||||
|
$paiement = $invoicestatic->getSommePaiement();
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$invoicestatic->id=$objp->facid;
|
|
||||||
$invoicestatic->ref=$objp->facnumber;
|
|
||||||
print $invoicestatic->getNomUrl(1);
|
print $invoicestatic->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
$societestatic->fetch($objp->socid);
|
|
||||||
print '<td>'.$societestatic->getNomUrl(1).'</td>';
|
print '<td>'.$societestatic->getNomUrl(1).'</td>';
|
||||||
print "<td>".$objp->code_client."</td>\n";
|
print "<td>".$objp->code_client."</td>\n";
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($objp->datef),'day')."</td>";
|
print dol_print_date($db->jdate($objp->datef),'day')."</td>";
|
||||||
print '<td align="center">'.$objp->qty."</td>\n";
|
print '<td align="center">'.$objp->qty."</td>\n";
|
||||||
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
||||||
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5,$paiement,$objp->type).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
|||||||
@ -526,7 +526,8 @@ if (empty($reshook))
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Set if we used free entry or predefined product
|
// Set if we used free entry or predefined product
|
||||||
$predef='';
|
$predef='';
|
||||||
|
$ref_fourn = GETPOST('fourn_ref');
|
||||||
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
|
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
|
||||||
$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
|
$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
|
||||||
$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
||||||
@ -614,7 +615,7 @@ if (empty($reshook))
|
|||||||
$price_base_type = $productsupplier->fourn_price_base_type;
|
$price_base_type = $productsupplier->fourn_price_base_type;
|
||||||
$type = $productsupplier->type;
|
$type = $productsupplier->type;
|
||||||
$label = $productsupplier->label;
|
$label = $productsupplier->label;
|
||||||
$desc = $productsupplier->description;
|
$desc = $productsupplier->description;
|
||||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
|
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
|
||||||
|
|
||||||
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
|
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
|
||||||
|
|||||||
@ -2738,6 +2738,7 @@ class SupplierProposalLine extends CommonObject
|
|||||||
if (empty($this->special_code)) $this->special_code=0;
|
if (empty($this->special_code)) $this->special_code=0;
|
||||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||||
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
|
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
|
||||||
|
if (empty($this->subprice)) $this->subprice=0;
|
||||||
|
|
||||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||||
|
|
||||||
@ -2920,6 +2921,7 @@ class SupplierProposalLine extends CommonObject
|
|||||||
if (empty($this->special_code)) $this->special_code=0;
|
if (empty($this->special_code)) $this->special_code=0;
|
||||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||||
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
|
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
|
||||||
|
if (empty($this->subprice)) $this->subprice=0;
|
||||||
|
|
||||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,7 @@ if (empty($conf->db->user)) $conf->db->user='';
|
|||||||
|
|
||||||
// Defini objet langs
|
// Defini objet langs
|
||||||
$langs = new Translate('..',$conf);
|
$langs = new Translate('..',$conf);
|
||||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang'));
|
if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09'));
|
||||||
else $langs->setDefaultLang('auto');
|
else $langs->setDefaultLang('auto');
|
||||||
|
|
||||||
$bc[false]=' class="bg1"';
|
$bc[false]=' class="bg1"';
|
||||||
|
|||||||
@ -53,7 +53,7 @@ else header('Cache-Control: no-cache');
|
|||||||
// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
|
// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
|
||||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
|
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
|
||||||
|
|
||||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang', 'alpha')); // If language was forced on URL
|
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL
|
||||||
if (GETPOST('theme')) $conf->theme=GETPOST('theme', 'alpha'); // If theme was forced on URL
|
if (GETPOST('theme')) $conf->theme=GETPOST('theme', 'alpha'); // If theme was forced on URL
|
||||||
$langs->load("main",0,1);
|
$langs->load("main",0,1);
|
||||||
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
||||||
@ -1101,7 +1101,7 @@ div.menu_titre {
|
|||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
padding-bottom: 4px;
|
padding-bottom: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.mainmenuaspan
|
.mainmenuaspan
|
||||||
{
|
{
|
||||||
@ -1488,7 +1488,7 @@ a.vsmenu.addbookmarkpicto {
|
|||||||
{
|
{
|
||||||
/* border-bottom: 1px solid #BBB; */
|
/* border-bottom: 1px solid #BBB; */
|
||||||
}
|
}
|
||||||
div.blockvmenusearchphone
|
div.blockvmenusearchphone
|
||||||
{
|
{
|
||||||
border-bottom: none !important;
|
border-bottom: none !important;
|
||||||
}
|
}
|
||||||
@ -2681,7 +2681,7 @@ div.liste_titre_bydiv {
|
|||||||
border-top-width: <?php echo $borderwith ?>px;
|
border-top-width: <?php echo $borderwith ?>px;
|
||||||
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
|
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
|
||||||
border-top-style: solid;
|
border-top-style: solid;
|
||||||
|
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
display: table;
|
display: table;
|
||||||
padding: 2px 0px 2px 0;
|
padding: 2px 0px 2px 0;
|
||||||
@ -3288,7 +3288,7 @@ td.hidden {
|
|||||||
border-bottom: 1px solid #888;
|
border-bottom: 1px solid #888;
|
||||||
background: #eee;
|
background: #eee;
|
||||||
}
|
}
|
||||||
.websitebar .button, .websitebar .buttonDelete
|
.websitebar .button, .websitebar .buttonDelete
|
||||||
{
|
{
|
||||||
padding: 2px 5px 3px 5px !important;
|
padding: 2px 5px 3px 5px !important;
|
||||||
margin: 2px 4px 2px 4px !important;
|
margin: 2px 4px 2px 4px !important;
|
||||||
@ -3297,7 +3297,7 @@ td.hidden {
|
|||||||
.websiteselection {
|
.websiteselection {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
line-height: 29px;
|
line-height: 29px;
|
||||||
}
|
}
|
||||||
.websitetools {
|
.websitetools {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ else header('Cache-Control: no-cache');
|
|||||||
// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
|
// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
|
||||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
|
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
|
||||||
|
|
||||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL
|
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL
|
||||||
if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on URL
|
if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on URL
|
||||||
$langs->load("main",0,1);
|
$langs->load("main",0,1);
|
||||||
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
||||||
@ -520,7 +520,7 @@ div.divsearchfield {
|
|||||||
margin-<?php print $left; ?>: 2px;
|
margin-<?php print $left; ?>: 2px;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
padding-left: 2px;
|
padding-left: 2px;
|
||||||
}
|
}
|
||||||
div.confirmmessage {
|
div.confirmmessage {
|
||||||
padding-top: 6px;
|
padding-top: 6px;
|
||||||
@ -545,8 +545,8 @@ div.myavailability {
|
|||||||
}
|
}
|
||||||
.checkallactions {
|
.checkallactions {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
.selectlimit {
|
.selectlimit {
|
||||||
margin-right: 10px !important;
|
margin-right: 10px !important;
|
||||||
@ -713,7 +713,7 @@ td.showDragHandle {
|
|||||||
<?php if (GETPOST("optioncss") != 'print') { ?>
|
<?php if (GETPOST("optioncss") != 'print') { ?>
|
||||||
padding-left: 229px;
|
padding-left: 229px;
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
.side-nav {
|
.side-nav {
|
||||||
@ -919,7 +919,7 @@ table.noborder tr.liste_titre td {
|
|||||||
padding-right: 1px;
|
padding-right: 1px;
|
||||||
padding-top: 1px;
|
padding-top: 1px;
|
||||||
padding-bottom: 1px;
|
padding-bottom: 1px;
|
||||||
width: 44px;
|
width: 44px;
|
||||||
}
|
}
|
||||||
div.attacharea {
|
div.attacharea {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
@ -934,7 +934,7 @@ div.arearef {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
div.heightref {
|
div.heightref {
|
||||||
min-height: 74px;
|
min-height: 74px;
|
||||||
}
|
}
|
||||||
div.divphotoref {
|
div.divphotoref {
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
@ -1131,7 +1131,7 @@ div.tmenucenter
|
|||||||
div.menu_titre {
|
div.menu_titre {
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.mainmenuaspan
|
.mainmenuaspan
|
||||||
{
|
{
|
||||||
@ -1493,8 +1493,8 @@ div.vmenu, td.vmenu {
|
|||||||
width: 202px;
|
width: 202px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu_contenu {
|
.menu_contenu {
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
padding-bottom: 3px;
|
padding-bottom: 3px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@ -2005,8 +2005,8 @@ span.tabspan {
|
|||||||
/* Boutons actions */
|
/* Boutons actions */
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
div.divButAction {
|
div.divButAction {
|
||||||
margin-bottom: 1.4em;
|
margin-bottom: 1.4em;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2072,16 +2072,16 @@ span.butAction, span.butActionDelete {
|
|||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
border-color: #555;
|
border-color: #555;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
|
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
||||||
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
||||||
background-repeat: repeat-x
|
background-repeat: repeat-x
|
||||||
}
|
}
|
||||||
|
|
||||||
.butActionDelete, .buttonDelete {
|
.butActionDelete, .buttonDelete {
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||||
@ -2231,7 +2231,7 @@ table.liste, table.noborder, table.formdoc, div.noborder {
|
|||||||
border-bottom-width: 1px;
|
border-bottom-width: 1px;
|
||||||
border-bottom-color: #BBB;
|
border-bottom-color: #BBB;
|
||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
|
|
||||||
margin: 0px 0px 8px 0px;
|
margin: 0px 0px 8px 0px;
|
||||||
/*
|
/*
|
||||||
-moz-box-shadow: 2px 2px 4px #CCC;
|
-moz-box-shadow: 2px 2px 4px #CCC;
|
||||||
@ -2239,7 +2239,7 @@ table.liste, table.noborder, table.formdoc, div.noborder {
|
|||||||
box-shadow: 2px 2px 4px #CCC;
|
box-shadow: 2px 2px 4px #CCC;
|
||||||
*/
|
*/
|
||||||
/* box-shadow: 0 0 3px rgba(0,0,0,0.16); */
|
/* box-shadow: 0 0 3px rgba(0,0,0,0.16); */
|
||||||
|
|
||||||
-moz-border-radius: 0.1em;
|
-moz-border-radius: 0.1em;
|
||||||
-webkit-border-radius: 0.1em;
|
-webkit-border-radius: 0.1em;
|
||||||
border-radius: 0.1em;
|
border-radius: 0.1em;
|
||||||
@ -2495,7 +2495,7 @@ div.pagination li.paginationafterarrows {
|
|||||||
margin-bottom: 1px;
|
margin-bottom: 1px;
|
||||||
color: #202020;
|
color: #202020;
|
||||||
min-height: 18px; /* seems to not be used */
|
min-height: 18px; /* seems to not be used */
|
||||||
|
|
||||||
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
|
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
|
||||||
}
|
}
|
||||||
#GanttChartDIV {
|
#GanttChartDIV {
|
||||||
@ -2562,7 +2562,7 @@ div.liste_titre_bydiv {
|
|||||||
border-top-width: <?php echo $borderwith; ?>px;
|
border-top-width: <?php echo $borderwith; ?>px;
|
||||||
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
|
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
|
||||||
border-top-style: solid;
|
border-top-style: solid;
|
||||||
|
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
display: table;
|
display: table;
|
||||||
@ -2589,7 +2589,7 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list
|
|||||||
background: rgb(<?php echo $colorbacktitle1; ?>);
|
background: rgb(<?php echo $colorbacktitle1; ?>);
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>;
|
font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>;
|
||||||
|
|
||||||
color: rgb(<?php echo $colortexttitle; ?>);
|
color: rgb(<?php echo $colortexttitle; ?>);
|
||||||
font-family: <?php print $fontlist ?>;
|
font-family: <?php print $fontlist ?>;
|
||||||
border-bottom: 1px solid #FDFFFF;
|
border-bottom: 1px solid #FDFFFF;
|
||||||
@ -2745,7 +2745,7 @@ span.dashboardlineko {
|
|||||||
|
|
||||||
tr.box_titre {
|
tr.box_titre {
|
||||||
height: 26px !important;
|
height: 26px !important;
|
||||||
|
|
||||||
/* TO MATCH BOOTSTRAP */
|
/* TO MATCH BOOTSTRAP */
|
||||||
/*background: #ddd;
|
/*background: #ddd;
|
||||||
color: #000 !important; */
|
color: #000 !important; */
|
||||||
@ -2760,7 +2760,7 @@ tr.box_titre {
|
|||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
background: rgb(<?php echo $colorbacktitle1; ?>);
|
background: rgb(<?php echo $colorbacktitle1; ?>);
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
color: rgb(<?php echo $colortexttitle; ?>);
|
color: rgb(<?php echo $colortexttitle; ?>);
|
||||||
font-family: <?php print $fontlist ?>, sans-serif;
|
font-family: <?php print $fontlist ?>, sans-serif;
|
||||||
@ -3184,7 +3184,7 @@ td.hidden {
|
|||||||
border-bottom: 1px solid #888;
|
border-bottom: 1px solid #888;
|
||||||
background: #eee;
|
background: #eee;
|
||||||
}
|
}
|
||||||
.websitebar .button, .websitebar .buttonDelete
|
.websitebar .button, .websitebar .buttonDelete
|
||||||
{
|
{
|
||||||
padding: 2px 4px 2px 4px !important;
|
padding: 2px 4px 2px 4px !important;
|
||||||
margin: 2px 4px 2px 4px !important;
|
margin: 2px 4px 2px 4px !important;
|
||||||
@ -3193,7 +3193,7 @@ td.hidden {
|
|||||||
.websiteselection {
|
.websiteselection {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
line-height: 29px;
|
line-height: 29px;
|
||||||
}
|
}
|
||||||
.websitetools {
|
.websitetools {
|
||||||
@ -4297,7 +4297,7 @@ img.demothumb {
|
|||||||
@media only screen and (max-width: 767px)
|
@media only screen and (max-width: 767px)
|
||||||
{
|
{
|
||||||
.imgopensurveywizard { width:95%; height: auto; }
|
.imgopensurveywizard { width:95%; height: auto; }
|
||||||
|
|
||||||
#tooltip {
|
#tooltip {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: <?php print dol_size(350,'width'); ?>px;
|
width: <?php print dol_size(350,'width'); ?>px;
|
||||||
@ -4375,7 +4375,7 @@ img.demothumb {
|
|||||||
div.mainmenu {
|
div.mainmenu {
|
||||||
min-width: 20px;
|
min-width: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#tooltip {
|
#tooltip {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: <?php print dol_size(300,'width'); ?>px;
|
width: <?php print dol_size(300,'width'); ?>px;
|
||||||
|
|||||||
@ -100,7 +100,7 @@ $arrayfields=array(
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
}
|
}
|
||||||
@ -116,9 +116,9 @@ $search_gender=GETPOST('search_gender','alpha');
|
|||||||
$search_employee=GETPOST('search_employee','alpha');
|
$search_employee=GETPOST('search_employee','alpha');
|
||||||
$search_accountancy_code=GETPOST('search_accountancy_code','alpha');
|
$search_accountancy_code=GETPOST('search_accountancy_code','alpha');
|
||||||
$search_email=GETPOST('search_email','alpha');
|
$search_email=GETPOST('search_email','alpha');
|
||||||
$search_statut=GETPOST('search_statut','alpha');
|
$search_statut=GETPOST('search_statut','intcomma');
|
||||||
$search_thirdparty=GETPOST('search_thirdparty','alpha');
|
$search_thirdparty=GETPOST('search_thirdparty','alpha');
|
||||||
$search_supervisor=GETPOST('search_supervisor','alpha');
|
$search_supervisor=GETPOST('search_supervisor','intcomma');
|
||||||
$search_previousconn=GETPOST('search_previousconn','alpha');
|
$search_previousconn=GETPOST('search_previousconn','alpha');
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ if ($mode == 'employee') $search_employee=1;
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
@ -196,8 +196,8 @@ else
|
|||||||
}
|
}
|
||||||
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
|
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
|
||||||
//if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
|
//if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
|
||||||
if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$search_supervisor;
|
if ($search_supervisor > 0) $sql.= " AND u.fk_user = ".$db->escape($search_supervisor);
|
||||||
if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty);
|
if ($search_thirdparty != '') $sql.= natural_search(array('s.nom'), $search_thirdparty);
|
||||||
if ($search_login != '') $sql.= natural_search("u.login", $search_login);
|
if ($search_login != '') $sql.= natural_search("u.login", $search_login);
|
||||||
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
|
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
|
||||||
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
|
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
|
||||||
@ -206,9 +206,9 @@ if (is_numeric($search_employee) && $search_employee >= 0) {
|
|||||||
$sql .= ' AND u.employee = '.(int) $search_employee;
|
$sql .= ' AND u.employee = '.(int) $search_employee;
|
||||||
}
|
}
|
||||||
if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code);
|
if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code);
|
||||||
if ($search_email != '') $sql.= natural_search("u.email", $search_email);
|
if ($search_email != '') $sql.= natural_search("u.email", $search_email);
|
||||||
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")";
|
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND u.statut IN (".$db->escape($search_statut).")";
|
||||||
if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
|
if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
{
|
{
|
||||||
@ -217,7 +217,7 @@ foreach ($search_array_options as $key => $val)
|
|||||||
$typ=$extrafields->attribute_type[$tmpkey];
|
$typ=$extrafields->attribute_type[$tmpkey];
|
||||||
$mode=0;
|
$mode=0;
|
||||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||||
{
|
{
|
||||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||||
}
|
}
|
||||||
@ -265,27 +265,27 @@ if ($result)
|
|||||||
$crit=$val;
|
$crit=$val;
|
||||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
|
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
|
||||||
@ -303,9 +303,9 @@ if ($result)
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
@ -340,7 +340,7 @@ if ($result)
|
|||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman"));
|
$arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman"));
|
||||||
print $form->selectarray('search_gender', $arraygender, $search_gender, 1);
|
print $form->selectarray('search_gender', $arraygender, $search_gender, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.employee']['checked']))
|
if (! empty($arrayfields['u.employee']['checked']))
|
||||||
@ -380,9 +380,9 @@ if ($result)
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
$typeofextrafield=$extrafields->attribute_type[$key];
|
$typeofextrafield=$extrafields->attribute_type[$key];
|
||||||
@ -428,7 +428,7 @@ if ($result)
|
|||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$user2=new User($db);
|
$user2=new User($db);
|
||||||
@ -451,7 +451,7 @@ if ($result)
|
|||||||
$userstatic->lastname=$obj->lastname;
|
$userstatic->lastname=$obj->lastname;
|
||||||
$userstatic->employee=$obj->employee;
|
$userstatic->employee=$obj->employee;
|
||||||
$userstatic->photo=$obj->photo;
|
$userstatic->photo=$obj->photo;
|
||||||
|
|
||||||
$li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login');
|
$li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login');
|
||||||
|
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
@ -564,8 +564,8 @@ if ($result)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date last login
|
// Date last login
|
||||||
if (! empty($arrayfields['u.datelastlogin']['checked']))
|
if (! empty($arrayfields['u.datelastlogin']['checked']))
|
||||||
{
|
{
|
||||||
@ -576,13 +576,13 @@ if ($result)
|
|||||||
{
|
{
|
||||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>';
|
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
print '<td';
|
print '<td';
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
|||||||
@ -104,7 +104,7 @@ function migrate_product_photospath($product)
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$dir = $conf->product->multidir_output[$product->entity];
|
$dir = $conf->product->multidir_output[$product->entity];
|
||||||
$origin = $dir .'/'. get_exdir($product->id,2) . $product->id ."/photos";
|
$origin = $dir .'/'. get_exdir($product->id,2,0,0,$product,'product') . $product->id ."/photos";
|
||||||
$destin = $dir.'/'.dol_sanitizeFileName($product->ref);
|
$destin = $dir.'/'.dol_sanitizeFileName($product->ref);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user