Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into
develop Conflicts: htdocs/install/mysql/migration/4.0.0-5.0.0.sql
This commit is contained in:
commit
7bf6ad49da
@ -1,10 +1,19 @@
|
||||
|
||||
To test upgrade of a lib with composer:
|
||||
* To list packages
|
||||
|
||||
composer update --no-dev --no-autoloader --dry-run ccampbell/chromephp
|
||||
composer show -i
|
||||
|
||||
To upgrade a lib with composer:
|
||||
* To test upgrade of a lib with composer:
|
||||
|
||||
Remove entry in composer.lock
|
||||
Edit composer.json to change version to "x.y.z"
|
||||
composer -v update --root-reqs --no-dev --no-autoloader --dry-run ccampbell/chromephp
|
||||
|
||||
* To upgrade a lib with composer:
|
||||
|
||||
Remove entry in composer.lock
|
||||
Edit composer.json to change version to "x.y.z"
|
||||
composer -v update --root-reqs --no-dev --no-autoloader ccampbell/chromephp
|
||||
|
||||
composer update --no-dev --no-autoloader ccampbell/chromephp
|
||||
|
||||
|
||||
|
||||
@ -295,12 +295,16 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER
|
||||
* Edit orig.tar.gz file to remove
|
||||
- debian
|
||||
- htdocs/includes/ckeditor
|
||||
- htdocs/includes/jszip
|
||||
- htdocs/includes/jquery/css
|
||||
- htdocs/includes/jquery/js
|
||||
- htdocs/includes/jquery/plugins/flot
|
||||
- htdocs/includes/jquery/plugins/multiselect
|
||||
- htdocs/includes/jquery/plugins/datatables
|
||||
- htdocs/includes/jszip
|
||||
- htdocs/includes/mike42
|
||||
- htdocs/includes/phpexcel or htdocs/includes/phpoffice
|
||||
- htdocs/includes/swiftmailer
|
||||
- htdocs/includes/restler/framework/Luracast/Restler/explorer
|
||||
- htdocs/includes/swiftmailer
|
||||
- htdocs/includes/tcpdf or htdocs/includes/tecnickcom
|
||||
And rename file into
|
||||
dolibarr-x.y.z+dfsgw.tgz
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
"php": ">=5.3.0",
|
||||
"ext-curl": "*",
|
||||
"ccampbell/chromephp": "4.1.0",
|
||||
"ckeditor/ckeditor": "dev-full/stable",
|
||||
"ckeditor/ckeditor": "4.5.9",
|
||||
"mike42/escpos-php": "1.2.1",
|
||||
"mobiledetect/mobiledetectlib": "2.8.17",
|
||||
"phpoffice/phpexcel": "1.8.1",
|
||||
|
||||
1406
composer.lock
generated
1406
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -53,6 +53,7 @@ $langs->load("other");
|
||||
// Get parameters
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
$cancel = GETPOST('cancel');
|
||||
$backtopage = GETPOST('backtopage');
|
||||
$myparam = GETPOST('myparam','alpha');
|
||||
|
||||
@ -95,6 +96,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($cancel)
|
||||
{
|
||||
if ($action != 'addlink')
|
||||
{
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
if ($id > 0 || ! empty($ref)) $ret = $object->fetch($id,$ref);
|
||||
$action='';
|
||||
}
|
||||
|
||||
// Action to add record
|
||||
if ($action == 'add')
|
||||
{
|
||||
@ -140,11 +153,8 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
// Cancel
|
||||
if ($action == 'update' && GETPOST('cancel')) $action='view';
|
||||
|
||||
// Action to update record
|
||||
if ($action == 'update' && ! GETPOST('cancel'))
|
||||
if ($action == 'update')
|
||||
{
|
||||
$error=0;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -329,7 +329,7 @@ if ($result)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="14" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
// On sell
|
||||
print '<td class="liste_titre"></td>';
|
||||
|
||||
@ -1146,12 +1146,12 @@ class Adherent extends CommonObject
|
||||
$this->birth = $this->db->jdate($obj->birthday);
|
||||
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->morphy = $obj->morphy;
|
||||
|
||||
$this->typeid = $obj->fk_adherent_type;
|
||||
$this->type = $obj->type;
|
||||
$this->need_subscription = ($obj->subscription=='yes'?1:0);
|
||||
$this->type = $obj->type;
|
||||
$this->need_subscription = $obj->subscription;
|
||||
|
||||
$this->user_id = $obj->user_id;
|
||||
$this->user_login = $obj->user_login;
|
||||
|
||||
@ -45,7 +45,7 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
public $cotisation;
|
||||
/**
|
||||
* @var bool Subsription required
|
||||
* @var int Subsription required (0 or 1)
|
||||
* @since 5.0
|
||||
*/
|
||||
public $subscription;
|
||||
|
||||
@ -86,7 +86,7 @@ $hookmanager->initHooks(array('admin'));
|
||||
// Put here declaration of dictionaries properties
|
||||
|
||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0);
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,32,0);
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
$tabname=array();
|
||||
|
||||
@ -23,8 +23,7 @@ use Luracast\Restler\Defaults;
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
|
||||
/**
|
||||
* Class for API
|
||||
*
|
||||
* Class for API REST v1
|
||||
*/
|
||||
class DolibarrApi
|
||||
{
|
||||
@ -55,6 +54,8 @@ class DolibarrApi
|
||||
$this->db = $db;
|
||||
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
|
||||
$this->r = new Restler($production_mode);
|
||||
|
||||
$this->r->setAPIVersion(1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -97,6 +98,7 @@ class DolibarrApi
|
||||
unset($object->statuts);
|
||||
unset($object->statuts_short);
|
||||
unset($object->statuts_logo);
|
||||
unset($object->statuts_long);
|
||||
|
||||
// Remove the $oldcopy property because it is not supported by the JSON
|
||||
// encoder. The following error is generated when trying to serialize
|
||||
|
||||
@ -106,7 +106,10 @@ foreach ($modulesdir as $dir)
|
||||
elseif ($module == 'facture') {
|
||||
$moduledirforclass = 'compta/facture';
|
||||
}
|
||||
|
||||
elseif ($module == 'project') {
|
||||
$moduledirforclass = 'projet';
|
||||
}
|
||||
|
||||
// Defined if module is enabled
|
||||
$enabled=true;
|
||||
if (empty($conf->$moduleforperm->enabled)) $enabled=false;
|
||||
@ -135,7 +138,7 @@ foreach ($modulesdir as $dir)
|
||||
require_once $dir_part.$file_searched;
|
||||
if (class_exists($classname))
|
||||
{
|
||||
dol_syslog("Found deprecated API classname=".$classname." into ".$dir);
|
||||
dol_syslog("Found deprecated API by index.php classname=".$classname." into ".$dir);
|
||||
$api->r->addAPIClass($classname, '/');
|
||||
}
|
||||
}
|
||||
@ -145,7 +148,7 @@ foreach ($modulesdir as $dir)
|
||||
require_once $dir_part.$file_searched;
|
||||
if (class_exists($classname))
|
||||
{
|
||||
dol_syslog("Found API classname=".$classname." into ".$dir);
|
||||
dol_syslog("Found API by index.php classname=".$classname." into ".$dir);
|
||||
$listofapis[] = $classname;
|
||||
}
|
||||
}
|
||||
@ -161,13 +164,14 @@ foreach ($modulesdir as $dir)
|
||||
// shows the classes in the order they are added and it's a mess if they are
|
||||
// not sorted.
|
||||
sort($listofapis);
|
||||
//var_dump($listofapis);
|
||||
foreach ($listofapis as $classname)
|
||||
{
|
||||
$api->r->addAPIClass($classname);
|
||||
}
|
||||
|
||||
// TODO If not found, redirect to explorer
|
||||
|
||||
//var_dump($api);
|
||||
|
||||
// Call API (we suppose we found it)
|
||||
$api->r->handle();
|
||||
|
||||
@ -199,7 +199,7 @@ dol_fiche_head($head, 'card', $title, 0, 'category');
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete');
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1);
|
||||
}
|
||||
|
||||
print '<table width="100%" class="border">';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -333,7 +333,7 @@ if (empty($reshook))
|
||||
dol_syslog("comm/mailing/card.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING);
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql.=" SET statut=-1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
|
||||
$sql.=" SET statut=-1, error_text='".$db->escape($mail->error)."', date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
|
||||
$resql2=$db->query($sql);
|
||||
if (! $resql2)
|
||||
{
|
||||
@ -668,7 +668,15 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print load_fiche_titre($langs->trans("NewMailing"));
|
||||
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
|
||||
foreach($object->substitutionarray as $key => $val)
|
||||
{
|
||||
$htmltext.=$key.' = '.$langs->trans($val).'<br>';
|
||||
}
|
||||
$htmltext.='</i>';
|
||||
|
||||
// Print mail form
|
||||
print load_fiche_titre($langs->trans("NewMailing"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
@ -693,21 +701,16 @@ if ($action == 'create')
|
||||
print '<tr><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0);
|
||||
print '</td></tr>';
|
||||
print '<tr><td valign="top"><span class="fieldrequired">'.$langs->trans("MailMessage").'</span><br>';
|
||||
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||
foreach($object->substitutionarray as $key => $val)
|
||||
{
|
||||
print $key.' = '.$langs->trans($val).'<br>';
|
||||
}
|
||||
print '</i></td>';
|
||||
print '<td>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<div style="padding-top: 10px">';
|
||||
// Editeur wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></div>';
|
||||
@ -788,17 +791,24 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
||||
$morehtmlright='';
|
||||
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
/* print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object,'id', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
*/
|
||||
// Description
|
||||
print '<tr><td>'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefield">'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
|
||||
print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
|
||||
print '</td></tr>';
|
||||
|
||||
@ -813,10 +823,12 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
/*
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4);
|
||||
if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')';
|
||||
print'</td></tr>';
|
||||
|
||||
*/
|
||||
|
||||
// Nb of distinct emails
|
||||
print '<tr><td>';
|
||||
print $langs->trans("TotalNbOfDistinctRecipients");
|
||||
@ -987,11 +999,19 @@ else
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
|
||||
foreach($object->substitutionarray as $key => $val)
|
||||
{
|
||||
$htmltext.=$key.' = '.$langs->trans($val).'<br>';
|
||||
}
|
||||
$htmltext.='</i>';
|
||||
|
||||
// Print mail content
|
||||
print load_fiche_titre($langs->trans("EMail"),'','');
|
||||
|
||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Subject
|
||||
@ -1019,16 +1039,11 @@ else
|
||||
/*print '<tr><td width="15%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0);
|
||||
print '</td></tr>';*/
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
// Message
|
||||
print '<tr><td valign="top">'.$langs->trans("MailMessage").'<br>';
|
||||
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||
foreach($object->substitutionarray as $key => $val)
|
||||
{
|
||||
print $key.' = '.$langs->trans($val).'<br>';
|
||||
}
|
||||
print '</i></td>';
|
||||
print '<td colspan="3" bgcolor="'.($object->bgcolor?(preg_match('/^#/',$object->bgcolor)?'':'#').$object->bgcolor:'white').'">';
|
||||
print '<div style="padding-top: 10px" bgcolor="'.($object->bgcolor?(preg_match('/^#/',$object->bgcolor)?'':'#').$object->bgcolor:'white').'">';
|
||||
if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff')
|
||||
{
|
||||
$readonly=1;
|
||||
@ -1038,12 +1053,10 @@ else
|
||||
$doleditor->Create();
|
||||
}
|
||||
else print dol_htmlentitiesbr($object->body);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1051,19 +1064,28 @@ else
|
||||
* Mailing en mode edition
|
||||
*/
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlright='';
|
||||
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
/*
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object,'id', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
*/
|
||||
|
||||
// Topic
|
||||
print '<tr><td>'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
|
||||
// From
|
||||
print '<tr><td>'.$langs->trans("MailFrom").'</td><td colspan="3">'.dol_print_email($object->email_from,0,0,0,0,1).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("MailFrom").'</td><td colspan="3">'.dol_print_email($object->email_from,0,0,0,0,1).'</td></tr>';
|
||||
// To
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td colspan="3">'.dol_print_email($object->email_errorsto,0,0,0,0,1).'</td></tr>';
|
||||
|
||||
@ -1100,21 +1122,29 @@ else
|
||||
|
||||
|
||||
|
||||
print "\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '<form name="edit_mailing" action="card.php" method="post" enctype="multipart/form-data">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
|
||||
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
|
||||
foreach($object->substitutionarray as $key => $val)
|
||||
{
|
||||
$htmltext.=$key.' = '.$langs->trans($val).'<br>';
|
||||
}
|
||||
$htmltext.='</i>';
|
||||
|
||||
// Print mail content
|
||||
print load_fiche_titre($langs->trans("EMail"),'','');
|
||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Subject
|
||||
print '<tr><td class="fieldrequired titlefield">'.$langs->trans("MailTopic").'</td><td colspan="3"><input class="flat" type="text" size=60 name="sujet" value="'.$object->sujet.'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired titlefield">'.$langs->trans("MailTopic").'</td><td colspan="3"><input class="flat quatrevingtpercent" type="text" name="sujet" value="'.$object->sujet.'"></td></tr>';
|
||||
|
||||
$trackid=''; // TODO To avoid conflicts with 2 mass emailing, we should set a trackid here, even if we use another one into email header.
|
||||
dol_init_file_process($upload_dir, $trackid);
|
||||
@ -1159,23 +1189,17 @@ else
|
||||
print '<tr><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
// Message
|
||||
print '<tr><td valign="top">'.$langs->trans("MailMessage").'<br>';
|
||||
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||
foreach($object->substitutionarray as $key => $val)
|
||||
{
|
||||
print $key.' = '.$langs->trans($val).'<br>';
|
||||
}
|
||||
print '</i></td>';
|
||||
print '<td colspan="3">';
|
||||
print '<div style="padding-top: 10px">';
|
||||
// Editeur wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,120);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '</div>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@ -38,16 +38,17 @@ $langs->load("mails");
|
||||
if (! $user->rights->mailing->lire || $user->societe_id > 0) accessforbidden();
|
||||
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="email";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
@ -178,17 +179,24 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
dol_fiche_head($head, 'targets', $langs->trans("Mailing"), 0, 'email');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlright='';
|
||||
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
/*
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object,'id', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
|
||||
*/
|
||||
print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("MailFrom").'</td><td colspan="3">'.dol_print_email($object->email_from,0,0,0,0,1).'</td></tr>';
|
||||
|
||||
@ -197,10 +205,10 @@ if ($object->fetch($id) >= 0)
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4);
|
||||
/* print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4);
|
||||
if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')';
|
||||
print '</td></tr>';
|
||||
|
||||
*/
|
||||
// Nb of distinct emails
|
||||
print '<tr><td>';
|
||||
print $langs->trans("TotalNbOfDistinctRecipients");
|
||||
@ -363,7 +371,7 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
|
||||
// List of selected targets
|
||||
$sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type";
|
||||
$sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type, mc.error_text";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.fk_mailing=".$object->id;
|
||||
if ($search_lastname) $sql.= " AND mc.lastname LIKE '%".$db->escape($search_lastname)."%'";
|
||||
@ -441,15 +449,15 @@ if ($object->fetch($id) >= 0)
|
||||
print '<tr class="liste_titre">';
|
||||
// EMail
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_email" size="14" value="'.$search_email.'">';
|
||||
print '<input class="flat maxwidth100" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
|
||||
print '</td>';
|
||||
// Name
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_lastname" size="12" value="'.$search_lastname.'">';
|
||||
print '<input class="flat maxwidth100" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'">';
|
||||
print '</td>';
|
||||
// Firstname
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_firstname" size="10" value="'.$search_firstname.'">';
|
||||
print '<input class="flat maxwidth100" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'">';
|
||||
print '</td>';
|
||||
// Other
|
||||
print '<td class="liste_titre">';
|
||||
@ -468,10 +476,10 @@ if ($object->fetch($id) >= 0)
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print $formmailing->selectDestinariesStatus($search_dest_status,'search_dest_status',1);
|
||||
print '</td>';
|
||||
//Search Icon
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Reset"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -480,9 +488,10 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
if ($num)
|
||||
{
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
@ -537,7 +546,7 @@ if ($object->fetch($id) >= 0)
|
||||
{
|
||||
print '<td align="center">'.$obj->date_envoi.'</td>';
|
||||
print '<td align="right" class="nowrap">';
|
||||
print $object::libStatutDest($obj->statut,2);
|
||||
print $object::libStatutDest($obj->statut,2,$obj->error_text);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -33,7 +33,8 @@ class Mailing extends CommonObject
|
||||
{
|
||||
public $element='mailing';
|
||||
public $table_element='mailing';
|
||||
|
||||
public $picto='email';
|
||||
|
||||
var $titre;
|
||||
var $sujet;
|
||||
var $body;
|
||||
@ -577,12 +578,14 @@ class Mailing extends CommonObject
|
||||
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
* TODO Add class mailin_target.class.php
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @param strin $desc Desc error
|
||||
* @return string Label
|
||||
*/
|
||||
static public function libStatutDest($statut,$mode=0)
|
||||
static public function libStatutDest($statut,$mode=0,$desc='')
|
||||
{
|
||||
global $langs;
|
||||
$langs->load('mails');
|
||||
@ -597,28 +600,28 @@ class Mailing extends CommonObject
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error();
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4');
|
||||
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6');
|
||||
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8');
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error();
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4');
|
||||
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6');
|
||||
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error();
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4');
|
||||
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6');
|
||||
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8');
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error();
|
||||
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
|
||||
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4');
|
||||
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6');
|
||||
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8');
|
||||
|
||||
@ -56,10 +56,10 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAMailing").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td class="nowrap">';
|
||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size="18"></td>';
|
||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat inputsearch" name="sref"></td>';
|
||||
print '<td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||
print '<tr '.$bc[$var].'><td class="nowrap">';
|
||||
print $langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
||||
print $langs->trans("Other").':</td><td><input type="text" class="flat inputsearch" name="sall"></td>';
|
||||
|
||||
print "</table></form><br>\n";
|
||||
|
||||
|
||||
@ -43,24 +43,33 @@ llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:M
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$mil = new Mailing($db);
|
||||
$object = new Mailing($db);
|
||||
|
||||
if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
if ($object->fetch($_REQUEST["id"]) >= 0)
|
||||
{
|
||||
$head = emailing_prepare_head($mil);
|
||||
$head = emailing_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("Mailing"), 0, 'email');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
$mil->user_creation=$mil->user_creat;
|
||||
$mil->date_creation=$mil->date_creat;
|
||||
$mil->user_validation=$mil->user_valid;
|
||||
$mil->date_validation=$mil->date_valid;
|
||||
dol_print_object_info($mil);
|
||||
print '</td></tr></table>';
|
||||
$morehtmlright='';
|
||||
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="underbanner clearboth"></div><br>';
|
||||
|
||||
//print '<table width="100%"><tr><td>';
|
||||
$object->user_creation=$object->user_creat;
|
||||
$object->date_creation=$object->date_creat;
|
||||
$object->user_validation=$object->user_valid;
|
||||
$object->date_validation=$object->date_valid;
|
||||
dol_print_object_info($object, 0);
|
||||
//print '</td></tr></table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -99,7 +99,6 @@ $permissiondellink = $user->rights->commande->creer; // Used by the include of
|
||||
$permissionedit = $user->rights->commande->creer; // Used by the include of actions_lineupdown.inc.php
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -110,8 +109,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($cancel) $action='';
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($action != 'addlink')
|
||||
{
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/commande/list.php',1);
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
if ($id > 0 || ! empty($ref)) $ret = $object->fetch($id,$ref);
|
||||
$action='';
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||
@ -1725,7 +1734,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '">';
|
||||
print ' ';
|
||||
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -371,7 +371,7 @@ class Orders extends DolibarrApi
|
||||
}
|
||||
$request_data = (object) $request_data;
|
||||
$updateRes = $this->commande->deleteline(DolibarrApiAccess::$user,$lineid);
|
||||
if ($updateRes == 1) {
|
||||
if ($updateRes > 0) {
|
||||
return $this->get($id);
|
||||
}
|
||||
return false;
|
||||
|
||||
@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768);
|
||||
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200);
|
||||
|
||||
$id=GETPOST('account')?GETPOST('account','alpha'):GETPOST('id');
|
||||
$ref=GETPOST('ref');
|
||||
|
||||
@ -53,6 +56,12 @@ else
|
||||
$year_end=$year_start+2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans("FinancialAccount").' - '.$langs->trans("IOMonthlyReporting");
|
||||
$helpurl = "";
|
||||
llxHeader('',$title,$helpurl);
|
||||
@ -276,10 +285,6 @@ if ($result < 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Definition de $width et $height
|
||||
$width = 480;
|
||||
$height = 300;
|
||||
|
||||
// Calcul de $min et $max
|
||||
$sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
@ -374,8 +379,8 @@ else
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue()<0?0:$px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue($px1->GetFloorMinValue()>0?0:$px1->GetFloorMinValue());
|
||||
$px1->SetTitle($title);
|
||||
$px1->SetWidth($width);
|
||||
$px1->SetHeight($height);
|
||||
$px1->SetWidth($WIDTH);
|
||||
$px1->SetHeight($HEIGHT);
|
||||
$px1->SetType(array('line','line','line'));
|
||||
$px1->SetShading(3);
|
||||
$px1->setBgColor('onglet');
|
||||
@ -461,8 +466,8 @@ else
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue()<0?0:$px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue($px2->GetFloorMinValue()>0?0:$px2->GetFloorMinValue());
|
||||
$px2->SetTitle($title);
|
||||
$px2->SetWidth($width);
|
||||
$px2->SetHeight($height);
|
||||
$px2->SetWidth($WIDTH);
|
||||
$px2->SetHeight($HEIGHT);
|
||||
$px2->SetType(array('line','line','line'));
|
||||
$px2->SetShading(3);
|
||||
$px2->setBgColor('onglet');
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
@ -840,11 +840,11 @@ else
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
print '<td><input size="30" type="text" class="flat" name="label" value="'.(isset($_POST["label"])?$_POST["label"]:$object->label).'"></td></tr>';
|
||||
print '<td><input type="text" class="flat minwidth300" name="label" value="'.(isset($_POST["label"])?$_POST["label"]:$object->label).'"></td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td>';
|
||||
print '<td class="maxwidth200onsmartphone">';
|
||||
$formbank->selectTypeOfBankAccount((isset($_POST["type"])?$_POST["type"]:$object->type),"type");
|
||||
print '</td></tr>';
|
||||
|
||||
@ -852,7 +852,7 @@ else
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Currency");
|
||||
print '<input type="hidden" value="'.$object->currency_code.'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="maxwidth200onsmartphone">';
|
||||
$selectedcode=$object->currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->currency;
|
||||
print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
|
||||
@ -862,8 +862,8 @@ else
|
||||
|
||||
// Status
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
|
||||
print '<td>';
|
||||
print $form->selectarray("clos", $object->status,(isset($_POST["clos"])?$_POST["clos"]:$object->clos));
|
||||
print '<td class="maxwidth200onsmartphone">';
|
||||
print $form->selectarray("clos", $object->status, (isset($_POST["clos"])?$_POST["clos"]:$object->clos));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
@ -874,13 +874,13 @@ else
|
||||
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Country").'</td>';
|
||||
print '<td>';
|
||||
print '<td class="maxwidth200onsmartphone">';
|
||||
print $form->select_country($selectedcode,'account_country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td class="maxwidth200onsmartphone">';
|
||||
if ($selectedcode)
|
||||
{
|
||||
print $formcompany->select_state(isset($_POST["account_state_id"])?$_POST["account_state_id"]:$object->state_id,$selectedcode,'account_state_id');
|
||||
@ -909,7 +909,7 @@ else
|
||||
|
||||
// Web
|
||||
print '<tr><td>'.$langs->trans("Web").'</td>';
|
||||
print '<td><input size="50" type="text" class="flat" name="url" value="'.(isset($_POST["url"])?$_POST["url"]:$object->url).'">';
|
||||
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(isset($_POST["url"])?$_POST["url"]:$object->url).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Tags-Categories
|
||||
@ -931,7 +931,7 @@ else
|
||||
print '<td>';
|
||||
// Editor wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,70);
|
||||
$doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,'95%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1020,22 +1020,22 @@ else
|
||||
|
||||
// IBAN
|
||||
print '<tr><td>'.$langs->trans($ibankey).'</td>';
|
||||
print '<td><input size="34" maxlength="34" type="text" class="flat" name="iban" value="'.$object->iban.'"></td></tr>';
|
||||
print '<td><input class="minwidth300 maxwidth200onsmartphone" maxlength="34" type="text" class="flat" name="iban" value="'.$object->iban.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans($bickey).'</td>';
|
||||
print '<td><input size="11" maxlength="11" type="text" class="flat" name="bic" value="'.$object->bic.'"></td></tr>';
|
||||
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.$object->bic.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td>';
|
||||
print "<textarea class=\"flat\" name=\"domiciliation\" rows=\"2\" cols=\"40\">";
|
||||
print '<textarea class="flat quatrevingtpercent" name="domiciliation" rows="'.ROWS_2.'">';
|
||||
print $object->domiciliation;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';
|
||||
print '<td><input size="30" type="text" class="flat" name="proprio" value="'.$object->proprio.'"></td>';
|
||||
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="proprio" value="'.$object->proprio.'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td>';
|
||||
print "<textarea class=\"flat\" name=\"owner_address\" rows=\"2\" cols=\"40\">";
|
||||
print '<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.'">';
|
||||
print $object->owner_address;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
|
||||
@ -236,7 +236,7 @@ class Account extends CommonObject
|
||||
|
||||
$this->status = array(
|
||||
self::STATUS_OPEN => $langs->trans("StatusAccountOpened"),
|
||||
self::STATUS_CLOSED => $langs->trans("StatusAccountOpened")
|
||||
self::STATUS_CLOSED => $langs->trans("StatusAccountClosed")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -134,7 +134,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
||||
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||
$sql.= " pct.code as payment_code,";
|
||||
$sql.= " ba.rowid as bid, ba.label as blabel";
|
||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||
@ -205,6 +205,10 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
{
|
||||
//$accountstatic->fetch($obj->fk_bank);
|
||||
$accountstatic->id=$obj->bid;
|
||||
$accountstatic->ref=$obj->bref;
|
||||
$accountstatic->number=$obj->bnumber;
|
||||
$accountstatic->accountancy_number=$obj->account_number;
|
||||
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||
$accountstatic->label=$obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
@ -249,8 +253,13 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
|
||||
print load_fiche_titre($langs->trans("VATPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
|
||||
|
||||
$sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm";
|
||||
$sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.fk_bank,";
|
||||
$sql.= " pct.code as payment_code,";
|
||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as pv";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pv.fk_typepayment = pct.id";
|
||||
$sql.= " WHERE pv.entity = ".$conf->entity;
|
||||
if ($year > 0)
|
||||
{
|
||||
@ -273,6 +282,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
$var=1;
|
||||
@ -295,15 +306,45 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
$tva_static->ref=$obj->rowid;
|
||||
print '<td align="left">'.$tva_static->getNomUrl(1)."</td>\n";
|
||||
|
||||
// Date
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
|
||||
print '<td align="right">'.price($obj->amount)."</td>";
|
||||
|
||||
// Type payment
|
||||
print '<td>';
|
||||
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||
print $obj->num_payment.'</td>';
|
||||
|
||||
// Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->fk_bank > 0)
|
||||
{
|
||||
//$accountstatic->fetch($obj->fk_bank);
|
||||
$accountstatic->id=$obj->bid;
|
||||
$accountstatic->ref=$obj->bref;
|
||||
$accountstatic->number=$obj->bnumber;
|
||||
$accountstatic->accountancy_number=$obj->account_number;
|
||||
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||
$accountstatic->label=$obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Paid
|
||||
print '<td align="right">'.price($obj->amount)."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($total).'</td>';
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="right">'.price($total)."</td>";
|
||||
print "</tr>";
|
||||
|
||||
@ -426,8 +467,14 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
|
||||
print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
|
||||
|
||||
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
|
||||
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,";
|
||||
$sql.= " pct.code as payment_code,";
|
||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON s.fk_typepayment = pct.id";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE s.entity IN (".getEntity('user',1).")";
|
||||
$sql.= " AND u.rowid = s.fk_user";
|
||||
if ($year > 0)
|
||||
@ -449,6 +496,8 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
$var=1;
|
||||
@ -470,13 +519,40 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
$sal_static->ref=$obj->rowid;
|
||||
print '<td align="left">'.$sal_static->getNomUrl(1)."</td>\n";
|
||||
|
||||
// Date
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
|
||||
|
||||
// Type payment
|
||||
print '<td>';
|
||||
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||
print $obj->num_payment.'</td>';
|
||||
|
||||
// Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->fk_bank > 0)
|
||||
{
|
||||
//$accountstatic->fetch($obj->fk_bank);
|
||||
$accountstatic->id=$obj->bid;
|
||||
$accountstatic->ref=$obj->bref;
|
||||
$accountstatic->number=$obj->bnumber;
|
||||
$accountstatic->accountancy_number=$obj->account_number;
|
||||
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||
$accountstatic->label=$obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Paid
|
||||
print '<td align="right">'.price($obj->amount)."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
print '<tr class="liste_total"><td colspan="4">'.$langs->trans("Total").'</td>';
|
||||
print '<tr class="liste_total"><td colspan="6">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($total)."</td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
@ -4208,7 +4208,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,';
|
||||
$sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,';
|
||||
$sql.= ' fd.fk_code_ventilation,';
|
||||
$sql.= ' fd.fk_unit,';
|
||||
$sql.= ' fd.fk_unit, fk_user_author, fk_user_modif,';
|
||||
$sql.= ' fd.situation_percent, fd.fk_prev_id,';
|
||||
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc';
|
||||
$sql.= ' , fd.multicurrency_subprice';
|
||||
@ -4261,7 +4261,9 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$this->product_label = $objp->product_libelle;
|
||||
$this->product_desc = $objp->product_desc;
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
|
||||
$this->fk_user_modif = $objp->fk_user_modif;
|
||||
$this->fk_user_author = $objp->fk_user_author;
|
||||
|
||||
$this->situation_percent = $objp->situation_percent;
|
||||
$this->fk_prev_id = $objp->fk_prev_id;
|
||||
|
||||
@ -4361,8 +4363,8 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,';
|
||||
$sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2,';
|
||||
$sql.= ' situation_percent, fk_prev_id,';
|
||||
$sql.= ' fk_unit';
|
||||
$sql.= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc';
|
||||
$sql.= ' fk_unit, fk_user_author, fk_user_modif,';
|
||||
$sql.= ' fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc';
|
||||
$sql.= ')';
|
||||
$sql.= " VALUES (".$this->fk_facture.",";
|
||||
$sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").",";
|
||||
@ -4393,9 +4395,11 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$sql.= " ".price2num($this->total_ttc).",";
|
||||
$sql.= " ".price2num($this->total_localtax1).",";
|
||||
$sql.= " ".price2num($this->total_localtax2);
|
||||
$sql .= ", " . $this->situation_percent;
|
||||
$sql .= ", " . $this->fk_prev_id;
|
||||
$sql .= ", ".(!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||
$sql.= ", " . $this->situation_percent;
|
||||
$sql.= ", " . $this->fk_prev_id;
|
||||
$sql.= ", ".(!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||
$sql.= ", ".$user->id;
|
||||
$sql.= ", ".$user->id;
|
||||
$sql.= ", ".(int) $this->fk_multicurrency;
|
||||
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
|
||||
$sql.= ", ".price2num($this->multicurrency_subprice);
|
||||
@ -4581,6 +4585,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if (! empty($this->rang)) $sql.= ", rang=".$this->rang;
|
||||
$sql.= ", situation_percent=" . $this->situation_percent;
|
||||
$sql.= ", fk_unit=".(!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||
$sql.= ", fk_user_modif =".$user->id;
|
||||
|
||||
// Multicurrency
|
||||
$sql.= ", multicurrency_subprice=".price2num($this->multicurrency_subprice)."";
|
||||
|
||||
@ -40,6 +40,7 @@ if (! empty($conf->projet->enabled)) {
|
||||
|
||||
$langs->load('bills');
|
||||
$langs->load('compta');
|
||||
$langs->load('admin');
|
||||
|
||||
// Security check
|
||||
$id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'));
|
||||
|
||||
@ -47,8 +47,17 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td align="center"><?php echo dol_print_date($objectlink->date,'day'); ?></td>
|
||||
<td align="right"><?php
|
||||
if ($user->rights->facture->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
$sign = 1;
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
|
||||
if ($objectlink->statut != 3) // If not abandonned
|
||||
{
|
||||
$total = $total + $sign * $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
} ?></td>
|
||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
|
||||
|
||||
@ -24,16 +24,21 @@
|
||||
<?php
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
$langs = $GLOBALS['langs'];
|
||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$var=true;
|
||||
$total=0;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$var=!$var;
|
||||
$ilink++;
|
||||
$var=!$var;
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr <?php echo $GLOBALS['bc'][$var]; ?> >
|
||||
<td><?php echo $langs->trans("RepeatableInvoice"); ?></td>
|
||||
|
||||
@ -117,7 +117,7 @@ if (count($listofsearchfields))
|
||||
{
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="14"></td>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@ -534,7 +534,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
print '<td colspan="3" align="right">'.price(-$subtotal_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($mysoc->tva_assuj == 'franchise') // Non assujeti
|
||||
if ($mysoc->tva_assuj == 'franchise') // Non assujetti
|
||||
{
|
||||
// Total
|
||||
print '<tr>';
|
||||
@ -572,7 +572,7 @@ if (! empty($conf->salaries->enabled))
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
|
||||
|
||||
$sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
|
||||
$sql.= " ORDER BY u.firstname";
|
||||
|
||||
@ -599,7 +599,7 @@ if (! empty($conf->salaries->enabled))
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var]."><td> </td>";
|
||||
|
||||
print "<td>".$langs->trans("Salaries")." <a href=\"".DOL_URL_ROOT."/compta/salaries/index.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
print "<td>".$langs->trans("Salary")." <a href=\"".DOL_URL_ROOT."/compta/salaries/index.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount).'</td>';
|
||||
print '<td align="right">'.price(-$obj->amount).'</td>';
|
||||
@ -639,9 +639,8 @@ if (! empty($conf->expensereport->enabled))
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author";
|
||||
$sql.= " WHERE p.entity = ".getEntity('expensereport',1);
|
||||
$sql.= " AND p.fk_statut>=5";
|
||||
|
||||
|
||||
$column='p.date_valid';
|
||||
|
||||
} else {
|
||||
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p";
|
||||
@ -650,12 +649,12 @@ if (! empty($conf->expensereport->enabled))
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id";
|
||||
$sql.= " WHERE p.entity = ".getEntity('expensereport',1);
|
||||
$sql.= " AND p.fk_statut>=5";
|
||||
|
||||
|
||||
$column='pe.datep';
|
||||
}
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("ExpenseReport").'</td></tr>';
|
||||
|
||||
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
|
||||
@ -709,12 +708,12 @@ if (! empty($conf->expensereport->enabled))
|
||||
}
|
||||
|
||||
/*
|
||||
* Donation
|
||||
* Donations
|
||||
*/
|
||||
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
print '<tr><td colspan="4">'.$langs->trans("Donation").'</td></tr>';
|
||||
print '<tr><td colspan="4">'.$langs->trans("Donations").'</td></tr>';
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
@ -975,7 +974,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
if ($mysoc->tva_assuj != 'franchise') // Assujeti
|
||||
if ($mysoc->tva_assuj != 'franchise') // Assujetti
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
@ -995,7 +994,7 @@ $hookmanager->initHooks(array('externalbalance'));
|
||||
$reshook=$hookmanager->executeHooks('addBalanceLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
if ($mysoc->tva_assuj != 'franchise') // Assujeti
|
||||
if ($mysoc->tva_assuj != 'franchise') // Assujetti
|
||||
{
|
||||
// Total
|
||||
print '<tr>';
|
||||
|
||||
@ -93,7 +93,7 @@ $accountstatic = new Account($db);
|
||||
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,";
|
||||
$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
|
||||
$sql.= " ba.rowid as bid, ba.label as blabel,";
|
||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel,";
|
||||
$sql.= " pst.code as payment_code";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id";
|
||||
@ -230,8 +230,12 @@ if ($result)
|
||||
{
|
||||
//$accountstatic->fetch($obj->fk_bank);
|
||||
$accountstatic->id=$obj->bid;
|
||||
$accountstatic->ref=$obj->bref;
|
||||
$accountstatic->number=$obj->bnumber;
|
||||
$accountstatic->accountancy_number=$obj->account_number;
|
||||
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||
$accountstatic->label=$obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/tva/index.php
|
||||
* \ingroup tax
|
||||
* \file htdocs/compta/tva/index.php
|
||||
* \ingroup tax
|
||||
* \brief Index page of VAT reports
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* 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
|
||||
@ -36,11 +37,14 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php';
|
||||
|
||||
$langs->load("bills");
|
||||
$langs->load("compta");
|
||||
$langs->load("companies");
|
||||
$langs->load("products");
|
||||
$langs->load("trips");
|
||||
$langs->load("other");
|
||||
|
||||
// Date range
|
||||
@ -111,9 +115,11 @@ $form=new Form($db);
|
||||
$company_static=new Societe($db);
|
||||
$invoice_customer=new Facture($db);
|
||||
$invoice_supplier=new FactureFournisseur($db);
|
||||
$expensereport=new ExpenseReport($db);
|
||||
$product_static=new Product($db);
|
||||
$payment_static=new Paiement($db);
|
||||
$paymentfourn_static=new PaiementFourn($db);
|
||||
$paymentexpensereport_static=new PaymentExpenseReport($db);
|
||||
|
||||
//print load_fiche_titre($langs->trans("VAT"),"");
|
||||
|
||||
@ -149,16 +155,20 @@ if ($modetax==1) // Calculate on invoice for goods and services
|
||||
$builddate=time();
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
|
||||
// Customers invoices
|
||||
$elementcust=$langs->trans("CustomersInvoices");
|
||||
$productcust=$langs->trans("ProductOrService");
|
||||
$amountcust=$langs->trans("AmountHT");
|
||||
$vatcust=$langs->trans("VATReceived");
|
||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
||||
|
||||
// Suppliers invoices
|
||||
$elementsup=$langs->trans("SuppliersInvoices");
|
||||
$productsup=$langs->trans("ProductOrService");
|
||||
$amountsup=$langs->trans("AmountHT");
|
||||
$vatsup=$langs->trans("VATPaid");
|
||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||
|
||||
}
|
||||
if ($modetax==0) // Invoice for goods, payment for services
|
||||
{
|
||||
@ -185,26 +195,29 @@ if ($modetax==0) // Invoice for goods, payment for services
|
||||
$builddate=time();
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
|
||||
// Customers invoices
|
||||
$elementcust=$langs->trans("CustomersInvoices");
|
||||
$productcust=$langs->trans("ProductOrService");
|
||||
$amountcust=$langs->trans("AmountHT");
|
||||
$vatcust=$langs->trans("VATReceived");
|
||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
||||
|
||||
// Suppliers invoices
|
||||
$elementsup=$langs->trans("SuppliersInvoices");
|
||||
$productsup=$langs->trans("ProductOrService");
|
||||
$amountsup=$langs->trans("AmountHT");
|
||||
$vatsup=$langs->trans("VATPaid");
|
||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||
|
||||
}
|
||||
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode);
|
||||
|
||||
$vatcust=$langs->trans("VATReceived");
|
||||
$vatsup=$langs->trans("VATPaid");
|
||||
|
||||
$vatexpensereport=$langs->trans("VATPaid");
|
||||
|
||||
// VAT Received and paid
|
||||
|
||||
echo '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
$y = $year_current;
|
||||
$total = 0;
|
||||
@ -242,21 +255,21 @@ else
|
||||
$invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id];
|
||||
$invoice_customer->type=$x_coll[$my_coll_rate]['type'][$id];
|
||||
$x_both[$my_coll_rate]['coll']['detail'][] = array(
|
||||
'id' =>$x_coll[$my_coll_rate]['facid'][$id],
|
||||
'descr' =>$x_coll[$my_coll_rate]['descr'][$id],
|
||||
'pid' =>$x_coll[$my_coll_rate]['pid'][$id],
|
||||
'pref' =>$x_coll[$my_coll_rate]['pref'][$id],
|
||||
'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id],
|
||||
'payment_id'=>$x_coll[$my_coll_rate]['payment_id'][$id],
|
||||
'payment_amount'=>$x_coll[$my_coll_rate]['payment_amount'][$id],
|
||||
'ftotal_ttc'=>$x_coll[$my_coll_rate]['ftotal_ttc'][$id],
|
||||
'dtotal_ttc'=>$x_coll[$my_coll_rate]['dtotal_ttc'][$id],
|
||||
'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id],
|
||||
'ddate_start'=>$x_coll[$my_coll_rate]['ddate_start'][$id],
|
||||
'ddate_end' =>$x_coll[$my_coll_rate]['ddate_end'][$id],
|
||||
'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id],
|
||||
'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id],
|
||||
'link' =>$invoice_customer->getNomUrl(1,'',12));
|
||||
'id' =>$x_coll[$my_coll_rate]['facid'][$id],
|
||||
'descr' =>$x_coll[$my_coll_rate]['descr'][$id],
|
||||
'pid' =>$x_coll[$my_coll_rate]['pid'][$id],
|
||||
'pref' =>$x_coll[$my_coll_rate]['pref'][$id],
|
||||
'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id],
|
||||
'payment_id' =>$x_coll[$my_coll_rate]['payment_id'][$id],
|
||||
'payment_amount' =>$x_coll[$my_coll_rate]['payment_amount'][$id],
|
||||
'ftotal_ttc' =>$x_coll[$my_coll_rate]['ftotal_ttc'][$id],
|
||||
'dtotal_ttc' =>$x_coll[$my_coll_rate]['dtotal_ttc'][$id],
|
||||
'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id],
|
||||
'ddate_start' =>$x_coll[$my_coll_rate]['ddate_start'][$id],
|
||||
'ddate_end' =>$x_coll[$my_coll_rate]['ddate_end'][$id],
|
||||
'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id],
|
||||
'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id],
|
||||
'link' =>$invoice_customer->getNomUrl(1,'',12));
|
||||
}
|
||||
}
|
||||
// tva paid
|
||||
@ -272,25 +285,54 @@ else
|
||||
|
||||
foreach($x_paye[$my_paye_rate]['facid'] as $id=>$dummy)
|
||||
{
|
||||
$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id];
|
||||
$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id];
|
||||
$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id];
|
||||
$x_both[$my_paye_rate]['paye']['detail'][] = array(
|
||||
'id' =>$x_paye[$my_paye_rate]['facid'][$id],
|
||||
'descr' =>$x_paye[$my_paye_rate]['descr'][$id],
|
||||
'pid' =>$x_paye[$my_paye_rate]['pid'][$id],
|
||||
'pref' =>$x_paye[$my_paye_rate]['pref'][$id],
|
||||
'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id],
|
||||
'payment_id'=>$x_paye[$my_paye_rate]['payment_id'][$id],
|
||||
'payment_amount'=>$x_paye[$my_paye_rate]['payment_amount'][$id],
|
||||
'ftotal_ttc'=>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]),
|
||||
'dtotal_ttc'=>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]),
|
||||
'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id],
|
||||
'ddate_start'=>$x_paye[$my_paye_rate]['ddate_start'][$id],
|
||||
'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id],
|
||||
'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
|
||||
'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id],
|
||||
'link' =>$invoice_supplier->getNomUrl(1,'',12));
|
||||
// ExpenseReport
|
||||
if ($x_paye[$my_paye_rate]['ptype'][$id] == 'ExpenseReportPayment')
|
||||
{
|
||||
$expensereport->id=$x_paye[$my_paye_rate]['facid'][$id];
|
||||
$expensereport->ref=$x_paye[$my_paye_rate]['facnum'][$id];
|
||||
$expensereport->type=$x_paye[$my_paye_rate]['type'][$id];
|
||||
|
||||
$x_both[$my_paye_rate]['paye']['detail'][] = array(
|
||||
'id' =>$x_paye[$my_paye_rate]['facid'][$id],
|
||||
'descr' =>$x_paye[$my_paye_rate]['descr'][$id],
|
||||
'pid' =>$x_paye[$my_paye_rate]['pid'][$id],
|
||||
'pref' =>$x_paye[$my_paye_rate]['pref'][$id],
|
||||
'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id],
|
||||
'payment_id' =>$x_paye[$my_paye_rate]['payment_id'][$id],
|
||||
'payment_amount' =>$x_paye[$my_paye_rate]['payment_amount'][$id],
|
||||
'ftotal_ttc' =>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]),
|
||||
'dtotal_ttc' =>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]),
|
||||
'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id],
|
||||
'ddate_start' =>$x_paye[$my_paye_rate]['ddate_start'][$id],
|
||||
'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id],
|
||||
'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
|
||||
'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id],
|
||||
'link' =>$expensereport->getNomUrl(1)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id];
|
||||
$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id];
|
||||
$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id];
|
||||
$x_both[$my_paye_rate]['paye']['detail'][] = array(
|
||||
'id' =>$x_paye[$my_paye_rate]['facid'][$id],
|
||||
'descr' =>$x_paye[$my_paye_rate]['descr'][$id],
|
||||
'pid' =>$x_paye[$my_paye_rate]['pid'][$id],
|
||||
'pref' =>$x_paye[$my_paye_rate]['pref'][$id],
|
||||
'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id],
|
||||
'payment_id' =>$x_paye[$my_paye_rate]['payment_id'][$id],
|
||||
'payment_amount' =>$x_paye[$my_paye_rate]['payment_amount'][$id],
|
||||
'ftotal_ttc' =>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]),
|
||||
'dtotal_ttc' =>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]),
|
||||
'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id],
|
||||
'ddate_start' =>$x_paye[$my_paye_rate]['ddate_start'][$id],
|
||||
'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id],
|
||||
'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
|
||||
'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id],
|
||||
'link' =>$invoice_supplier->getNomUrl(1,'',12)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
//now we have an array (x_both) indexed by rates for coll and paye
|
||||
@ -320,18 +362,18 @@ else
|
||||
print '<td align="right">'.$langs->trans("AmountHTVATRealReceived").'</td>';
|
||||
print '<td align="right">'.$vatcust.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$action = "tvadetail";
|
||||
$parameters["mode"] = $modetax;
|
||||
$parameters["start"] = $date_start;
|
||||
$parameters["end"] = $date_end;
|
||||
$parameters["type"] = 'vat';
|
||||
|
||||
|
||||
$object = array(&$x_coll, &$x_paye, &$x_both);
|
||||
// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('externalbalance'));
|
||||
$reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
|
||||
foreach(array_keys($x_coll) as $rate)
|
||||
{
|
||||
$subtot_coll_total_ht = 0;
|
||||
@ -374,12 +416,12 @@ else
|
||||
{
|
||||
if ($type) $text = img_object($langs->trans('Service'),'service');
|
||||
else $text = img_object($langs->trans('Product'),'product');
|
||||
if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg))
|
||||
{
|
||||
if ($reg[1]=='DEPOSIT') $fields['descr']=$langs->transnoentitiesnoconv('Deposit');
|
||||
elseif ($reg[1]=='CREDIT_NOTE') $fields['descr']=$langs->transnoentitiesnoconv('CreditNote');
|
||||
else $fields['descr']=$langs->transnoentitiesnoconv($reg[1]);
|
||||
}
|
||||
if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg))
|
||||
{
|
||||
if ($reg[1]=='DEPOSIT') $fields['descr']=$langs->transnoentitiesnoconv('Deposit');
|
||||
elseif ($reg[1]=='CREDIT_NOTE') $fields['descr']=$langs->transnoentitiesnoconv('CreditNote');
|
||||
else $fields['descr']=$langs->transnoentitiesnoconv($reg[1]);
|
||||
}
|
||||
print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16);
|
||||
|
||||
// Show range
|
||||
@ -610,7 +652,7 @@ else
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (count($x_paye) == 0) // Show a total ine if nothing shown
|
||||
if (count($x_paye) == 0) // Show a total line if nothing shown
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
print '<td> </td>';
|
||||
|
||||
@ -89,7 +89,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
llxHeader('', $langs->trans("VATPayments"));
|
||||
|
||||
$form = new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
@ -97,7 +97,7 @@ $tva_static = new Tva($db);
|
||||
$accountstatic = new Account($db);
|
||||
|
||||
$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, t.fk_bank, pst.code as payment_code,";
|
||||
$sql.= " ba.rowid as bid, ba.label as blabel";
|
||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
|
||||
@ -228,6 +228,10 @@ if ($result)
|
||||
{
|
||||
//$accountstatic->fetch($obj->fk_bank);
|
||||
$accountstatic->id=$obj->bid;
|
||||
$accountstatic->ref=$obj->bref;
|
||||
$accountstatic->number=$obj->bnumber;
|
||||
$accountstatic->accountancy_number=$obj->account_number;
|
||||
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||
$accountstatic->label=$obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -572,7 +572,7 @@ if (empty($reshook))
|
||||
if ($result > 0)
|
||||
{
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && ! empty($conf->global->CONTRACT_ADDON_PDF)) // No generation if default type not defined
|
||||
{
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
|
||||
@ -935,7 +935,7 @@ class Contrat extends CommonObject
|
||||
|
||||
|
||||
// Load object modContract
|
||||
$module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_olive');
|
||||
$module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_serpis');
|
||||
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php')
|
||||
{
|
||||
$module = substr($module, 0, dol_strlen($module)-4);
|
||||
|
||||
@ -50,6 +50,7 @@ $search_contract=GETPOST("search_contract");
|
||||
$search_service=GETPOST("search_service");
|
||||
$search_status=GETPOST("search_status","alpha");
|
||||
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
||||
$search_product_category=GETPOST('search_product_category','int');
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
$opouvertureprevuemonth=GETPOST('opouvertureprevuemonth');
|
||||
@ -99,6 +100,9 @@ $staticcontrat=new Contrat($db);
|
||||
$staticcontratligne=new ContratLigne($db);
|
||||
$companystatic=new Societe($db);
|
||||
|
||||
$arrayfields=array();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -153,8 +157,10 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||
if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product';
|
||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||
$sql.= " AND c.rowid = cd.fk_contrat";
|
||||
if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category;
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($mode == "0") $sql.= " AND cd.statut = 0";
|
||||
@ -206,17 +212,67 @@ if ($resql)
|
||||
if ($filter_date2 != '') $param.='&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year;
|
||||
if ($filter_datecloture != '') $param.='&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year;
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
//if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
//if ($massaction == 'presend') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" action="'. $_SERVER["PHP_SELF"] .'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
$title=$langs->trans("ListOfServices");
|
||||
if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use == "0"
|
||||
if ($mode == "4" && $filter != "expired") $title=$langs->trans("ListOfRunningServices");
|
||||
if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices");
|
||||
if ($mode == "5") $title=$langs->trans("ListOfClosedServices");
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png');
|
||||
|
||||
print '<form method="POST" action="'. $_SERVER["PHP_SELF"] .'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="liste" width="100%">';
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit);
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||
}
|
||||
|
||||
$morefilter = '';
|
||||
|
||||
// If the user can view categories of products
|
||||
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||
else $moreforfilter = $hookmanager->resPrint;
|
||||
|
||||
|
||||
if (! empty($moreforfilter))
|
||||
{
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Contract"),$_SERVER["PHP_SELF"], "c.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Service"),$_SERVER["PHP_SELF"], "p.description",$param,"","",$sortfield,$sortorder);
|
||||
@ -308,11 +364,16 @@ if ($resql)
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>';
|
||||
|
||||
$contractstatic->id=$obj->cid;
|
||||
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
// Ref
|
||||
print '<td>';
|
||||
print $contractstatic->getNomUrl(1,16);
|
||||
print '</td>';
|
||||
|
||||
@ -348,7 +409,7 @@ if ($resql)
|
||||
{
|
||||
print '<td align="center">';
|
||||
print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' ');
|
||||
if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)))
|
||||
if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)) && $obj->statut == 0)
|
||||
print ' '.img_picto($langs->trans("Late"),"warning");
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
@ -357,7 +418,7 @@ if ($resql)
|
||||
{
|
||||
print '<td align="center">'.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').'</td>';
|
||||
}
|
||||
// Date fin
|
||||
// End date
|
||||
if (($mode == "" || $mode == -1) || $mode < 5)
|
||||
{
|
||||
print '<td align="center">'.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' ');
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -22,19 +21,23 @@
|
||||
<?php
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
$langs = $GLOBALS['langs'];
|
||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
|
||||
$langs->load("contracts");
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$objectlink->fetch_lines();
|
||||
$var=!$var;
|
||||
$ilink++;
|
||||
$var=!$var;
|
||||
$trclass=($var?'pair':'impair');
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr <?php echo $bc[$var]; ?> >
|
||||
<tr class="<?php echo $trclass; ?>">
|
||||
<td><?php echo $langs->trans("Contract"); ?></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td></td>
|
||||
|
||||
@ -527,7 +527,7 @@ class CMailFile
|
||||
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
|
||||
|
||||
if (! empty($bounce)) $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers, $bounce);
|
||||
else $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers);
|
||||
else $res = mail($dest, $this->encodetorfc2822($this->subject), $this->message, $this->headers);
|
||||
|
||||
if (! $res)
|
||||
{
|
||||
@ -840,7 +840,7 @@ class CMailFile
|
||||
|
||||
// Receiver
|
||||
if (isset($this->addr_cc) && $this->addr_cc) $out.= "Cc: ".$this->getValidAddress($this->addr_cc,2).$this->eol2;
|
||||
if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2;
|
||||
if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ?
|
||||
|
||||
// Delivery receipt
|
||||
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out.= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol2;
|
||||
|
||||
@ -337,17 +337,17 @@ abstract class CommonInvoice extends CommonObject
|
||||
$prefix='Short';
|
||||
if (! $paye)
|
||||
{
|
||||
if ($status == 0) return '<span class="hideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusDraft').' </span>'.img_picto($langs->trans('BillStatusDraft'),'statut0');
|
||||
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return '<span class="hideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusCanceled').' </span>'.img_picto($langs->trans('BillStatusCanceled'),'statut5');
|
||||
if (($status == 3 || $status == 2) && $alreadypaid > 0) return '<span class="hideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' </span>'.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7');
|
||||
if ($alreadypaid <= 0) return '<span class="hideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotPaid').' </span>'.img_picto($langs->trans('BillStatusNotPaid'),'statut1');
|
||||
return '<span class="hideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusStarted').' </span>'.img_picto($langs->trans('BillStatusStarted'),'statut3');
|
||||
if ($status == 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusDraft').' </span>'.img_picto($langs->trans('BillStatusDraft'),'statut0');
|
||||
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusCanceled').' </span>'.img_picto($langs->trans('BillStatusCanceled'),'statut5');
|
||||
if (($status == 3 || $status == 2) && $alreadypaid > 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' </span>'.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7');
|
||||
if ($alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotPaid').' </span>'.img_picto($langs->trans('BillStatusNotPaid'),'statut1');
|
||||
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusStarted').' </span>'.img_picto($langs->trans('BillStatusStarted'),'statut3');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($type == 2) return '<span class="hideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' </span>'.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6');
|
||||
elseif ($type == 3) return '<span class="hideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusConverted').' </span>'.img_picto($langs->trans('BillStatusConverted'),'statut6');
|
||||
else return '<span class="hideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusPaid').' </span>'.img_picto($langs->trans('BillStatusPaid'),'statut6');
|
||||
if ($type == 2) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' </span>'.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6');
|
||||
elseif ($type == 3) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusConverted').' </span>'.img_picto($langs->trans('BillStatusConverted'),'statut6');
|
||||
else return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusPaid').' </span>'.img_picto($langs->trans('BillStatusPaid'),'statut6');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ class DolEditor
|
||||
// Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart.
|
||||
// Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ?
|
||||
$modulepart='fckeditor';
|
||||
$this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&file=';
|
||||
$this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file=';
|
||||
$this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ;
|
||||
|
||||
$this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false');
|
||||
|
||||
@ -165,6 +165,7 @@ class HookManager
|
||||
'paymentsupplierinvoices',
|
||||
'printAddress',
|
||||
'printSearchForm',
|
||||
'printTabsHead',
|
||||
'formatEvent',
|
||||
'addCalendarChoice',
|
||||
'printObjectLine',
|
||||
|
||||
@ -181,7 +181,14 @@ class Form
|
||||
else if (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata))
|
||||
{
|
||||
$tmp=explode(':',$typeofdata);
|
||||
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1]?$tmp[1]:'20').'" cols="'.($tmp[2]?$tmp[2]:'100').'">'.($editvalue?$editvalue:$value).'</textarea>';
|
||||
$cols=$tmp[2];
|
||||
$morealt='';
|
||||
if (preg_match('/%/',$cols))
|
||||
{
|
||||
$morealt=' style="width: '.$cols.'"';
|
||||
$cols='';
|
||||
}
|
||||
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1]?$tmp[1]:'20').'"'.($cols?' cols="'.$cols.'"':'').$morealt.'">'.($editvalue?$editvalue:$value).'</textarea>';
|
||||
}
|
||||
else if ($typeofdata == 'day' || $typeofdata == 'datepicker')
|
||||
{
|
||||
@ -211,9 +218,10 @@ class Form
|
||||
if (empty($notabletag)) $ret.='</td>';
|
||||
|
||||
if (empty($notabletag)) $ret.='<td align="left">';
|
||||
$ret.='<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">';
|
||||
if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='<br>'."\n";
|
||||
$ret.='<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
else $ret.='<div class="clearboth"></div>';
|
||||
$ret.='<input type="submit" class="button'.(empty($notabletag)?'':' marginrightonly').'" name="modify" value="'.$langs->trans("Modify").'">';
|
||||
if (preg_match('/ckeditor|textarea/',$typeofdata) && empty($notabletag)) $ret.='<br>'."\n";
|
||||
$ret.='<input type="submit" class="button'.(empty($notabletag)?'':' marginrightonly').'" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
if (empty($notabletag)) $ret.='</td>';
|
||||
|
||||
if (empty($notabletag)) $ret.='</tr></table>'."\n";
|
||||
@ -734,7 +742,7 @@ class Form
|
||||
}
|
||||
$out.= '</select>';
|
||||
|
||||
$out .= '<input id="location_incoterms" name="location_incoterms" size="14" value="'.$location_incoterms.'">';
|
||||
$out .= '<input id="location_incoterms" class="maxwidth100onsmartphone" name="location_incoterms" value="'.$location_incoterms.'">';
|
||||
|
||||
if (!empty($page))
|
||||
{
|
||||
@ -3334,7 +3342,7 @@ class Form
|
||||
}
|
||||
|
||||
// Now add questions
|
||||
$more.='<table class="paddingrightonly" width="100%">'."\n";
|
||||
$more.='<table class="paddingtopbottomonly" width="100%">'."\n";
|
||||
$more.='<tr><td colspan="3">'.(! empty($formquestion['text'])?$formquestion['text']:'').'</td></tr>'."\n";
|
||||
foreach ($formquestion as $key => $input)
|
||||
{
|
||||
@ -4485,7 +4493,7 @@ class Form
|
||||
if ($usecalendar == "eldy")
|
||||
{
|
||||
// Zone de saisie manuelle de la date
|
||||
$retstring.='<input id="'.$prefix.'" name="'.$prefix.'" type="text" size="9" maxlength="11" value="'.$formated_date.'"';
|
||||
$retstring.='<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidth75" maxlength="11" value="'.$formated_date.'"';
|
||||
$retstring.=($disabled?' disabled':'');
|
||||
$retstring.=' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
|
||||
$retstring.='>';
|
||||
@ -4513,7 +4521,7 @@ class Form
|
||||
{
|
||||
//$retstring.='<div class="inline-block">';
|
||||
// Day
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" id="'.$prefix.'day" name="'.$prefix.'day">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
|
||||
|
||||
if ($emptydate || $set_time == -1)
|
||||
{
|
||||
@ -4527,7 +4535,7 @@ class Form
|
||||
|
||||
$retstring.="</select>";
|
||||
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" id="'.$prefix.'month" name="'.$prefix.'month">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50onsmartphone" id="'.$prefix.'month" name="'.$prefix.'month">';
|
||||
if ($emptydate || $set_time == -1)
|
||||
{
|
||||
$retstring.='<option value="0" selected> </option>';
|
||||
@ -4545,11 +4553,11 @@ class Form
|
||||
// Year
|
||||
if ($emptydate || $set_time == -1)
|
||||
{
|
||||
$retstring.='<input'.($disabled?' disabled':'').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat" type="text" size="3" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">';
|
||||
$retstring.='<input'.($disabled?' disabled':'').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp" type="text" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" id="'.$prefix.'year" name="'.$prefix.'year">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth75" id="'.$prefix.'year" name="'.$prefix.'year">';
|
||||
|
||||
for ($year = $syear - 5; $year < $syear + 10 ; $year++)
|
||||
{
|
||||
@ -4566,7 +4574,7 @@ class Form
|
||||
if ($h)
|
||||
{
|
||||
// Show hour
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat '.($fullday?$fullday.'hour':'').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'hour':'').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
|
||||
if ($emptyhours) $retstring.='<option value="-1"> </option>';
|
||||
for ($hour = 0; $hour < 24; $hour++)
|
||||
{
|
||||
@ -4580,7 +4588,7 @@ class Form
|
||||
if ($m)
|
||||
{
|
||||
// Show minutes
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat '.($fullday?$fullday.'min':'').'" id="'.$prefix.'min" name="'.$prefix.'min">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'min':'').'" id="'.$prefix.'min" name="'.$prefix.'min">';
|
||||
if ($emptyhours) $retstring.='<option value="-1"> </option>';
|
||||
for ($min = 0; $min < 60 ; $min++)
|
||||
{
|
||||
@ -5570,32 +5578,9 @@ class Form
|
||||
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'>':' ').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'>':' ').'</span>';
|
||||
|
||||
//print "xx".$previous_ref."x".$next_ref;
|
||||
$ret.='<div style="vertical-align: middle">';
|
||||
|
||||
if ($morehtmlleft)
|
||||
{
|
||||
if ($conf->browser->layout == 'phone') $ret.='<div class="center">'.$morehtmlleft.'</div>';
|
||||
else $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
|
||||
}
|
||||
|
||||
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
|
||||
|
||||
// For thirdparty, contact, user, member, the ref is the id, so we show something else
|
||||
if ($object->element == 'societe')
|
||||
{
|
||||
$ret.=dol_htmlentities($object->name);
|
||||
}
|
||||
else if (in_array($object->element, array('contact', 'user', 'member')))
|
||||
{
|
||||
$ret.=dol_htmlentities($object->getFullName($langs));
|
||||
}
|
||||
else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);
|
||||
if ($morehtmlref)
|
||||
{
|
||||
$ret.=' '.$morehtmlref;
|
||||
}
|
||||
$ret.='</div>';
|
||||
$ret.='<!-- Start banner content --><div style="vertical-align: middle">';
|
||||
|
||||
// Right part of banner
|
||||
if ($morehtmlright) $ret.='<div class="inline-block floatleft">'.$morehtmlright.'</div>';
|
||||
|
||||
if ($previous_ref || $next_ref || $morehtml)
|
||||
@ -5616,7 +5601,34 @@ class Form
|
||||
$ret.='</ul></div>';
|
||||
}
|
||||
if ($morehtmlstatus) $ret.='<div class="statusref">'.$morehtmlstatus.'</div>';
|
||||
$ret.='</div>';
|
||||
|
||||
// Left part of banner
|
||||
if ($morehtmlleft)
|
||||
{
|
||||
if ($conf->browser->layout == 'phone') $ret.='<div class="floatleft">'.$morehtmlleft.'</div>'; // class="center" to have photo in middle
|
||||
else $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
|
||||
}
|
||||
|
||||
//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
|
||||
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
|
||||
|
||||
// For thirdparty, contact, user, member, the ref is the id, so we show something else
|
||||
if ($object->element == 'societe')
|
||||
{
|
||||
$ret.=dol_htmlentities($object->name);
|
||||
}
|
||||
else if (in_array($object->element, array('contact', 'user', 'member')))
|
||||
{
|
||||
$ret.=dol_htmlentities($object->getFullName($langs));
|
||||
}
|
||||
else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);
|
||||
if ($morehtmlref)
|
||||
{
|
||||
$ret.=' '.$morehtmlref;
|
||||
}
|
||||
$ret.='</div>';
|
||||
|
||||
$ret.='</div><!-- End banner content -->';
|
||||
|
||||
return $ret;
|
||||
}
|
||||
@ -5790,10 +5802,10 @@ class Form
|
||||
if ($caneditfield)
|
||||
{
|
||||
if ($object->photo) $ret.="<br>\n";
|
||||
$ret.='<table class="nobordernopadding">';
|
||||
if ($object->photo) $ret.='<tr><td align="center"><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
$ret.='<table class="nobordernopadding centpercent">';
|
||||
if ($object->photo) $ret.='<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
$ret.='<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
$ret.='<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
|
||||
$ret.='<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput"></td></tr>';
|
||||
$ret.='</table>';
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ class FormFile
|
||||
* @param int $addcancel 1=Add 'Cancel' button
|
||||
* @param int $sectionid If upload must be done inside a particular ECM section
|
||||
* @param int $perm Value of permission to allow upload
|
||||
* @param int $size Length of input file area
|
||||
* @param int $size Length of input file area. Deprecated.
|
||||
* @param Object $object Object to use (when attachment is done on an element)
|
||||
* @param string $options Add an option column
|
||||
* @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used.
|
||||
@ -106,7 +106,7 @@ class FormFile
|
||||
|
||||
if (! empty($options)) $out .= '<td>'.$options.'</td>';
|
||||
|
||||
$out .= '<td valign="middle" class="nowrap">';
|
||||
$out .= '<td valign="middle">';
|
||||
|
||||
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
|
||||
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
||||
@ -121,10 +121,10 @@ class FormFile
|
||||
{
|
||||
$out .= '<input type="hidden" name="max_file_size" value="'.($max*1024).'">';
|
||||
}
|
||||
$out .= '<input class="flat" type="file" name="userfile" size="'.$maxlength.'"';
|
||||
$out .= '<input class="flat minwidth400" type="file" name="userfile"';
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':'');
|
||||
$out .= '>';
|
||||
$out .= ' ';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':'');
|
||||
$out .= '>';
|
||||
@ -183,11 +183,11 @@ class FormFile
|
||||
$out .= '<div class="valignmiddle" >';
|
||||
$out .= '<div class="inline-block" style="padding-right: 10px;">';
|
||||
if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="link">'.$langs->trans("URLToLink") . ':</label> ';
|
||||
$out .= '<input type="text" name="link" size="'.$maxlength.'" id="link" placeholder="'.dol_escape_htmltag($langs->trans("URLToLink")).'">';
|
||||
$out .= '<input type="text" name="link" class="flat minwidth400imp" id="link" placeholder="'.dol_escape_htmltag($langs->trans("URLToLink")).'">';
|
||||
$out .= '</div>';
|
||||
$out .= '<div class="inline-block" style="padding-right: 10px;">';
|
||||
if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="label">'.$langs->trans("Label") . ':</label> ';
|
||||
$out .= '<input type="text" name="label" id="label" placeholder="'.dol_escape_htmltag($langs->trans("Label")).'">';
|
||||
$out .= '<input type="text" class="flat" name="label" id="label" placeholder="'.dol_escape_htmltag($langs->trans("Label")).'">';
|
||||
$out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">';
|
||||
$out .= '<input type="hidden" name="objectid" value="' . $object->id . '">';
|
||||
$out .= '</div>';
|
||||
@ -1451,6 +1451,7 @@ class FormFile
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
print img_picto('', 'object_globe').' ';
|
||||
print '<a data-ajax="false" href="' . $link->url . '" target="_blank">';
|
||||
print $link->label;
|
||||
print '</a>';
|
||||
|
||||
@ -59,9 +59,10 @@ class FormProjets
|
||||
* @param string $filterkey Key to filter
|
||||
* @param int $nooutput No print output. Return it only.
|
||||
* @param int $forceaddid Force to add project id in list, event if not qualified
|
||||
* @param string $morecss More css
|
||||
* @return string Return html content
|
||||
*/
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0)
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0, $morecss='')
|
||||
{
|
||||
global $langs,$conf,$form;
|
||||
|
||||
@ -85,7 +86,7 @@ class FormProjets
|
||||
// )
|
||||
));
|
||||
|
||||
$out.='<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
$out.='<input type="text" class="minwidth200'.($morecss?' '.$morecss:'').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -489,14 +489,20 @@ class SMTPs
|
||||
// and send it out "single file"
|
||||
foreach ( $this->get_RCPT_list() as $_address )
|
||||
{
|
||||
/*
|
||||
/* Note:
|
||||
* BCC email addresses must be listed in the RCPT TO command list,
|
||||
* but the BCC header should not be printed under the DATA command.
|
||||
* http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO
|
||||
* After each 'RCPT TO:' is sent, we need to make sure it was kosher,
|
||||
* if not, the whole message will fail
|
||||
* If any email address fails, we will need to RESET the connection,
|
||||
* mark the last address as "bad" and start the address loop over again.
|
||||
* If any address fails, the entire message fails.
|
||||
*/
|
||||
* After each 'RCPT TO:' is sent, we need to make sure it was kosher,
|
||||
* if not, the whole message will fail
|
||||
* If any email address fails, we will need to RESET the connection,
|
||||
* mark the last address as "bad" and start the address loop over again.
|
||||
* If any address fails, the entire message fails.
|
||||
*/
|
||||
$this->socket_send_str('RCPT TO: <' . $_address . '>', '250');
|
||||
}
|
||||
|
||||
@ -1025,7 +1031,7 @@ class SMTPs
|
||||
/**
|
||||
* Returns an array of addresses for a specific type; TO, CC or BCC
|
||||
*
|
||||
* @param string $_which Which collection of adresses to return
|
||||
* @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc')
|
||||
* @return string|false Array of emaill address
|
||||
*/
|
||||
function get_email_list($_which = null)
|
||||
@ -1174,9 +1180,17 @@ class SMTPs
|
||||
if ( $this->getCC() )
|
||||
$_header .= 'Cc: ' . $this->getCC() . "\r\n";
|
||||
|
||||
/* Note:
|
||||
* BCC email addresses must be listed in the RCPT TO command list,
|
||||
* but the BCC header should not be printed under the DATA command.
|
||||
* So it is included into the function sendMsg() but not here.
|
||||
* http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server
|
||||
*/
|
||||
/*
|
||||
if ( $this->getBCC() )
|
||||
$_header .= 'Bcc: ' . $this->getBCC() . "\r\n";
|
||||
|
||||
*/
|
||||
|
||||
$host=$this->getHost();
|
||||
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
|
||||
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
|
||||
|
||||
@ -45,10 +45,12 @@ $Config['Enabled'] = true ;
|
||||
|
||||
|
||||
// Path to user files relative to the document root.
|
||||
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&file=' ;
|
||||
$extEntity=(empty($entity) ? 1 : $entity); // For multicompany with external access
|
||||
|
||||
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&entity='.$extEntity.'&file=' ;
|
||||
$Config['UserFilesAbsolutePathRelative'] = (empty($website) ? ((!empty($entity) ? '/' . $entity : '') . '/medias/') : ('/websites/'.$website));
|
||||
|
||||
|
||||
// Fill the following value it you prefer to specify the absolute path for the
|
||||
// user files directory. Useful if you are using a virtual directory, symbolic
|
||||
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
* @param string $urloption More parameters on URL request
|
||||
* @param int $minLength Minimum number of chars to trigger that Ajax search
|
||||
* @param int $autoselect Automatic selection if just one value
|
||||
* @param array $ajaxoptions Multiple options array
|
||||
* @param array $ajaxoptions Multiple options array
|
||||
* Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done
|
||||
* Ex: array('disabled'=>
|
||||
* Ex: array('show'=>
|
||||
@ -61,8 +61,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
||||
$("input#search_'.$htmlname.'").keydown(function() {
|
||||
$("#'.$htmlname.'").val("");
|
||||
});
|
||||
|
||||
/* I disable this. A call to trigger is already done later into the select action of the autocomplete code
|
||||
|
||||
/* I disable this. A call to trigger is already done later into the select action of the autocomplete code
|
||||
$("input#search_'.$htmlname.'").change(function() {
|
||||
console.log("Call the change trigger on input '.$htmlname.' because of a change on search_'.$htmlname.' was triggered");
|
||||
$("#'.$htmlname.'").trigger("change");
|
||||
@ -291,7 +291,7 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLengt
|
||||
needtotrigger="#" + fields[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (needtotrigger != "") // To force select2 to refresh visible content
|
||||
{
|
||||
// We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done
|
||||
@ -356,9 +356,10 @@ function ajax_dialog($title,$message,$w=350,$h=150)
|
||||
* @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
|
||||
* @param int $forcefocus Force focus on field
|
||||
* @param string $widthTypeOfAutocomplete 'resolve' or 'off'
|
||||
* @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason.
|
||||
*/
|
||||
function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0)
|
||||
function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -375,7 +376,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
|
||||
$(document).ready(function () {
|
||||
$(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({
|
||||
dir: \'ltr\',
|
||||
width: \'resolve\', /* off or resolve */
|
||||
width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */
|
||||
minimumInputLength: '.$minLengthToAutocomplete.'
|
||||
})';
|
||||
if ($forcefocus) $msg.= '.select2(\'focus\')';
|
||||
|
||||
@ -1126,6 +1126,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
||||
|
||||
if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email)))
|
||||
{
|
||||
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
@ -1159,14 +1161,16 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
||||
$out.='</td>';
|
||||
}
|
||||
$out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder);
|
||||
$out.='<td>'.$langs->trans("Label").'</td>';
|
||||
$out.='<td class="maxwidth100onsmartphone">'.$langs->trans("Label").'</td>';
|
||||
$out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep, a.id', '', $param, '', $sortfield, $sortorder);
|
||||
$out.='<td>'.$langs->trans("Type").'</td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td>'.$langs->trans("Owner").'</td>';
|
||||
$out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
$out.='<td align="center"></td>';
|
||||
$out.='<td class="maxwidthsearch">';
|
||||
//TODO Add selection of fields
|
||||
$out.='</td>';
|
||||
$out.='</tr>';
|
||||
|
||||
|
||||
@ -1176,7 +1180,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
||||
$out.='<td></td>';
|
||||
}
|
||||
$out.='<td></td>';
|
||||
$out.='<td><input type="text" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
|
||||
$out.='<td class="maxwidth100onsmartphone"><input type="text" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td>';
|
||||
$out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1);
|
||||
@ -1242,6 +1246,12 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($histo[$key]['dateend'],'hour');
|
||||
else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour');
|
||||
}
|
||||
$late=0;
|
||||
if ($histo[$key]['percent'] == 0 && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] == 0 && ! $histo[$key]['datestart'] && $histo[$key]['dateend'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && $histo[$key]['dateend'] && $db->jdate($histo[$key]['dateend']) < ($now - $delay_warning)) $late=1;
|
||||
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && ! $histo[$key]['dateend'] && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
|
||||
if ($late) $out.=img_warning($langs->trans("Late")).' ';
|
||||
$out.="</td>\n";
|
||||
|
||||
// Type
|
||||
|
||||
@ -772,7 +772,7 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
|
||||
*/
|
||||
function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0)
|
||||
{
|
||||
global $conf,$langs, $hookmanager;
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
$out="\n".'<div class="tabs" data-role="controlgroup" data-type="horizontal">'."\n";
|
||||
|
||||
@ -897,9 +897,13 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
|
||||
|
||||
if (! $notab) $out.="\n".'<div class="tabBar">'."\n";
|
||||
|
||||
$parameters=array('tabname' => $active);
|
||||
$reshook=$hookmanager->executeHooks('printTabsHead',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$parameters=array('tabname' => $active, 'out' => $out);
|
||||
$reshook=$hookmanager->executeHooks('printTabsHead',$parameters); // This hook usage is called just before output the head of tabs. Take also a look at "completeTabsHead"
|
||||
if ($reshook > 0)
|
||||
{
|
||||
$out = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -939,11 +943,12 @@ function dol_get_fiche_end($notab=0)
|
||||
* @param string $moreparam More param to add in nav link url.
|
||||
* @param int $nodbprefix Do not include DB prefix to forge table name
|
||||
* @param string $morehtmlleft More html code to show before ref
|
||||
* @param string $morehtmlstatus More html code to show under navigation arrows
|
||||
* @param string $morehtmlright More html code to show before navigation arrows
|
||||
* @param int $onlybanner Put this to 1, if the card will contains only a banner
|
||||
* @return void
|
||||
*/
|
||||
function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlright='', $onlybanner=0)
|
||||
function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
|
||||
{
|
||||
global $conf, $form, $user, $langs;
|
||||
|
||||
@ -1013,38 +1018,38 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
}
|
||||
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)) {
|
||||
$morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
|
||||
$morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
|
||||
}
|
||||
elseif ($object->element == 'product')
|
||||
{
|
||||
//$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Sell").') ';
|
||||
//$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Sell").') ';
|
||||
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
$morehtmlright.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
|
||||
$morehtmlstatus.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
|
||||
} else {
|
||||
$morehtmlright.=$object->getLibStatut(5,0);
|
||||
$morehtmlstatus.=$object->getLibStatut(5,0);
|
||||
}
|
||||
$morehtmlright.=' ';
|
||||
//$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Buy").') ';
|
||||
$morehtmlstatus.=' ';
|
||||
//$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') ';
|
||||
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
$morehtmlright.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
|
||||
$morehtmlstatus.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
|
||||
} else {
|
||||
$morehtmlright.=$object->getLibStatut(5,1);
|
||||
$morehtmlstatus.=$object->getLibStatut(5,1);
|
||||
}
|
||||
}
|
||||
elseif ($object->element == 'facture' || $object->element == 'invoice' || $object->element == 'invoice_supplier')
|
||||
{
|
||||
$tmptxt=$object->getLibStatut(6, $object->totalpaye);
|
||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) $tmptxt=$object->getLibStatut(5, $object->totalpaye);
|
||||
$morehtmlright.=$tmptxt;
|
||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye);
|
||||
$morehtmlstatus.=$tmptxt;
|
||||
}
|
||||
elseif ($object->element == 'facturerec')
|
||||
{
|
||||
$morehtmlright.='<!-- No status for recurring invoice -->';
|
||||
$morehtmlstatus.='<!-- No status for recurring invoice -->';
|
||||
}
|
||||
else {
|
||||
else { // Generic case
|
||||
$tmptxt=$object->getLibStatut(6);
|
||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) $tmptxt=$object->getLibStatut(5);
|
||||
$morehtmlright.=$tmptxt;
|
||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5);
|
||||
$morehtmlstatus.=$tmptxt;
|
||||
}
|
||||
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
|
||||
@ -1062,7 +1067,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
}
|
||||
|
||||
print '<div class="'.($onlybanner?'':'arearef ').'heightref valignmiddle" width="100%">';
|
||||
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright);
|
||||
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
|
||||
print '</div>';
|
||||
print '<div class="underrefbanner clearboth"></div>';
|
||||
}
|
||||
@ -2241,14 +2246,14 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
|
||||
* Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img
|
||||
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
|
||||
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
|
||||
* @param string $options Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @param int $pictoisfullpath If 1, image path is a full path
|
||||
* @param int $srconly Return only content of the src attribute of img.
|
||||
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
|
||||
* @return string Return img tag
|
||||
* @see #img_object, #img_picto_common
|
||||
*/
|
||||
function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0)
|
||||
function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $srconly=0, $notitle=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -2300,7 +2305,7 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $
|
||||
if (preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
|
||||
$title=$tmparray[0];
|
||||
$alt=empty($tmparray[1])?'':$tmparray[1];
|
||||
return '<img src="'.$fullpathpicto.'" border="0" alt="'.dol_escape_htmltag($alt).'"'.($notitle?'':' title="'.dol_escape_htmltag($title).'"').($options?' '.$options:'').'>'; // Alt is used for accessibility, title for popup
|
||||
return '<img src="'.$fullpathpicto.'" border="0" alt="'.dol_escape_htmltag($alt).'"'.($notitle?'':' title="'.dol_escape_htmltag($title).'"').($morealt?' '.$morealt:'').'>'; // Alt is used for accessibility, title for popup
|
||||
}
|
||||
}
|
||||
|
||||
@ -2310,16 +2315,16 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...)
|
||||
* For external modules use imagename@mymodule to search into directory "img" of module.
|
||||
* @param string $options Add more attribute on img tag (ie: class="datecallink")
|
||||
* @param string $morealt Add more attribute on img tag (ie: class="datecallink")
|
||||
* @param int $pictoisfullpath If 1, image path is a full path
|
||||
* @param int $srconly Return only content of the src attribute of img.
|
||||
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
|
||||
* @return string Return img tag
|
||||
* @see #img_picto, #img_picto_common
|
||||
*/
|
||||
function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0)
|
||||
function img_object($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $srconly=0, $notitle=0)
|
||||
{
|
||||
return img_picto($titlealt, 'object_'.$picto, $options, $pictoisfullpath, $srconly, $notitle);
|
||||
return img_picto($titlealt, 'object_'.$picto, $morealt, $pictoisfullpath, $srconly, $notitle);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2327,12 +2332,12 @@ function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false,
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
|
||||
* @param string $options Add more attribute on img tag
|
||||
* @param string $morealt Add more attribute on img tag
|
||||
* @param int $pictoisfullpath If 1, image path is a full path
|
||||
* @return string Return img tag
|
||||
* @see #img_object, #img_picto
|
||||
*/
|
||||
function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0)
|
||||
function img_weather($titlealt, $picto, $morealt = '', $pictoisfullpath = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -2340,7 +2345,7 @@ function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0)
|
||||
|
||||
$path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto;
|
||||
|
||||
return img_picto($titlealt, $path, $options, 1);
|
||||
return img_picto($titlealt, $path, $morealt, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2348,12 +2353,12 @@ function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0)
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
|
||||
* @param string $options Add more attribute on img tag
|
||||
* @param string $morealt Add more attribute on img tag
|
||||
* @param int $pictoisfullpath If 1, image path is a full path
|
||||
* @return string Return img tag
|
||||
* @see #img_object, #img_picto
|
||||
*/
|
||||
function img_picto_common($titlealt, $picto, $options = '', $pictoisfullpath = 0)
|
||||
function img_picto_common($titlealt, $picto, $morealt = '', $pictoisfullpath = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -2372,7 +2377,7 @@ function img_picto_common($titlealt, $picto, $options = '', $pictoisfullpath = 0
|
||||
}
|
||||
}
|
||||
|
||||
return img_picto($titlealt, $path, $options, 1);
|
||||
return img_picto($titlealt, $path, $morealt, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2478,9 +2483,9 @@ function img_view($titlealt = 'default', $float = 0, $other = '')
|
||||
|
||||
if ($titlealt == 'default') $titlealt = $langs->trans('View');
|
||||
|
||||
$options = ($float ? 'style="float: right" ' : '').$other;
|
||||
$morealt = ($float ? 'style="float: right" ' : '').$other;
|
||||
|
||||
return img_picto($titlealt, 'view.png', $options);
|
||||
return img_picto($titlealt, 'view.png', $morealt);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2552,16 +2557,16 @@ function img_info($titlealt = 'default')
|
||||
* Show warning logo
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $options Add more attribute on img tag (For example 'style="float: right"'). If 1
|
||||
* @param string $morealt Add more attribute on img tag (For example 'style="float: right"'). If 1
|
||||
* @return string Return img tag
|
||||
*/
|
||||
function img_warning($titlealt = 'default', $options = '')
|
||||
function img_warning($titlealt = 'default', $morealt = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($titlealt == 'default') $titlealt = $langs->trans('Warning');
|
||||
|
||||
return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($options ? ($options == '1' ? ' style="float: right"' : ' '.$options): ''));
|
||||
return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($morealt ? ($morealt == '1' ? ' style="float: right"' : ' '.$morealt): ''));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2583,32 +2588,32 @@ function img_error($titlealt = 'default')
|
||||
* Show next logo
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $options Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @return string Return img tag
|
||||
*/
|
||||
function img_next($titlealt = 'default', $options='')
|
||||
function img_next($titlealt = 'default', $morealt='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($titlealt == 'default') $titlealt = $langs->trans('Next');
|
||||
|
||||
return img_picto($titlealt, 'next.png', $options);
|
||||
return img_picto($titlealt, 'next.png', $morealt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show previous logo
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param string $options Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @return string Return img tag
|
||||
*/
|
||||
function img_previous($titlealt = 'default', $options='')
|
||||
function img_previous($titlealt = 'default', $morealt='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($titlealt == 'default') $titlealt = $langs->trans('Previous');
|
||||
|
||||
return img_picto($titlealt, 'previous.png', $options);
|
||||
return img_picto($titlealt, 'previous.png', $morealt);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2650,16 +2655,16 @@ function img_up($titlealt = 'default', $selected = 0, $moreclass='')
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param int $selected Selected
|
||||
* @param string $options Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @return string Return img tag
|
||||
*/
|
||||
function img_left($titlealt = 'default', $selected = 0, $options='')
|
||||
function img_left($titlealt = 'default', $selected = 0, $morealt='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($titlealt == 'default') $titlealt = $langs->trans('Left');
|
||||
|
||||
return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $options);
|
||||
return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $morealt);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2667,16 +2672,16 @@ function img_left($titlealt = 'default', $selected = 0, $options='')
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param int $selected Selected
|
||||
* @param string $options Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @param string $morealt Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @return string Return img tag
|
||||
*/
|
||||
function img_right($titlealt = 'default', $selected = 0, $options='')
|
||||
function img_right($titlealt = 'default', $selected = 0, $morealt='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($titlealt == 'default') $titlealt = $langs->trans('Right');
|
||||
|
||||
return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $options);
|
||||
return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $morealt);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5334,8 +5339,9 @@ function picto_from_langcode($codelang)
|
||||
}
|
||||
|
||||
/**
|
||||
* Complete or removed entries into a head array (used to build tabs) with value added by external modules.
|
||||
* Such values are declared into $conf->modules_parts['tab'].
|
||||
* Complete or removed entries into a head array (used to build tabs).
|
||||
* For example, with value added by external modules. Such values are declared into $conf->modules_parts['tab'].
|
||||
* Or by change using hook completeTabsHead
|
||||
*
|
||||
* @param Conf $conf Object conf
|
||||
* @param Translate $langs Object langs
|
||||
@ -5362,6 +5368,8 @@ function picto_from_langcode($codelang)
|
||||
*/
|
||||
function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode='add')
|
||||
{
|
||||
global $hookmanager;
|
||||
|
||||
if (isset($conf->modules_parts['tabs'][$type]) && is_array($conf->modules_parts['tabs'][$type]))
|
||||
{
|
||||
foreach ($conf->modules_parts['tabs'][$type] as $value)
|
||||
@ -5427,6 +5435,17 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// No need to make a return $head. Var is modified as a reference
|
||||
if (! empty($hookmanager))
|
||||
{
|
||||
$parameters=array('object' => $object, 'mode' => $mode, 'head'=>$head);
|
||||
$reshook=$hookmanager->executeHooks('completeTabsHead',$parameters);
|
||||
if ($reshook > 0)
|
||||
{
|
||||
$head = $hookmanager->resArray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -322,7 +322,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
{
|
||||
$result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[2]=round($result[2]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[0]=price2num($result[2]-$result[0], 'MT');
|
||||
$result[0]=price2num($result[2]-$result[1], 'MT');
|
||||
$result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
}
|
||||
|
||||
@ -515,6 +515,110 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
// Expense Report
|
||||
if ($direction == 'buy')
|
||||
{
|
||||
// Define sql request
|
||||
$sql='';
|
||||
|
||||
// Count on payments date
|
||||
$sql = "SELECT e.rowid, d.product_type as dtype, e.rowid as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.total_tva as total_vat, e.note_private as descr,";
|
||||
$sql .=" d.total_localtax1 as total_localtax1, d.total_localtax2 as total_localtax2, ";
|
||||
$sql.= " e.date_debut as date_start, e.date_fin as date_end,";
|
||||
$sql.= " e.ref as facnum, e.total_ttc as ftotal_ttc, e.date_create, s.nom as company_name, s.rowid as company_id, d.fk_c_type_fees as type,";
|
||||
$sql.= " p.fk_bank as payment_id, p.amount as payment_amount, p.rowid as pid, e.ref as pref";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."expensereport_det as d,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."expensereport as e,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."payment_expensereport as p";
|
||||
$sql.= " WHERE e.entity = " . $conf->entity;
|
||||
$sql.= " AND e.fk_statut in (6)";
|
||||
$sql.= " AND e.rowid = p.fk_expensereport";
|
||||
$sql.= " AND s.rowid = e.entity";
|
||||
$sql.= " AND d.fk_expensereport = e.rowid";
|
||||
if ($y && $m)
|
||||
{
|
||||
$sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
|
||||
$sql.= " AND p.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
|
||||
}
|
||||
else if ($y)
|
||||
{
|
||||
$sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
|
||||
$sql.= " AND p.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
|
||||
}
|
||||
if ($q) $sql.= " AND (date_format(p.datep,'%m') > ".(($q-1)*3)." AND date_format(p.datep,'%m') <= ".($q*3).")";
|
||||
if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = -1";
|
||||
$sql.= " OR e.date_debut is NOT null OR e.date_fin IS NOT NULL)"; // enhance detection of service
|
||||
$sql.= " ORDER BY e.rowid";
|
||||
|
||||
if (! $sql)
|
||||
{
|
||||
dol_syslog("Tax.lib.php::vat_by_date no accountancy module enabled".$sql,LOG_ERR);
|
||||
return -1; // -1 = Not accountancy module enabled
|
||||
}
|
||||
if ($sql == 'TODO') return -2; // -2 = Feature not yet available
|
||||
if ($sql != 'TODO')
|
||||
{
|
||||
dol_syslog("Tax.lib.php::vat_by_date", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$rate = -1;
|
||||
$oldrowid='';
|
||||
while($assoc = $db->fetch_array($resql))
|
||||
{
|
||||
if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['totalht']=0;
|
||||
if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['vat']=0;
|
||||
if (! isset($list[$assoc['rate']]['localtax1'])) $list[$assoc['rate']]['localtax1']=0;
|
||||
if (! isset($list[$assoc['rate']]['localtax2'])) $list[$assoc['rate']]['localtax2']=0;
|
||||
|
||||
if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid
|
||||
{
|
||||
$oldrowid=$assoc['rowid'];
|
||||
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
||||
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
|
||||
$list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2'];
|
||||
}
|
||||
|
||||
$list[$assoc['rate']]['vat'] = $assoc['total_vat'];
|
||||
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
||||
$list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment';
|
||||
$list[$assoc['rate']]['datef'][] = $assoc['datef'];
|
||||
$list[$assoc['rate']]['company_name'][] = $assoc['company_name'];
|
||||
$list[$assoc['rate']]['company_id'][] = $assoc['company_id'];
|
||||
$list[$assoc['rate']]['ddate_start'][] = $db->jdate($assoc['date_start']);
|
||||
$list[$assoc['rate']]['ddate_end'][] = $db->jdate($assoc['date_end']);
|
||||
|
||||
$list[$assoc['rate']]['facid'][] = $assoc['facid'];
|
||||
$list[$assoc['rate']]['facnum'][] = $assoc['facnum'];
|
||||
$list[$assoc['rate']]['type'][] = $assoc['type'];
|
||||
$list[$assoc['rate']]['ftotal_ttc'][] = $assoc['ftotal_ttc'];
|
||||
$list[$assoc['rate']]['descr'][] = $assoc['descr'];
|
||||
|
||||
$list[$assoc['rate']]['totalht_list'][] = $assoc['total_ht'];
|
||||
$list[$assoc['rate']]['vat_list'][] = $assoc['total_vat'];
|
||||
$list[$assoc['rate']]['localtax1_list'][] = $assoc['total_localtax1'];
|
||||
$list[$assoc['rate']]['localtax2_list'][] = $assoc['total_localtax2'];
|
||||
|
||||
$list[$assoc['rate']]['pid'][] = $assoc['pid'];
|
||||
$list[$assoc['rate']]['pref'][] = $assoc['pref'];
|
||||
$list[$assoc['rate']]['ptype'][] = 'ExpenseReportPayment';
|
||||
|
||||
$list[$assoc['rate']]['payment_id'][] = $assoc['payment_id'];
|
||||
$list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount'];
|
||||
|
||||
$rate = $assoc['rate'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
@ -465,7 +465,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $langs->trans("Default");
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>ffffff</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print ' ('.$langs->trans("Default").': <strong>ffffff</strong>) ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -511,7 +512,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $langs->trans("Default");
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>'.$default.'</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print ' ('.$langs->trans("Default").': <strong>'.$default.'</strong>) ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -554,7 +556,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE);
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>'.$default.'</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print ' ('.$langs->trans("Default").': <strong>'.$default.'</strong>) ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -581,7 +584,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default"));
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>e6e6e6</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print ' ('.$langs->trans("Default").': <strong>e6e6e6</strong>) ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@ -607,7 +611,9 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default"));
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>3c3c14</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print ' ('.$langs->trans("Default").': <strong>3c3c14</strong>) ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@ -653,7 +659,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $langs->trans("Default");
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>000078</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print ' ('.$langs->trans("Default").': <strong>000078</strong>) ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -696,7 +703,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
}
|
||||
else print $langs->trans("None");
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>edf4fb</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print ' ('.$langs->trans("Default").': <strong>edf4fb</strong>) ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -372,9 +372,6 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$this->error=$outputlangs->transnoentities("ErrorConstantNotDefined","EXP_OUTPUTDIR");
|
||||
return 0;
|
||||
}
|
||||
$this->error=$outputlangs->transnoentities("ErrorUnknown");
|
||||
return 0; // Erreur par defaut
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -29,8 +29,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php';
|
||||
|
||||
|
||||
/**
|
||||
* \class mod_facture_mercure
|
||||
* \brief Classe du modele de numerotation de reference de facture Mercure
|
||||
* Class of numbering module Mercure for invoices
|
||||
*/
|
||||
class mod_facture_mercure extends ModeleNumRefFactures
|
||||
{
|
||||
|
||||
@ -115,12 +115,6 @@ class modExpenseReport extends DolibarrModules
|
||||
$this->rights[4][3] = 0;
|
||||
$this->rights[4][4] = 'supprimer';
|
||||
|
||||
$this->rights[2][0] = 774;
|
||||
$this->rights[2][1] = 'Read all expense reports';
|
||||
$this->rights[2][2] = 'r';
|
||||
$this->rights[2][3] = 1;
|
||||
$this->rights[2][4] = 'readall';
|
||||
|
||||
$this->rights[6][0] = 775;
|
||||
$this->rights[6][1] = 'Approve expense reports';
|
||||
$this->rights[6][2] = 'w';
|
||||
@ -133,20 +127,17 @@ class modExpenseReport extends DolibarrModules
|
||||
$this->rights[7][3] = 0;
|
||||
$this->rights[7][4] = 'to_paid';
|
||||
|
||||
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN))
|
||||
{
|
||||
$this->rights[8][0] = 777;
|
||||
$this->rights[8][1] = 'Synchroniser les NDF avec un compte courant';
|
||||
$this->rights[8][2] = 'w';
|
||||
$this->rights[8][3] = 0;
|
||||
$this->rights[8][4] = 'synchro';
|
||||
$this->rights[2][0] = 777;
|
||||
$this->rights[2][1] = 'Read expense reports of everybody';
|
||||
$this->rights[2][2] = 'r';
|
||||
$this->rights[2][3] = 1;
|
||||
$this->rights[2][4] = 'readall';
|
||||
|
||||
$this->rights[9][0] = 778;
|
||||
$this->rights[9][1] = 'Exporter les NDF au format CSV';
|
||||
$this->rights[9][2] = 'r';
|
||||
$this->rights[9][3] = 0;
|
||||
$this->rights[9][4] = 'export_csv';
|
||||
}
|
||||
$this->rights[2][0] = 778;
|
||||
$this->rights[2][1] = 'Create expense reports for everybody';
|
||||
$this->rights[2][2] = 'w';
|
||||
$this->rights[2][3] = 0;
|
||||
$this->rights[2][4] = 'writeall_advance';
|
||||
|
||||
$this->rights[5][0] = 779;
|
||||
$this->rights[5][1] = 'Export expense reports';
|
||||
|
||||
@ -62,7 +62,7 @@ class modMultiCurrency extends DolibarrModules
|
||||
$this->description = "Module to enter elements with a foreign currency";
|
||||
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
||||
$this->version = 'development';
|
||||
$this->version = 'experimental';
|
||||
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* 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
|
||||
@ -21,14 +22,14 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php
|
||||
* \ingroup supplier invoice
|
||||
* \brief File containing the Cactus Class of numbering models of suppliers invoices references
|
||||
* \brief File containing class for the numbering module Cactus
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_invoice/modules_facturefournisseur.php';
|
||||
|
||||
|
||||
/**
|
||||
* Cactus Class of numbering models of suppliers invoices references
|
||||
* Cactus Class of numbering models of suppliers invoices references
|
||||
*/
|
||||
class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
{
|
||||
@ -36,6 +37,8 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
var $error = '';
|
||||
var $nom = 'Cactus';
|
||||
var $prefixinvoice='SI';
|
||||
var $prefixcreditnote='SA';
|
||||
var $prefixdeposit='SD';
|
||||
|
||||
|
||||
/**
|
||||
@ -46,7 +49,8 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
function info()
|
||||
{
|
||||
global $langs;
|
||||
return $langs->trans("SimpleNumRefModelDesc",$this->prefixinvoice);
|
||||
$langs->load("bills");
|
||||
return $langs->trans("CactusNumRefModelDesc1",$this->prefixinvoice,$this->prefixcreditnote,$this->prefixdeposit);
|
||||
}
|
||||
|
||||
|
||||
@ -61,45 +65,86 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering.
|
||||
*
|
||||
* @return boolean false if conflict, true if ok
|
||||
*/
|
||||
function canBeActivated()
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
/**
|
||||
* Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering.
|
||||
*
|
||||
* @return boolean false if conflict, true if ok
|
||||
*/
|
||||
function canBeActivated()
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
|
||||
$siyymm=''; $max='';
|
||||
$langs->load("bills");
|
||||
|
||||
// Check invoice num
|
||||
$siyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefixinvoice."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; }
|
||||
}
|
||||
if (! $siyymm || preg_match('/'.$this->prefixinvoice.'[0-9][0-9][0-9][0-9]/i',$siyymm))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; }
|
||||
}
|
||||
if ($siyymm && ! preg_match('/'.$this->prefixinvoice.'[0-9][0-9][0-9][0-9]/i',$siyymm))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorNumRefModel',$max);
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check credit note num
|
||||
$siyymm='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefixcreditnote."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; }
|
||||
}
|
||||
if ($siyymm && ! preg_match('/'.$this->prefixcreditnote.'[0-9][0-9][0-9][0-9]/i',$siyymm))
|
||||
{
|
||||
$this->error=$langs->trans('ErrorNumRefModel',$max);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check deposit num
|
||||
$siyymm='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefixdeposit."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; }
|
||||
}
|
||||
if ($siyymm && ! preg_match('/'.$this->prefixdeposit.'[0-9][0-9][0-9][0-9]/i',$siyymm))
|
||||
{
|
||||
$this->error=$langs->trans('ErrorNumRefModel',$max);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return next value
|
||||
*
|
||||
* @param Societe $objsoc Object third party
|
||||
* @param Object $object Object
|
||||
* @param Object $object Object invoice
|
||||
* @param string $mode 'next' for next value or 'last' for last value
|
||||
* @return string Value if OK, 0 if KO
|
||||
*/
|
||||
@ -108,6 +153,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
global $db,$conf;
|
||||
|
||||
if ($object->type == 2) $prefix=$this->prefixcreditnote;
|
||||
else if ($facture->type == 3) $prefix=$this->prefixdeposit;
|
||||
else $prefix=$this->prefixinvoice;
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* 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
|
||||
@ -59,6 +60,9 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
|
||||
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$texte.= '<input type="hidden" name="action" value="updateMask">';
|
||||
$texte.= '<input type="hidden" name="maskconstinvoice" value="SUPPLIER_INVOICE_TULIP_MASK">';
|
||||
$texte.= '<input type="hidden" name="maskconstreplacement" value="SUPPLIER_REPLACEMENT_TULIP_MASK">';
|
||||
$texte.= '<input type="hidden" name="maskconstcredit" value="SUPPLIER_CREDIT_TULIP_MASK">';
|
||||
$texte.= '<input type="hidden" name="maskconstdeposit" value="SUPPLIER_DEPOSIT_TULIP_MASK">';
|
||||
$texte.= '<table class="nobordernopadding" width="100%">';
|
||||
|
||||
$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Invoice"),$langs->transnoentities("Invoice"));
|
||||
@ -68,13 +72,28 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
|
||||
$tooltip.=$langs->trans("GenericMaskCodes5");
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):</td>';
|
||||
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskinvoice" value="'.$conf->global->SUPPLIER_INVOICE_TULIP_MASK.'">',$tooltip,1,1).'</td>';
|
||||
|
||||
$texte.= '<td align="left" rowspan="2"> <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||
|
||||
$texte.= '</tr>';
|
||||
|
||||
// Parametrage du prefix des replacement
|
||||
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</td>';
|
||||
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskreplacement" value="'.$conf->global->SUPPLIER_REPLACEMENT_TULIP_MASK.'">',$tooltip,1,1).'</td>';
|
||||
$texte.= '</tr>';
|
||||
|
||||
// Parametrage du prefix des avoirs
|
||||
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):</td>';
|
||||
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskcredit" value="'.$conf->global->SUPPLIER_CREDIT_TULIP_MASK.'">',$tooltip,1,1).'</td>';
|
||||
$texte.= '</tr>';
|
||||
|
||||
// Parametrage du prefix des acomptes
|
||||
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):</td>';
|
||||
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskdeposit" value="'.$conf->global->SUPPLIER_DEPOSIT_TULIP_MASK.'">',$tooltip,1,1).'</td>';
|
||||
$texte.= '</tr>';
|
||||
|
||||
$texte.= '</table>';
|
||||
$texte.= '</form>';
|
||||
|
||||
@ -106,7 +125,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
|
||||
* Return next value
|
||||
*
|
||||
* @param Societe $objsoc Object third party
|
||||
* @param Object $object Object
|
||||
* @param Object $object Object invoice
|
||||
* @param string $mode 'next' for next value or 'last' for last value
|
||||
* @return string Value if OK, 0 if KO
|
||||
*/
|
||||
@ -116,16 +135,26 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
|
||||
|
||||
// On defini critere recherche compteur
|
||||
$mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK;
|
||||
|
||||
// Get Mask value
|
||||
$mask = '';
|
||||
if (is_object($object) && $object->type == 1)
|
||||
{
|
||||
$mask=$conf->global->SUPPLIER_REPLACEMENT_TULIP_MASK;
|
||||
if (! $mask)
|
||||
{
|
||||
$mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK;
|
||||
}
|
||||
}
|
||||
else if (is_object($object) && $object->type == 2) $mask=$conf->global->SUPPLIER_CREDIT_TULIP_MASK;
|
||||
else if (is_object($object) && $object->type == 3) $mask=$conf->global->SUPPLIER_DEPOSIT_TULIP_MASK;
|
||||
else $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK;
|
||||
if (! $mask)
|
||||
{
|
||||
$this->error='NotConfigured';
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Supplier invoices take invoice date instead of creation date for the mask
|
||||
// Supplier invoices take invoice date instead of creation date for the mask
|
||||
$numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc,$object->date);
|
||||
|
||||
return $numFinal;
|
||||
|
||||
@ -110,11 +110,10 @@ if ($permission) {
|
||||
<div class="tagtd nowrap maxwidthonsmartphone">
|
||||
<?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?>
|
||||
<?php
|
||||
// add company icon for direct link
|
||||
if ($selectedCompany && empty($conf->dol_use_jmobile))
|
||||
// add company icon before select list
|
||||
if ($selectedCompany)
|
||||
{
|
||||
$companystatic->fetch($selectedCompany);
|
||||
echo $companystatic->getNomUrl(2, '', 0, 1);
|
||||
echo img_object('', 'company', 'class="hideonsmartphone"');
|
||||
}
|
||||
?>
|
||||
<?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0); ?>
|
||||
|
||||
@ -63,8 +63,8 @@ elseif ($module == 'shipping') { $permission=$user->rights->expedition->cr
|
||||
elseif ($module == 'product') { $permission=$user->rights->produit->creer;}
|
||||
//else dol_print_error('','Bad value '.$module.' for param module');
|
||||
|
||||
if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:100'; // Rem: This var is for all notes, not only thirdparties note.
|
||||
else $typeofdata='textarea:12:100';
|
||||
if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%'; // Rem: This var is for all notes, not only thirdparties note.
|
||||
else $typeofdata='textarea:12:95%';
|
||||
|
||||
?>
|
||||
|
||||
@ -72,14 +72,14 @@ else $typeofdata='textarea:12:100';
|
||||
<div class="tagtable border table-border centpercent">
|
||||
<?php if ($module != 'product') { // No public note yet on products ?>
|
||||
<div class="tagtr table-border-row">
|
||||
<div class="tagtd table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?></div>
|
||||
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
|
||||
<div class="tagtd table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); ?></div>
|
||||
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if (empty($user->societe_id)) { ?>
|
||||
<div class="tagtr table-border-row">
|
||||
<div class="tagtd table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?></div>
|
||||
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
|
||||
<div class="tagtd table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); ?></div>
|
||||
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@ -96,7 +96,7 @@ if (count($listofsearchfields))
|
||||
{
|
||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="14"></td>';
|
||||
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'"></td>';
|
||||
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@ -140,9 +140,9 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<td colspan="2">'.$langs->trans("ECMSearchByKeywords").'</td></tr>';
|
||||
print "<tr ".$bc[false]."><td>".$langs->trans("Ref").':</td><td align="right"><input type="text" name="search_ref" class="flat" size="14"></td></tr>';
|
||||
print "<tr ".$bc[false]."><td>".$langs->trans("Title").':</td><td align="right"><input type="text" name="search_title" class="flat" size="14"></td></tr>';
|
||||
print "<tr ".$bc[false]."><td>".$langs->trans("Keyword").':</td><td align="right"><input type="text" name="search_keyword" class="flat" size="14"></td></tr>';
|
||||
print "<tr ".$bc[false]."><td>".$langs->trans("Ref").':</td><td align="right"><input type="text" name="search_ref" class="flat" size="10"></td></tr>';
|
||||
print "<tr ".$bc[false]."><td>".$langs->trans("Title").':</td><td align="right"><input type="text" name="search_title" class="flat" size="10"></td></tr>';
|
||||
print "<tr ".$bc[false]."><td>".$langs->trans("Keyword").':</td><td align="right"><input type="text" name="search_keyword" class="flat" size="10"></td></tr>';
|
||||
print "<tr ".$bc[false].'><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print "</table></form>";
|
||||
//print $langs->trans("ECMSectionManualDesc");
|
||||
|
||||
@ -46,6 +46,8 @@ $langs->load("mails");
|
||||
|
||||
$action=GETPOST('action');
|
||||
$cancel=GETPOST('cancel');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
|
||||
$date_start = dol_mktime(0, 0, 0, GETPOST('date_debutmonth'), GETPOST('date_debutday'), GETPOST('date_debutyear'));
|
||||
$date_end = dol_mktime(0, 0, 0, GETPOST('date_finmonth'), GETPOST('date_finday'), GETPOST('date_finyear'));
|
||||
$date = dol_mktime(0, 0, 0, GETPOST('datemonth'), GETPOST('dateday'), GETPOST('dateyear'));
|
||||
@ -192,6 +194,12 @@ if (empty($reshook))
|
||||
$object->date_debut = $date_start;
|
||||
$object->date_fin = $date_end;
|
||||
|
||||
$object->fk_user_author = GETPOST('fk_user_author','int');
|
||||
if (! ($object->fk_user_author > 0)) $object->fk_user_author = $user->id;
|
||||
|
||||
$fuser=new User($db);
|
||||
$fuser->fetch($object->fk_user_author);
|
||||
|
||||
$object->fk_statut = 1;
|
||||
$object->fk_c_paiement = GETPOST('fk_c_paiement','int');
|
||||
$object->fk_user_validator = GETPOST('fk_user_validator','int');
|
||||
@ -204,7 +212,7 @@ if (empty($reshook))
|
||||
if ($ret < 0) $error++;
|
||||
}
|
||||
|
||||
if ($object->periode_existe($user,$object->date_debut,$object->date_fin))
|
||||
if ($object->periode_existe($fuser,$object->date_debut,$object->date_fin))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorDoubleDeclaration"), null, 'errors');
|
||||
@ -1198,18 +1206,35 @@ if ($action == 'create')
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
// Date start
|
||||
print '<tr>';
|
||||
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("DateStart").'</td>';
|
||||
print '<td>';
|
||||
$form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("DateEnd").'</td>';
|
||||
print '<td>';
|
||||
$form->select_date($date_end?$date_end:-1,'date_fin',0,0,0,'',1,1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("User").'</td>';
|
||||
print '<td>';
|
||||
$defaultselectuser=$user->id;
|
||||
if (GETPOST('fk_user_author') > 0) $defaultselectuser=GETPOST('fk_user_author');
|
||||
$include_users = array($user->id);
|
||||
if (! empty($user->rights->expensereport->writeall)) $include_users=array();
|
||||
$s=$form->select_dolusers($defaultselectuser, "fk_user_author", 0, "", 0, $include_users);
|
||||
print $s;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("VALIDATOR").'</td>';
|
||||
print '<td>';
|
||||
@ -1222,6 +1247,8 @@ if ($action == 'create')
|
||||
print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Payment mode
|
||||
if (! empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION))
|
||||
{
|
||||
print '<tr>';
|
||||
@ -1284,7 +1311,8 @@ else
|
||||
{
|
||||
if ($object->fk_user_author != $user->id)
|
||||
{
|
||||
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous))
|
||||
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
|
||||
&& empty($user->rights->expensereport->writeall_advance))
|
||||
{
|
||||
print load_fiche_titre($langs->trans('TripCard'));
|
||||
|
||||
@ -1322,6 +1350,14 @@ else
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("User").'</td>';
|
||||
print '<td>';
|
||||
$userfee=new User($db);
|
||||
$userfee->fetch($object->fk_user_author);
|
||||
print $userfee->getNomUrl(-1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td>';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||
@ -1372,13 +1408,6 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("AUTHOR").'</td>';
|
||||
print '<td>';
|
||||
$userfee=new User($db);
|
||||
$userfee->fetch($object->fk_user_author);
|
||||
print $userfee->getNomUrl(-1);
|
||||
print '</td></tr>';
|
||||
if ($object->fk_statut==6)
|
||||
{
|
||||
print '<tr>';
|
||||
@ -1430,6 +1459,20 @@ else
|
||||
{
|
||||
dol_fiche_head($head, 'card', $langs->trans("ExpenseReport"), 0, 'trip');
|
||||
|
||||
// Clone confirmation
|
||||
if ($action == 'clone') {
|
||||
// Create an array for form
|
||||
$formquestion = array(
|
||||
// 'text' => $langs->trans("ConfirmClone"),
|
||||
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' =>
|
||||
// 1),
|
||||
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
|
||||
// => 1),
|
||||
);
|
||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneExpenseReport'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
}
|
||||
|
||||
if ($action == 'save')
|
||||
{
|
||||
$formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1);
|
||||
@ -1543,6 +1586,19 @@ else
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||
print '</td></tr>';*/
|
||||
|
||||
// Author
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("User").'</td>';
|
||||
print '<td>';
|
||||
if ($object->fk_user_author > 0)
|
||||
{
|
||||
$userauthor=new User($db);
|
||||
$result=$userauthor->fetch($object->fk_user_author);
|
||||
if ($result < 0) dol_print_error('',$userauthor->error);
|
||||
print $userauthor->getNomUrl(-1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("Period").'</td>';
|
||||
print '<td>';
|
||||
@ -1595,19 +1651,6 @@ else
|
||||
print '<td>'.price($object->total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Author
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("AUTHOR").'</td>';
|
||||
print '<td>';
|
||||
if ($object->fk_user_author > 0)
|
||||
{
|
||||
$userauthor=new User($db);
|
||||
$result=$userauthor->fetch($object->fk_user_author);
|
||||
if ($result < 0) dol_print_error('',$userauthor->error);
|
||||
print $userauthor->getNomUrl(-1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Validation date
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DATE_SAVE").'</td>';
|
||||
@ -1824,7 +1867,7 @@ else
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td style="text-align:center;">'.$langs->trans('Piece').'</td>';
|
||||
print '<td style="text-align:center;">'.$langs->trans('Date').'</td>';
|
||||
if (! empty($conf->projet->enabled)) print '<td>'.$langs->trans('Project').'</td>';
|
||||
if (! empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$langs->trans('Project').'</td>';
|
||||
print '<td style="text-align:center;">'.$langs->trans('Type').'</td>';
|
||||
print '<td style="text-align:left;">'.$langs->trans('Description').'</td>';
|
||||
print '<td style="text-align:right;">'.$langs->trans('VAT').'</td>';
|
||||
@ -1972,10 +2015,11 @@ else
|
||||
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline' && $user->rights->expensereport->creer)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td></td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
if (! empty($conf->projet->enabled)) print '<td>'.$langs->trans('Project').'</td>';
|
||||
if (! empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$langs->trans('Project').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Type').'</td>';
|
||||
print '<td colspan="2">'.$langs->trans('Description').'</td>';
|
||||
print '<td>'.$langs->trans('Description').'</td>';
|
||||
print '<td align="right">'.$langs->trans('VAT').'</td>';
|
||||
print '<td align="right">'.$langs->trans('PriceUTTC').'</td>';
|
||||
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||
@ -1985,6 +2029,8 @@ else
|
||||
|
||||
print '<tr '.$bc[true].'>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
// Select date
|
||||
print '<td align="center">';
|
||||
$form->select_date($date?$date:-1,'date');
|
||||
@ -2004,7 +2050,7 @@ else
|
||||
print '</td>';
|
||||
|
||||
// Add comments
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
print '<textarea class="flat_ndf centpercent" name="comments">'.$comments.'</textarea>';
|
||||
print '</td>';
|
||||
|
||||
@ -2198,6 +2244,10 @@ if ($action != 'create' && $action != 'edit')
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$object->id.'">'.$langs->trans('Cancel').'</a></div>';
|
||||
}
|
||||
|
||||
// Clone
|
||||
if ($user->rights->expensereport->creer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone">' . $langs->trans("ToClone") . '</a></div>';
|
||||
}
|
||||
|
||||
/* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */
|
||||
if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->fk_statut <= 4)
|
||||
@ -2219,7 +2269,7 @@ print '</div>';
|
||||
//$conf->global->DOL_URL_ROOT_DOCUMENT_PHP=dol_buildpath('/expensereport/documentwrapper.php',1);
|
||||
|
||||
|
||||
print '<div style="width:50%">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
/*
|
||||
* Generate documents
|
||||
|
||||
@ -126,6 +126,9 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$fuserid = $this->fk_user_author;
|
||||
if (empty($fuserid)) $fuserid = $user->id;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." (";
|
||||
@ -153,7 +156,7 @@ class ExpenseReport extends CommonObject
|
||||
$sql.= ", '".$this->db->idate($this->date_debut)."'";
|
||||
$sql.= ", '".$this->db->idate($this->date_fin)."'";
|
||||
$sql.= ", '".$this->db->idate($now)."'";
|
||||
$sql.= ", ".($user->id > 0 ? $user->id:"null");
|
||||
$sql.= ", ".$fuserid;
|
||||
$sql.= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null");
|
||||
$sql.= ", ".($this->fk_user_modif > 0 ? $this->fk_user_modif:"null");
|
||||
$sql.= ", ".($this->fk_statut > 1 ? $this->fk_statut:0);
|
||||
@ -222,6 +225,78 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $socid Id of thirdparty
|
||||
* @return int New id of clone
|
||||
*/
|
||||
function createFromClone($socid=0)
|
||||
{
|
||||
global $user,$hookmanager;
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get extrafields so they will be clone
|
||||
foreach($this->lines as $line)
|
||||
//$line->fetch_optionals($line->rowid);
|
||||
|
||||
// Load source object
|
||||
$objFrom = clone $this;
|
||||
|
||||
$this->id=0;
|
||||
$this->ref = '';
|
||||
$this->statut=0;
|
||||
|
||||
// Clear fields
|
||||
$this->fk_user_author = $user->id;
|
||||
$this->fk_user_valid = '';
|
||||
$this->date_create = '';
|
||||
$this->date_creation = '';
|
||||
$this->date_validation = '';
|
||||
|
||||
// Create clone
|
||||
$result=$this->create($user);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Hook of thirdparty module
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('objFrom'=>$objFrom);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('EXPENSEREPORT_CLONE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* update
|
||||
*
|
||||
@ -1164,25 +1239,56 @@ class ExpenseReport extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @return string String with URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $max Max length of shown ref
|
||||
* @param int $short 1=Return just URL
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0)
|
||||
function getNomUrl($withpicto=0,$max=0,$short=0,$moretitle='',$notooltip=0)
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $conf;
|
||||
|
||||
$result='';
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?id='.$this->id.'">';
|
||||
$linkend='</a>';
|
||||
$url = DOL_URL_ROOT.'/expensereport/card.php?id='.$this->id;
|
||||
|
||||
if ($short) return $url;
|
||||
|
||||
$picto='trip';
|
||||
$label = '<u>' . $langs->trans("ShowExpenseReport") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
if (! empty($this->total_ht))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if ($moretitle) $label.=' - '.$moretitle;
|
||||
|
||||
$label=$langs->trans("Show").': '.$this->ref;
|
||||
$ref=$this->ref;
|
||||
if (empty($ref)) $ref=$this->id;
|
||||
|
||||
if ($withpicto) $result.=($link.img_object($label,$picto).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowExpenseReport");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend.' ');
|
||||
$result.=$linkstart.($max?dol_trunc($ref,$max):$ref).$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ if (empty($user->socid)) $fieldstosearchall["d.note_private"]="NotePrivate";
|
||||
|
||||
$arrayfields=array(
|
||||
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||
'user'=>array('label'=>$langs->trans("Person"), 'checked'=>1),
|
||||
'user'=>array('label'=>$langs->trans("User"), 'checked'=>1),
|
||||
'd.date_debut'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1),
|
||||
'd.date_fin'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1),
|
||||
'd.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
|
||||
@ -248,7 +248,8 @@ if ($search_status != '' && $search_status >= 0)
|
||||
else $sql.=" AND d.fk_statut = ".$search_status;
|
||||
}
|
||||
// RESTRICT RIGHTS
|
||||
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous))
|
||||
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
|
||||
&& empty($user->rights->expensereport->writeall_advance))
|
||||
{
|
||||
$childids = $user->getAllChildIds();
|
||||
$childids[]=$user->id;
|
||||
@ -354,7 +355,7 @@ if ($resql)
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.ref","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['user']['checked'])) print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['user']['checked'])) print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"u.lastname","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.date_debut']['checked'])) print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"d.date_debut","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.date_fin']['checked'])) print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"d.date_fin","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.total_ht']['checked'])) print_liste_field_titre($langs->trans("TotalHT"),$_SERVER["PHP_SELF"],"d.total_ht","",$param,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.0-alpha');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.0-beta');
|
||||
|
||||
if (! defined('EURO')) define('EURO',chr(128));
|
||||
|
||||
|
||||
@ -52,7 +52,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
?>
|
||||
|
||||
@ -2623,7 +2623,7 @@ else
|
||||
// Modify a validated invoice with no payments
|
||||
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a></div>';
|
||||
}
|
||||
|
||||
// Reopen a standard paid invoice
|
||||
@ -2631,11 +2631,11 @@ else
|
||||
{
|
||||
if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<span class="butActionRefused" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ReOpen').'</span>';
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ReOpen').'</span></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -2644,26 +2644,52 @@ else
|
||||
{
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a></div>';
|
||||
}
|
||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||
else print '<div class="inline-block divButAction"><span class="butActionRefused">'.$langs->trans('SendByMail').'</a></div>';
|
||||
}
|
||||
|
||||
// Make payments
|
||||
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
|
||||
if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
|
||||
{
|
||||
print '<a class="butAction" href="paiement.php?facid='.$object->id.'&action=create'.($object->fk_account>0?'&accountid='.$object->fk_account:'').'">'.$langs->trans('DoPayment').'</a>'; // must use facid because id is for payment id not invoice
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?facid='.$object->id.'&action=create'.($object->fk_account>0?'&accountid='.$object->fk_account:'').'">'.$langs->trans('DoPayment').'</a></div>'; // must use facid because id is for payment id not invoice
|
||||
}
|
||||
|
||||
// Classify paid
|
||||
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=paid"';
|
||||
print '>'.$langs->trans('ClassifyPaid').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=paid"';
|
||||
print '>'.$langs->trans('ClassifyPaid').'</a></div>';
|
||||
|
||||
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a>';
|
||||
}
|
||||
|
||||
// Reverse back money or convert to reduction
|
||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT) {
|
||||
// For credit note only
|
||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0)
|
||||
{
|
||||
if ($resteapayer == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.$langs->trans("DisabledBecauseRemainderToPayIsZero").'">'.$langs->trans('DoPaymentBack').'</span></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?facid='.$object->id.'&action=create&accountid='.$object->fk_account.'">'.$langs->trans('DoPaymentBack').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// For credit note
|
||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() == 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>';
|
||||
}
|
||||
// For deposit invoice
|
||||
if ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->paye == 1 && $resteapayer == 0 && $user->rights->fournisseur->facture->creer && empty($discount->id))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Validate
|
||||
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT)
|
||||
{
|
||||
@ -2672,13 +2698,13 @@ else
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid"';
|
||||
print '>'.$langs->trans('Validate').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid"';
|
||||
print '>'.$langs->trans('Validate').'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"';
|
||||
print '>'.$langs->trans('Validate').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"';
|
||||
print '>'.$langs->trans('Validate').'</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2692,7 +2718,7 @@ else
|
||||
// Clone
|
||||
if ($action != 'edit' && $user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&socid='.$object->socid.'">'.$langs->trans('ToClone').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&socid='.$object->socid.'">'.$langs->trans('ToClone').'</a></div>';
|
||||
}
|
||||
|
||||
// Create a credit note
|
||||
@ -2710,7 +2736,7 @@ else
|
||||
if ($object->getSommePaiement()) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecausePayments") . '">' . $langs->trans('Delete') . '</a></div>';
|
||||
} else {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a></div>';
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
@ -47,13 +47,23 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td align="center"><?php echo dol_print_date($objectlink->date,'day'); ?></td>
|
||||
<td align="right"><?php
|
||||
if ($user->rights->fournisseur->facture->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
$sign = 1;
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
|
||||
if ($objectlink->statut != 3) // If not abandonned
|
||||
{
|
||||
$total = $total + $sign * $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
} ?></td>
|
||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
?>
|
||||
|
||||
@ -505,7 +505,7 @@ class CommentParser
|
||||
$data = explode('|', $data);
|
||||
$r['type'] = count($data) == 1 ? $data[0] : $data;
|
||||
}
|
||||
if (isset($r['type']) && Text::endsWith($r['type'], '[]')) {
|
||||
if (isset($r['type']) && is_string($r['type']) && Text::endsWith($r['type'], '[]')) {
|
||||
$r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2);
|
||||
$r['type'] = 'array';
|
||||
}
|
||||
|
||||
@ -25,8 +25,8 @@
|
||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||
|
||||
-- after changing const name, please insure that old constant was rename
|
||||
UPDATE llx_const SET name = 'THIRDPARTY_DEFAULT_CREATE_CONTACT' WHERE name='MAIN_THIRPARTY_CREATION_INDIVIDUAL' -- under 3.9.0
|
||||
UPDATE llx_const SET name = 'THIRDPARTY_DEFAULT_CREATE_CONTACT' WHERE name='MAIN_THIRDPARTY_CREATION_INDIVIDUAL' -- under 4.0.1
|
||||
UPDATE llx_const SET name = __ENCRYPT('THIRDPARTY_DEFAULT_CREATE_CONTACT')__ WHERE name = __ENCRYPT('MAIN_THIRPARTY_CREATION_INDIVIDUAL')__; -- under 3.9.0
|
||||
UPDATE llx_const SET name = __ENCRYPT('THIRDPARTY_DEFAULT_CREATE_CONTACT')__ WHERE name = __ENCRYPT('MAIN_THIRDPARTY_CREATION_INDIVIDUAL')__; -- under 4.0.1
|
||||
|
||||
-- VPGSQL8.2 ALTER TABLE llx_product_lot ALTER COLUMN entity SET DEFAULT 1;
|
||||
ALTER TABLE llx_product_lot MODIFY COLUMN entity integer DEFAULT 1;
|
||||
@ -48,6 +48,9 @@ ALTER TABLE llx_don ADD COLUMN date_valid datetime;
|
||||
|
||||
DELETE FROM llx_menu where module='expensereport';
|
||||
|
||||
ALTER TABLE llx_facturedet ADD COLUMN fk_user_author integer after fk_unit;
|
||||
ALTER TABLE llx_facturedet ADD COLUMN fk_user_modif integer after fk_unit;
|
||||
|
||||
ALTER TABLE llx_user DROP COLUMN phenix_login;
|
||||
ALTER TABLE llx_user DROP COLUMN phenix_pass;
|
||||
ALTER TABLE llx_user ADD COLUMN dateemployment datetime;
|
||||
@ -108,8 +111,10 @@ ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafield
|
||||
ALTER TABLE llx_cotisation RENAME TO llx_subscription;
|
||||
ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh);
|
||||
ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real;
|
||||
ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT 'yes';
|
||||
|
||||
ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT '1';
|
||||
|
||||
UPDATE llx_adherent_type SET subscription = '1' WHERE subscription = 'yes';
|
||||
|
||||
CREATE TABLE llx_product_lot_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
@ -171,7 +176,7 @@ create table llx_resource_extrafields
|
||||
|
||||
ALTER TABLE llx_resource_extrafields ADD INDEX idx_resource_extrafields (fk_object);
|
||||
|
||||
INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Max length for small lists (tabs)',0);
|
||||
INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('MAIN_SIZE_SHORTLIST_LIMIT')__,__ENCRYPT('3')__,'chaine','Max length for small lists (tabs)',0);
|
||||
|
||||
|
||||
ALTER TABLE llx_bank_account ADD COLUMN note_public text;
|
||||
@ -180,6 +185,8 @@ ALTER TABLE llx_bank_account ADD COLUMN import_key varchar(14);
|
||||
|
||||
ALTER TABLE llx_overwrite_trans ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
|
||||
|
||||
ALTER TABLE llx_mailing_cibles ADD COLUMN error_text varchar(255);
|
||||
|
||||
|
||||
create table llx_user_employment
|
||||
(
|
||||
@ -201,4 +208,15 @@ create table llx_user_employment
|
||||
dateemploymentend date -- last and current value stored into llx_user
|
||||
)ENGINE=innodb;
|
||||
|
||||
|
||||
-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate.
|
||||
drop table tmp_links_double;
|
||||
--select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2;
|
||||
create table tmp_links_double as (select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2);
|
||||
--select * from tmp_links_double;
|
||||
delete from llx_links where (rowid, label) in (select max_rowid, label from tmp_links_double); --update to avoid duplicate, delete to delete
|
||||
drop table tmp_links_double;
|
||||
|
||||
ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label);
|
||||
|
||||
ALTER TABLE llx_c_actioncomm MODIFY COLUMN type varchar(50) DEFAULT 'system' NOT NULL;
|
||||
|
||||
@ -176,6 +176,7 @@ update llx_opensurvey_sondage set format = 'D' where format = 'D+';
|
||||
update llx_opensurvey_sondage set format = 'A' where format = 'A+';
|
||||
update llx_opensurvey_sondage set tms = now();
|
||||
|
||||
|
||||
-- ALTER TABLE llx_facture_fourn ALTER COLUMN fk_cond_reglement DROP NOT NULL;
|
||||
|
||||
|
||||
@ -183,12 +184,21 @@ update llx_product set barcode = null where barcode in ('', '-1', '0');
|
||||
update llx_societe set barcode = null where barcode in ('', '-1', '0');
|
||||
|
||||
|
||||
-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate.
|
||||
drop table tmp_links_double;
|
||||
--select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2;
|
||||
create table tmp_links_double as (select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2);
|
||||
--select * from tmp_links_double;
|
||||
delete from llx_links where (rowid, label) in (select max_rowid, label from tmp_links_double); --update to avoid duplicate, delete to delete
|
||||
drop table tmp_links_double;
|
||||
|
||||
|
||||
-- Sequence to removed duplicated values of barcode in llx_product. Use serveral times if you still have duplicate.
|
||||
drop table tmp_product_double;
|
||||
--select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_product where barcode is not null group by barcode having count(rowid) >= 2;
|
||||
create table tmp_product_double as (select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_product where barcode is not null group by barcode having count(rowid) >= 2);
|
||||
--select * from tmp_product_double;
|
||||
update llx_product set barcode = null where (rowid, barcode) in (select max_rowid, barcode from tmp_product_double);
|
||||
update llx_product set barcode = null where (rowid, barcode) in (select max_rowid, barcode from tmp_product_double); --update to avoid duplicate, delete to delete
|
||||
drop table tmp_product_double;
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,8 @@ CREATE TABLE llx_expensereport (
|
||||
ref_ext integer,
|
||||
total_ht double(24,8) DEFAULT 0,
|
||||
total_tva double(24,8) DEFAULT 0,
|
||||
localtax1 double(24,8) DEFAULT 0, -- amount total localtax1
|
||||
localtax2 double(24,8) DEFAULT 0, -- amount total localtax2
|
||||
localtax1 double(24,8) DEFAULT 0, -- amount total localtax1
|
||||
localtax2 double(24,8) DEFAULT 0, -- amount total localtax2
|
||||
total_ttc double(24,8) DEFAULT 0,
|
||||
date_debut date NOT NULL,
|
||||
date_fin date NOT NULL,
|
||||
@ -42,14 +42,14 @@ CREATE TABLE llx_expensereport (
|
||||
fk_user_approve integer DEFAULT NULL,
|
||||
fk_user_refuse integer DEFAULT NULL,
|
||||
fk_user_cancel integer DEFAULT NULL,
|
||||
fk_statut integer NOT NULL, -- 1=brouillon, 2=validated (waiting approval), 4=canceled, 5=approved, 6=payed, 99=refused
|
||||
fk_c_paiement integer DEFAULT NULL, -- deprecated
|
||||
paid smallint default 0 NOT NULL, -- deprecated
|
||||
fk_statut integer NOT NULL, -- 1=brouillon, 2=validated (waiting approval), 4=canceled, 5=approved, 6=payed, 99=refused
|
||||
fk_c_paiement integer DEFAULT NULL, -- deprecated
|
||||
paid smallint default 0 NOT NULL, -- deprecated
|
||||
note_public text,
|
||||
note_private text,
|
||||
detail_refuse varchar(255) DEFAULT NULL,
|
||||
detail_cancel varchar(255) DEFAULT NULL,
|
||||
integration_compta integer DEFAULT NULL, -- not used
|
||||
integration_compta integer DEFAULT NULL, -- not used
|
||||
fk_bank_account integer DEFAULT NULL,
|
||||
model_pdf varchar(50) DEFAULT NULL,
|
||||
|
||||
@ -61,6 +61,6 @@ CREATE TABLE llx_expensereport (
|
||||
multicurrency_total_ttc double(24,8) DEFAULT 0,
|
||||
|
||||
import_key varchar(14),
|
||||
extraparams varchar(255) -- for other parameters with json format
|
||||
extraparams varchar(255) -- for other parameters with json format
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
@ -65,6 +65,8 @@ create table llx_facturedet
|
||||
situation_percent real, -- % progression of lines invoicing
|
||||
fk_prev_id integer, -- id of the line in the previous situation,
|
||||
fk_unit integer DEFAULT NULL, -- id of the unit code¡
|
||||
fk_user_author integer, -- user making creation
|
||||
fk_user_modif integer, -- user making last change
|
||||
|
||||
fk_multicurrency integer,
|
||||
multicurrency_code varchar(255),
|
||||
|
||||
22
htdocs/install/mysql/tables/llx_links.key.sql
Normal file
22
htdocs/install/mysql/tables/llx_links.key.sql
Normal file
@ -0,0 +1,22 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
--
|
||||
-- Linked files
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2009-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2009-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2011-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
@ -33,6 +33,6 @@ create table llx_mailing_cibles
|
||||
source_url varchar(160),
|
||||
source_id integer,
|
||||
source_type varchar(16),
|
||||
date_envoi datetime
|
||||
|
||||
date_envoi datetime,
|
||||
error_text varchar(255) -- text with error if statut is -1
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -1566,7 +1566,7 @@ HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over
|
||||
HighlightLinesColor=Highlight color of the line when the mouse passes over (keep empty for no highlight)
|
||||
TextTitleColor=Color of page title
|
||||
LinkColor=Color of links
|
||||
PressF5AfterChangingThis=Press F5 on keyboard after changing this value to have it effective
|
||||
PressF5AfterChangingThis=Press F5 on keyboard or clear your browser cache after changing this value to have it effective
|
||||
NotSupportedByAllThemes=Will works with core themes, may not be supported by external themes
|
||||
BackgroundColor=Background color
|
||||
TopMenuBackgroundColor=Background color for Top menu
|
||||
@ -1626,13 +1626,13 @@ AddOtherPagesOrServices=Add other pages or services
|
||||
AddModels=Add document or numbering templates
|
||||
AddSubstitutions=Add keys substitutions
|
||||
DetectionNotPossible=Detection not possible
|
||||
UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and will be checked on each future access)
|
||||
UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and must be provided on each API call)
|
||||
ListOfAvailableAPIs=List of available APIs
|
||||
activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is missing, so module "%1$s" may not work correclty. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise
|
||||
CommandIsNotInsideAllowedCommands=The command you try to run is not inside list of allowed commands defined into parameter <strong>$dolibarr_main_restrict_os_commands</strong> into <strong>conf.php</strong> file.
|
||||
LandingPage=Landing page
|
||||
SamePriceAlsoForSharedCompanies=If you use a multicompany module, with the choice "Single price", price will be also the same for all companies if products are shared between environments
|
||||
ModuleEnabledAdminMustCheckRights=Module has been activated. Permissions for activated module(s) were given to admin users only. You may need to grant permissions to other users manually if necessary.
|
||||
ModuleEnabledAdminMustCheckRights=Module has been activated. Permissions for activated module(s) were given to admin users only. You may need to grant permissions to other users or groups manually if necessary.
|
||||
UserHasNoPermissions=This user has no permission defined
|
||||
TypeCdr=Use "None" if the date of payment term is date of invoice plus a delta in days (delta is field "Nb of days")<br>Use "At end of month", if, after delta, the date must be increased to reach the end of month (+ an optional "Offset" in days)<br>Use "Current/Next" to have payment term date being the first Nth of the month (N is stored into field "Nb of days")
|
||||
##### Resource ####
|
||||
|
||||
@ -75,6 +75,7 @@ PaymentsAlreadyDone=Payments already done
|
||||
PaymentsBackAlreadyDone=Payments back already done
|
||||
PaymentRule=Payment rule
|
||||
PaymentMode=Payment type
|
||||
PaymentTypeDC=Debit/Credit Card
|
||||
IdPaymentMode=Payment type (id)
|
||||
LabelPaymentMode=Payment type (label)
|
||||
PaymentModeShort=Payment type
|
||||
@ -330,6 +331,7 @@ GeneratedFromRecurringInvoice=Generated from template recurring invoice %s
|
||||
DateIsNotEnough=Date not reached yet
|
||||
InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s
|
||||
# PaymentConditions
|
||||
Statut=Status
|
||||
PaymentConditionShortRECEP=Immediate
|
||||
PaymentConditionRECEP=Immediate
|
||||
PaymentConditionShort30D=30 days
|
||||
@ -446,6 +448,7 @@ PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice templat
|
||||
TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
|
||||
MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for deposit invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
|
||||
TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module.
|
||||
CactusNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for deposit invoices where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
|
||||
##### Types de contacts #####
|
||||
TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice
|
||||
TypeContact_facture_external_BILLING=Customer invoice contact
|
||||
@ -484,4 +487,4 @@ ToCreateARecurringInvoiceGeneAuto=If you need to have such invoices generated au
|
||||
DeleteRepeatableInvoice=Delete template invoice
|
||||
ConfirmDeleteRepeatableInvoice=Are your sure you want to delete the template invoice?
|
||||
CreateOneBillByThird=Create one invoice per third (otherwise, one invoice per order)
|
||||
BillCreated=%s bill(s) created
|
||||
BillCreated=%s bill(s) created
|
||||
|
||||
@ -28,7 +28,7 @@ ShowCustomer=Show customer
|
||||
ShowProspect=Show prospect
|
||||
ListOfProspects=List of prospects
|
||||
ListOfCustomers=List of customers
|
||||
LastDoneTasks=Latest %s completed tasks
|
||||
LastDoneTasks=Latest %s completed actions
|
||||
LastActionsToDo=Oldest %s not completed actions
|
||||
DoneAndToDoActions=Completed and To do events
|
||||
DoneActions=Completed events
|
||||
|
||||
@ -50,7 +50,6 @@ NbOfEMails=Nb of EMails
|
||||
TotalNbOfDistinctRecipients=Number of distinct recipients
|
||||
NoTargetYet=No recipients defined yet (Go on tab 'Recipients')
|
||||
RemoveRecipient=Remove recipient
|
||||
CommonSubstitutions=Common substitutions
|
||||
YouCanAddYourOwnPredefindedListHere=To create your email selector module, see htdocs/core/modules/mailings/README.
|
||||
EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions variables are replaced by generic values
|
||||
MailingAddFile=Attach this file
|
||||
|
||||
@ -13,7 +13,7 @@ ListOfValidatedPublicMembers=List of validated public members
|
||||
ErrorThisMemberIsNotPublic=This member is not public
|
||||
ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: <b>%s</b>, login: <b>%s</b>) is already linked to a third party <b>%s</b>. Remove this link first because a third party can't be linked to only a member (and vice versa).
|
||||
ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours.
|
||||
ThisIsContentOfYourCard=This is details of your card
|
||||
ThisIsContentOfYourCard=Hi.<br><br>This is a remind of the information we get about you. Feel free to contact us if something looks wrong.<br><br>
|
||||
CardContent=Content of your member card
|
||||
SetLinkToUser=Link to a Dolibarr user
|
||||
SetLinkToThirdParty=Link to a Dolibarr third party
|
||||
|
||||
@ -89,7 +89,7 @@ NoteNotVisibleOnBill=Note (not visible on invoices, proposals...)
|
||||
ServiceLimitedDuration=If product is a service with limited duration:
|
||||
MultiPricesAbility=Several segment of prices per product/service (each customer is in one segment)
|
||||
MultiPricesNumPrices=Number of prices
|
||||
AssociatedProductsAbility=Activate the package feature
|
||||
AssociatedProductsAbility=Activate the feature to manage virtual products
|
||||
AssociatedProducts=Virtual product
|
||||
AssociatedProductsNumber=Number of products composing this virtual product
|
||||
ParentProductsNumber=Number of parent packaging product
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# Dolibarr language file - Source file is en_US - trips
|
||||
ExpenseReport=Expense report
|
||||
ExpenseReports=Expense reports
|
||||
ShowExpenseReport=Show expense report
|
||||
Trips=Expense reports
|
||||
TripsAndExpenses=Expenses reports
|
||||
TripsAndExpensesStatistics=Expense reports statistics
|
||||
|
||||
@ -8,7 +8,7 @@ EditPassword=Edit password
|
||||
SendNewPassword=Regenerate and send password
|
||||
ReinitPassword=Regenerate password
|
||||
PasswordChangedTo=Password changed to: %s
|
||||
SubjectNewPassword=Your new password for Dolibarr
|
||||
SubjectNewPassword=Your new password for %s
|
||||
GroupRights=Group permissions
|
||||
UserRights=User permissions
|
||||
UserGUISetup=User display setup
|
||||
|
||||
@ -173,6 +173,12 @@ ProfId3FR=Id. prof. 3 (NAF-APE)
|
||||
ProfId4FR=Id. prof. 4 (RCS/RM)
|
||||
ProfId5FR=-
|
||||
ProfId6FR=-
|
||||
ProfId1GA=Id. prof. 1 (NIF)
|
||||
ProfId2GA=Id. prof. 2 (RCCM)
|
||||
ProfId3GA=Id. prof. 3 (CAE)
|
||||
ProfId4GA=Id. prof. 4
|
||||
ProfId5GA=-
|
||||
ProfId6GA=-
|
||||
ProfId1GB=Numéro d'enregistrement
|
||||
ProfId2GB=-
|
||||
ProfId3GB=SIC
|
||||
|
||||
@ -1748,8 +1748,11 @@ $formquestionclone=array(
|
||||
array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24),
|
||||
array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1),
|
||||
array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1)
|
||||
);
|
||||
if (! empty($conf->global->PRODUIT_SOUSPRODUITS))
|
||||
{
|
||||
$formquestionclone[]=array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1);
|
||||
}
|
||||
|
||||
// Confirm delete product
|
||||
if (($action == 'delete' && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js
|
||||
|
||||
@ -1986,6 +1986,30 @@ class Product extends CommonObject
|
||||
$this->stats_commande['nb']=$obj->nb;
|
||||
$this->stats_commande['rows']=$obj->nb_rows;
|
||||
$this->stats_commande['qty']=$obj->qty?$obj->qty:0;
|
||||
|
||||
// if it's a virtual product, maybe it is in order by extension
|
||||
if (! empty($conf->global->ORDER_ADD_ORDERS_WITH_PARENT_PROD_IF_INCDEC))
|
||||
{
|
||||
$TFather = $this->getFather();
|
||||
if (is_array($TFather) && !empty($TFather)) {
|
||||
foreach($TFather as &$fatherData) {
|
||||
$pFather = new Product($this->db);
|
||||
$pFather->id = $fatherData['id'];
|
||||
$qtyCoef = $fatherData['qty'];
|
||||
|
||||
if ($fatherData['incdec']) {
|
||||
$pFather->load_stats_commande($socid, $filtrestatut);
|
||||
|
||||
$this->stats_commande['customers']+=$pFather->stats_commande['customers'];
|
||||
$this->stats_commande['nb']+=$pFather->stats_commande['nb'];
|
||||
$this->stats_commande['rows']+=$pFather->stats_commande['rows'];
|
||||
$this->stats_commande['qty']+=$pFather->stats_commande['qty'] * $qtyCoef;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -2822,17 +2846,17 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Clone links between products
|
||||
*
|
||||
* @param int $fromId Product id
|
||||
* @param int $toId Product id
|
||||
* @return number
|
||||
* @param int $fromId Product id
|
||||
* @param int $toId Product id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function clone_associations($fromId, $toId)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association (rowid, fk_product_pere, fk_product_fils, qty)';
|
||||
$sql.= " SELECT null, $toId, fk_product_fils, qty FROM ".MAIN_DB_PREFIX."product_association";
|
||||
$sql.= " WHERE fk_product_pere = '".$fromId."'";
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association (fk_product_pere, fk_product_fils, qty)';
|
||||
$sql.= " SELECT ".$toId.", fk_product_fils, qty FROM ".MAIN_DB_PREFIX."product_association";
|
||||
$sql.= " WHERE fk_product_pere = ".$fromId;
|
||||
|
||||
dol_syslog(get_class($this).'::clone_association', LOG_DEBUG);
|
||||
if (! $this->db->query($sql))
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
print '<td colspan="2">';
|
||||
print '<input type="text" name="label" size="60" value="'.$valformovementlabel.'">';
|
||||
print '</td>';
|
||||
print '<td width="20%">'.$langs->trans("InventoryCode").'</td><td width="20%"><input class="flat" name="inventorycode" id="inventorycode" size="14" value="'.GETPOST("inventorycode").'"></td>';
|
||||
print '<td width="20%">'.$langs->trans("InventoryCode").'</td><td width="20%"><input class="flat maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.GETPOST("inventorycode").'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -117,7 +117,7 @@
|
||||
print '<td colspan="3">';
|
||||
print '<input type="text" name="label" size="60" value="'.dol_escape_htmltag($valformovementlabel).'">';
|
||||
print '</td>';
|
||||
print '<td width="20%">'.$langs->trans("InventoryCode").'</td><td width="20%"><input class="flat" name="inventorycode" id="inventorycode" size="14" value="'.(GETPOST("inventorycode")?GETPOST("inventorycode",'alpha'):dol_print_date(dol_now(),'%y%m%d%H%M%S')).'"></td>';
|
||||
print '<td width="20%">'.$langs->trans("InventoryCode").'</td><td width="20%"><input class="flat maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(GETPOST("inventorycode")?GETPOST("inventorycode",'alpha'):dol_print_date(dol_now(),'%y%m%d%H%M%S')).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -698,7 +698,7 @@ else
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
print '<td><input size="80" name="title" value="'.$object->title.'"></td></tr>';
|
||||
print '<td><input class="quatrevingtpercent" name="title" value="'.$object->title.'"></td></tr>';
|
||||
|
||||
// Thirdparty
|
||||
if ($conf->societe->enabled)
|
||||
@ -752,7 +752,7 @@ else
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print $form->select_date($object->date_start?$object->date_start:-1,'projectstart',0,0,0,'',1,0,1);
|
||||
print ' <input type="checkbox" name="reportdate" value="yes" ';
|
||||
print ' <input type="checkbox" class="valignmiddle" name="reportdate" value="yes" ';
|
||||
if ($comefromclone){print ' checked ';}
|
||||
print '/> '. $langs->trans("ProjectReportDate");
|
||||
print '</td></tr>';
|
||||
@ -829,33 +829,12 @@ else
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
/*
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
// Label
|
||||
//print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->title.'</td></tr>';
|
||||
|
||||
// Third party
|
||||
/*
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project');
|
||||
else print' ';
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) print $langs->trans('SharedProject');
|
||||
else print $langs->trans('PrivateProject');
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
//print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
// Opportunity status
|
||||
@ -879,7 +858,11 @@ else
|
||||
print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
|
||||
print dol_print_date($object->date_start,'day');
|
||||
$end=dol_print_date($object->date_end,'day');
|
||||
if ($end) print ' - '.$end;
|
||||
if ($end)
|
||||
{
|
||||
print ' - '.$end;
|
||||
if ($object->hasDelay()) print img_warning($langs->trans('Late'));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
|
||||
568
htdocs/projet/class/api_projects.class.php
Normal file
568
htdocs/projet/class/api_projects.class.php
Normal file
@ -0,0 +1,568 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Luracast\Restler\RestException;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
/**
|
||||
* API class for projects
|
||||
*
|
||||
* @access protected
|
||||
* @class DolibarrApiAccess {@requires user,external}
|
||||
*/
|
||||
class Projects extends DolibarrApi
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||
*/
|
||||
static $FIELDS = array(
|
||||
'ref',
|
||||
'title'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var Project $project {@type Project}
|
||||
*/
|
||||
public $project;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
global $db, $conf;
|
||||
$this->db = $db;
|
||||
$this->project = new Project($this->db);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get properties of a project object
|
||||
*
|
||||
* Return an array with project informations
|
||||
*
|
||||
* @param int $id ID of project
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function get($id)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$this->project->fetchObjectLinked();
|
||||
return $this->_cleanObjectDatas($this->project);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List projects
|
||||
*
|
||||
* Get a list of projects
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter projects of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of project objects
|
||||
*/
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
// case of external user, $thirdpartyid param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id;
|
||||
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as t";
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('project', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
|
||||
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
|
||||
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
{
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql.= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
dol_syslog("API Rest request");
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
while ($i < min($num, ($limit <= 0 ? $num : $limit)))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$project_static = new Project($db);
|
||||
if($project_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = parent::_cleanObjectDatas($project_static);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new RestException(503, 'Error when retrieve project list');
|
||||
}
|
||||
if( ! count($obj_ret)) {
|
||||
throw new RestException(404, 'No project found');
|
||||
}
|
||||
return $obj_ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create project object
|
||||
*
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of project
|
||||
*/
|
||||
function post($request_data = NULL)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
}
|
||||
// Check mandatory fields
|
||||
$result = $this->_validate($request_data);
|
||||
|
||||
foreach($request_data as $field => $value) {
|
||||
$this->project->$field = $value;
|
||||
}
|
||||
/*if (isset($request_data["lines"])) {
|
||||
$lines = array();
|
||||
foreach ($request_data["lines"] as $line) {
|
||||
array_push($lines, (object) $line);
|
||||
}
|
||||
$this->project->lines = $lines;
|
||||
}*/
|
||||
if ($this->project->create(DolibarrApiAccess::$user) <= 0) {
|
||||
$errormsg = $this->project->error;
|
||||
throw new RestException(500, $errormsg ? $errormsg : "Error while creating project");
|
||||
}
|
||||
|
||||
return $this->project->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tasks of a project
|
||||
*
|
||||
* @param int $id Id of project
|
||||
*
|
||||
* @url GET {id}/tasks
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getLines($id) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$this->project->getLinesArray(DolibarrApiAccess::$user);
|
||||
$result = array();
|
||||
foreach ($this->project->lines as $line) {
|
||||
array_push($result,$this->_cleanObjectDatas($line));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get users and roles assigned to a project
|
||||
*
|
||||
* @param int $id Id of project
|
||||
*
|
||||
* @url GET {id}/roles
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getRoles($id) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
$taskstatic=new Task($this->db);
|
||||
$this->project->roles = $taskstatic->getUserRolesForProjectsOrTasks(DolibarrApiAccess::$user, 0, $id, 0);
|
||||
$result = array();
|
||||
foreach ($this->project->roles as $line) {
|
||||
array_push($result,$this->_cleanObjectDatas($line));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a task to given project
|
||||
*
|
||||
* @param int $id Id of project to update
|
||||
* @param array $request_data Projectline data
|
||||
*
|
||||
* @url POST {id}/tasks
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function postLine($id, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$request_data = (object) $request_data;
|
||||
$updateRes = $this->project->addline(
|
||||
$request_data->desc,
|
||||
$request_data->subprice,
|
||||
$request_data->qty,
|
||||
$request_data->tva_tx,
|
||||
$request_data->localtax1_tx,
|
||||
$request_data->localtax2_tx,
|
||||
$request_data->fk_product,
|
||||
$request_data->remise_percent,
|
||||
$request_data->info_bits,
|
||||
$request_data->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$request_data->date_start,
|
||||
$request_data->date_end,
|
||||
$request_data->product_type,
|
||||
$request_data->rang,
|
||||
$request_data->special_code,
|
||||
$fk_parent_line,
|
||||
$request_data->fk_fournprice,
|
||||
$request_data->pa_ht,
|
||||
$request_data->label,
|
||||
$request_data->array_options,
|
||||
$request_data->fk_unit,
|
||||
$this->element,
|
||||
$request_data->id
|
||||
);
|
||||
|
||||
if ($updateRes > 0) {
|
||||
return $this->get($id)->line->rowid;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Update a task to given project
|
||||
*
|
||||
* @param int $id Id of project to update
|
||||
* @param int $lineid Id of line to update
|
||||
* @param array $request_data Projectline data
|
||||
*
|
||||
* @url PUT {id}/tasks/{lineid}
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
/*
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$request_data = (object) $request_data;
|
||||
$updateRes = $this->project->updateline(
|
||||
$lineid,
|
||||
$request_data->desc,
|
||||
$request_data->subprice,
|
||||
$request_data->qty,
|
||||
$request_data->remise_percent,
|
||||
$request_data->tva_tx,
|
||||
$request_data->localtax1_tx,
|
||||
$request_data->localtax2_tx,
|
||||
'HT',
|
||||
$request_data->info_bits,
|
||||
$request_data->date_start,
|
||||
$request_data->date_end,
|
||||
$request_data->product_type,
|
||||
$request_data->fk_parent_line,
|
||||
0,
|
||||
$request_data->fk_fournprice,
|
||||
$request_data->pa_ht,
|
||||
$request_data->label,
|
||||
$request_data->special_code,
|
||||
$request_data->array_options,
|
||||
$request_data->fk_unit
|
||||
);
|
||||
|
||||
if ($updateRes > 0) {
|
||||
$result = $this->get($id);
|
||||
unset($result->line);
|
||||
return $this->_cleanObjectDatas($result);
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
|
||||
|
||||
/**
|
||||
* Delete a tasks of given project
|
||||
*
|
||||
*
|
||||
* @param int $id Id of project to update
|
||||
* @param int $taskid Id of task to delete
|
||||
*
|
||||
* @url DELETE {id}/tasks/{taskid}
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function delLine($id, $taskid) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! ($result > 0) ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
$taskstatic=new Task($this->db);
|
||||
$result = $taskstatic->fetch($taskid);
|
||||
if( ! ($result > 0) ) {
|
||||
throw new RestException(404, 'Task not found');
|
||||
}
|
||||
|
||||
$deleteRes = $taskstatic->delete(DolibarrApiAccess::$user);
|
||||
|
||||
if( ! ($deleteRes > 0)) {
|
||||
throw new RestException(500, 'Error when delete tasks : '.$taskstatic->error);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Task deleted'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update project general fields (won't touch lines of project)
|
||||
*
|
||||
* @param int $id Id of project to update
|
||||
* @param array $request_data Datas
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
foreach($request_data as $field => $value) {
|
||||
$this->project->$field = $value;
|
||||
}
|
||||
|
||||
if($this->project->update(DolibarrApiAccess::$user, 0))
|
||||
return $this->get($id);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete project
|
||||
*
|
||||
* @param int $id Project ID
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function delete($id)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->projet->supprimer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
if( ! $this->project->delete(DolibarrApiAccess::$user)) {
|
||||
throw new RestException(500, 'Error when delete project : '.$this->project->error);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Project deleted'
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a project
|
||||
*
|
||||
* @param int $id Project ID
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
*
|
||||
* @url POST {id}/validate
|
||||
*
|
||||
* @return array
|
||||
* FIXME An error 403 is returned if the request has an empty body.
|
||||
* Error message: "Forbidden: Content type `text/plain` is not supported."
|
||||
* Workaround: send this in the body
|
||||
* {
|
||||
* "notrigger": 0
|
||||
* }
|
||||
*/
|
||||
function validate($id, $notrigger=0)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
$result = $this->project->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Project not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->project->setValid(DolibarrApiAccess::$user, $notrigger);
|
||||
if ($result == 0) {
|
||||
throw new RestException(500, 'Error nothing done. May be object is already validated');
|
||||
}
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when validating Project: '.$this->project->error);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Project validated'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate fields before create or update object
|
||||
*
|
||||
* @param array $data Array with data to verify
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*/
|
||||
function _validate($data)
|
||||
{
|
||||
$object = array();
|
||||
foreach (self::$FIELDS as $field) {
|
||||
if (!isset($data[$field]))
|
||||
throw new RestException(400, "$field field missing");
|
||||
$object[$field] = $data[$field];
|
||||
|
||||
}
|
||||
return $object;
|
||||
}
|
||||
|
||||
|
||||
// TODO
|
||||
// getSummaryOfTimeSpent
|
||||
}
|
||||
@ -241,7 +241,15 @@ class Project extends CommonObject
|
||||
$this->description = trim($this->description);
|
||||
if ($this->opp_amount < 0) $this->opp_amount='';
|
||||
if ($this->opp_percent < 0) $this->opp_percent='';
|
||||
|
||||
if ($this->date_end && $this->date_end < $this->date_start)
|
||||
{
|
||||
$this->error = $langs->trans("ErrorDateEndLowerThanDateStart");
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
dol_syslog(get_class($this)."::update error -3 " . $this->error, LOG_ERR);
|
||||
return -3;
|
||||
}
|
||||
|
||||
if (dol_strlen(trim($this->ref)) > 0)
|
||||
{
|
||||
$this->db->begin();
|
||||
@ -695,10 +703,11 @@ class Project extends CommonObject
|
||||
/**
|
||||
* Validate a project
|
||||
*
|
||||
* @param User $user User that validate
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User that validate
|
||||
* @param int $notrigger 1=Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setValid($user)
|
||||
function setValid($user, $notrigger=0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@ -725,10 +734,13 @@ class Project extends CommonObject
|
||||
if ($resql)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PROJECT_VALIDATE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
|
||||
if (empty($notrigger))
|
||||
{
|
||||
$result=$this->call_trigger('PROJECT_VALIDATE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$this->statut=1;
|
||||
@ -1750,12 +1762,12 @@ class Project extends CommonObject
|
||||
global $conf;
|
||||
|
||||
if (! ($this->statut == 1)) return false;
|
||||
if (! $this->datee) return false;
|
||||
if (! $this->datee && ! $this->date_end) return false;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
return $this->datee < ($now - $conf->projet->warning_delay);
|
||||
}
|
||||
return ($this->datee ? $this->datee : $this->date_end) < ($now - $conf->projet->warning_delay);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -1866,5 +1878,20 @@ class Project extends CommonObject
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an array of tasks of current project
|
||||
*
|
||||
* @param User $user Object user we want project allowed to
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function getLinesArray($user)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
$taskstatic = new Task($this->db);
|
||||
|
||||
$this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ class Task extends CommonObject
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param int $ref ref object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
function fetch($id,$ref='')
|
||||
{
|
||||
@ -214,7 +214,9 @@ class Task extends CommonObject
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($resql))
|
||||
$num_rows = $this->db->num_rows($resql);
|
||||
|
||||
if ($num_rows)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
@ -241,7 +243,8 @@ class Task extends CommonObject
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
return 1;
|
||||
if ($num_rows) return 1;
|
||||
else return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -754,7 +757,7 @@ class Task extends CommonObject
|
||||
* Return list of roles for a user for each projects or each tasks (or a particular project or a particular task).
|
||||
*
|
||||
* @param User $userp Return roles on project for this internal user. If set, usert and taskid must not be defined.
|
||||
* @param User $usert Return roles on task for this internal user. If set userp must not be defined.
|
||||
* @param User $usert Return roles on task for this internal user. If set userp must not be defined. -1 means no filter.
|
||||
* @param int $projectid Project id list separated with , to filter on project
|
||||
* @param int $taskid Task id to filter on a task
|
||||
* @param string $filteronprojstatus Filter on project status if userp is set. Not used if userp not defined.
|
||||
|
||||
@ -83,8 +83,8 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')</td><td align="right">'.price($totalamount, 0, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr class="liste_total"><td>';
|
||||
print '<tr class="liste_total"><td class="maxwidth150onsmartphone tdoverflow">'.$langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')</td><td align="right">'.price($totalamount, 0, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr class="liste_total"><td class="minwidth150onsmartphone tdoverflow">';
|
||||
//print $langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')';
|
||||
print $form->textwithpicto($langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')', $langs->trans("OpportunityPonderatedAmountDesc"), 1);
|
||||
print '</td><td align="right">'.price(price2num($ponderated_opp_amount,'MT'), 0, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
@ -140,7 +140,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("OpenedProjectsByThirdparties"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OpenedProjectsByThirdparties"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NbOfProjects"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -626,7 +626,7 @@ while ($i < min($num,$limit))
|
||||
$projectstatic->user_author_id = $obj->fk_user_creat;
|
||||
$projectstatic->public = $obj->public;
|
||||
$projectstatic->ref = $obj->ref;
|
||||
$projectstatic->datee = $obj->date_end;
|
||||
$projectstatic->datee = $db->jdate($obj->date_end);
|
||||
$projectstatic->statut = $obj->fk_statut;
|
||||
$projectstatic->opp_status = $obj->fk_opp_status;
|
||||
|
||||
|
||||
@ -71,7 +71,6 @@ $dol_hide_topmenu=$conf->dol_hide_topmenu;
|
||||
$dol_hide_leftmenu=$conf->dol_hide_leftmenu;
|
||||
$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen;
|
||||
$dol_no_mouse_hover=$conf->dol_no_mouse_hover;
|
||||
$dol_use_jmobile=$conf->dol_use_jmobile;
|
||||
|
||||
|
||||
//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0;
|
||||
@ -221,7 +220,6 @@ print 'dol_hide_topmenu='.$dol_hide_topmenu."\n";
|
||||
print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n";
|
||||
print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n";
|
||||
print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n";
|
||||
print 'dol_use_jmobile='.$dol_use_jmobile."\n";
|
||||
print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n";
|
||||
print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n";
|
||||
print 'fontsize='.$fontsize."\n";
|
||||
@ -261,8 +259,6 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla
|
||||
background-color: #FFF;
|
||||
}
|
||||
|
||||
<?php if (empty($dol_use_jmobile)) { ?>
|
||||
|
||||
input:focus, textarea:focus, button:focus, select:focus {
|
||||
box-shadow: 0 0 4px #8091BF;
|
||||
}
|
||||
@ -306,7 +302,6 @@ span.timesheetalreadyrecorded input {
|
||||
border: none;
|
||||
/*background: transparent;*/
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
select.flat, form.flat select {
|
||||
font-weight: normal;
|
||||
@ -341,9 +336,9 @@ input[type=checkbox] { background-color: transparent; border: none; box-shadow:
|
||||
input[type=radio] { background-color: transparent; border: none; box-shadow: none; }
|
||||
input[type=image] { background-color: transparent; border: none; box-shadow: none; }
|
||||
input:-webkit-autofill {
|
||||
background-color: <?php echo empty($dol_use_jmobile)?'#FBFFEA':'#FFFFFF' ?> !important;
|
||||
background-color: #FBFFEA !important;
|
||||
background-image:none !important;
|
||||
-webkit-box-shadow: 0 0 0 50px <?php echo empty($dol_use_jmobile)?'#FBFFEA':'#FFFFFF' ?> inset;
|
||||
-webkit-box-shadow: 0 0 0 50px #FBFFEA inset;
|
||||
}
|
||||
::-webkit-input-placeholder { color:#ccc; }
|
||||
:-moz-placeholder { color:#bbb; } /* firefox 18- */
|
||||
@ -351,9 +346,6 @@ input:-webkit-autofill {
|
||||
:-ms-input-placeholder { color:#ccc; } /* ie */
|
||||
input:-moz-placeholder { color:#ccc; }
|
||||
|
||||
<?php if (! empty($dol_use_jmobile)) { ?>
|
||||
legend { margin-bottom: 8px; }
|
||||
<?php } ?>
|
||||
fieldset { border: 1px solid #AAAAAA !important; }
|
||||
|
||||
|
||||
@ -542,7 +534,7 @@ div.myavailability {
|
||||
margin-top: 6px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.selectlimit {
|
||||
.selectlimit, .marginrightonly {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.strikefordisabled {
|
||||
@ -622,12 +614,14 @@ div.myavailability {
|
||||
.minwidth500imp { min-width: 500px !important; }
|
||||
}
|
||||
.maxwidth50 { max-width: 50px; }
|
||||
.maxwidth75 { max-width: 75px; }
|
||||
.maxwidth100 { max-width: 100px; }
|
||||
.maxwidth150 { max-width: 150px; }
|
||||
.maxwidth200 { max-width: 200px; }
|
||||
.maxwidth300 { max-width: 300px; }
|
||||
.maxwidth400 { max-width: 400px; }
|
||||
.maxwidth500 { max-width: 500px; }
|
||||
.maxwidth50imp { max-width: 50px !important; }
|
||||
.minheight20 { min-height: 20px; }
|
||||
.minheight40 { min-height: 40px; }
|
||||
.titlefieldcreate { width: 20%; }
|
||||
@ -662,25 +656,40 @@ div.myavailability {
|
||||
/* Force values for small screen 570 */
|
||||
@media only screen and (max-width: 570px)
|
||||
{
|
||||
.tdoverflowonsmartphone {
|
||||
max-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.titre {
|
||||
line-height: 2em;
|
||||
}
|
||||
.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col {
|
||||
height: 40px !important;
|
||||
}
|
||||
|
||||
input[type=text], select, textarea {
|
||||
.quatrevingtpercent, .inputsearch {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
input, input[type=text], input[type=password], select, textarea {
|
||||
min-width: 20px;
|
||||
min-height: 1.4em;
|
||||
line-height: 1.4em;
|
||||
margin: .5em 0;
|
||||
padding: .4em .1em;
|
||||
border: 1px solid #BBB;
|
||||
/* max-width: inherit; why this ? */
|
||||
}
|
||||
|
||||
.hideonsmartphone { display: none; }
|
||||
.noenlargeonsmartphone { width : 50px !important; display: inline !important; }
|
||||
.maxwidthonsmartphone { max-width: 100px; }
|
||||
.maxwidth50onsmartphone { max-width: 50px; }
|
||||
.maxwidth100onsmartphone { max-width: 100px; }
|
||||
.maxwidth150onsmartphone { max-width: 150px; }
|
||||
.maxwidth50onsmartphone { max-width: 40px; }
|
||||
.maxwidth75onsmartphone { max-width: 50px; }
|
||||
.maxwidth100onsmartphone { max-width: 70px; }
|
||||
.maxwidth150onsmartphone { max-width: 120px; }
|
||||
.maxwidth200onsmartphone { max-width: 200px; }
|
||||
.maxwidth300onsmartphone { max-width: 300px; }
|
||||
.maxwidth400onsmartphone { max-width: 400px; }
|
||||
@ -697,11 +706,13 @@ div.myavailability {
|
||||
position: absolute;
|
||||
width: <?php print dol_size(300,'width'); ?>px;
|
||||
}
|
||||
|
||||
/* intput, input[type=text], */
|
||||
select {
|
||||
width: 98%;
|
||||
<?php if (empty($conf->dol_use_jmobile)) { ?>max-width: 100px;<?php } ?>
|
||||
min-width: 40px;
|
||||
}
|
||||
|
||||
div.divphotoref {
|
||||
padding-right: 5px;
|
||||
}
|
||||
@ -833,7 +844,7 @@ div.fiche {
|
||||
margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:($dol_hide_leftmenu?'6':'20')); ?>px;
|
||||
margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->dol_optimize_smallscreen)?'12':'6')); ?>px;
|
||||
<?php if (! empty($conf->dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?>
|
||||
<?php if (! empty($conf->dol_use_jmobile)) print ' margin-bottom: 10px;'."\n"; ?>
|
||||
<?php if (! empty($conf->dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?>
|
||||
}
|
||||
div.fichecenter {
|
||||
width: 100%;
|
||||
@ -1929,10 +1940,7 @@ div.tabs {
|
||||
}
|
||||
div.tabsElem {
|
||||
margin-top: 1px;
|
||||
<?php if (! empty($conf->dol_use_jmobile)) { ?>;
|
||||
margin-bottom: -1px;
|
||||
<?php } ?>
|
||||
} /* To avoid overlap of tabs when not browser */
|
||||
} /* To avoid overlap of tabs when not browser */
|
||||
|
||||
div.tabBar {
|
||||
color: #<?php echo $colortextbacktab; ?>;
|
||||
@ -2357,10 +2365,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord
|
||||
table.borderplus {
|
||||
border: 1px solid #BBB;
|
||||
}
|
||||
.border tbody tr, .border tbody tr td {
|
||||
height: 20px;
|
||||
}
|
||||
div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col {
|
||||
.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col {
|
||||
height: 20px;
|
||||
}
|
||||
div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col {
|
||||
@ -2401,6 +2406,7 @@ td.border, div.tagtable div div.border {
|
||||
width:auto;
|
||||
}
|
||||
|
||||
|
||||
/* Main boxes */
|
||||
|
||||
table.liste, table.noborder, table.formdoc, div.noborder {
|
||||
@ -2413,27 +2419,15 @@ table.liste, table.noborder, table.formdoc, div.noborder {
|
||||
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
|
||||
border-top-style: solid;
|
||||
|
||||
/* border-right-width: 1px;
|
||||
border-right-color: #BBB;
|
||||
border-right-style: solid;
|
||||
|
||||
border-left-width: 1px;
|
||||
border-left-color: #BBB;
|
||||
border-left-style: solid;
|
||||
*/
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-color: #BBB;
|
||||
border-bottom-style: solid;
|
||||
|
||||
margin: 0px 0px 5px 0px;
|
||||
|
||||
/* -moz-box-shadow: 2px 2px 4px #CCC;
|
||||
-webkit-box-shadow: 2px 2px 4px #CCC;
|
||||
box-shadow: 2px 2px 4px #CCC;
|
||||
|
||||
-moz-border-radius: 0.2em;
|
||||
-webkit-border-radius: 0.2em;
|
||||
border-radius: 0.2em;*/
|
||||
}
|
||||
table.paddingtopbottomonly tr td {
|
||||
padding-top: 1px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
.liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd
|
||||
{
|
||||
@ -2490,7 +2484,7 @@ table.listwithfilterbefore {
|
||||
|
||||
/* Pagination */
|
||||
div.refidpadding {
|
||||
padding-top: <?php print ($conf->dol_use_jmobile != 4)?'3':'7'; ?>px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
div.refid {
|
||||
font-weight: bold;
|
||||
@ -2526,10 +2520,8 @@ div.pagination li {
|
||||
display: inline-block;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
<?php if ($conf->dol_use_jmobile != 4) { ?>
|
||||
padding-top: 6px;
|
||||
padding-bottom: 5px;
|
||||
<?php } ?>
|
||||
}
|
||||
.pagination {
|
||||
display: inline-block;
|
||||
@ -2538,22 +2530,12 @@ div.pagination li {
|
||||
}
|
||||
div.pagination li.pagination a,
|
||||
div.pagination li.pagination span {
|
||||
<?php if ($conf->dol_use_jmobile != 4) { ?>
|
||||
padding: 6px 12px;
|
||||
margin-left: -1px;
|
||||
line-height: 1.42857143;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
/*
|
||||
border-color: #ccc;
|
||||
background-color: #f5f5f5;
|
||||
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
||||
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);*/
|
||||
background-repeat: repeat-x;
|
||||
<?php } ?>
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
div.pagination li.pagination span.inactive {
|
||||
cursor: default;
|
||||
@ -2585,13 +2567,6 @@ div.pagination li.litext a:hover {
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
}
|
||||
<?php if ($conf->dol_use_jmobile == 4) { ?>
|
||||
div.pagination li.litext {
|
||||
padding-top: 13px;
|
||||
vertical-align: top;
|
||||
}
|
||||
<?php } ?>
|
||||
<?php if ($conf->dol_use_jmobile != 4) { ?>
|
||||
div.pagination li.noborder a:hover {
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
@ -2651,7 +2626,6 @@ div.pagination .disabled a:focus {
|
||||
background-color: #fff;
|
||||
border-color: #ddd;
|
||||
}
|
||||
<?php } ?>
|
||||
div.pagination li.pagination .active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@ -4230,11 +4204,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i
|
||||
min-width: .4em;
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
<?php if (! empty($dol_use_jmobile)) { ?>
|
||||
font-size: 13px;
|
||||
<?php } else { ?>
|
||||
font-size: <?php print $fontsize ?>px;
|
||||
<?php } ?>
|
||||
/* white-space: normal; */ /* Warning, enable this break the truncate feature */
|
||||
}
|
||||
.ui-btn-icon-right .ui-btn-inner {
|
||||
|
||||
@ -72,7 +72,6 @@ $dol_hide_topmenu=$conf->dol_hide_topmenu;
|
||||
$dol_hide_leftmenu=$conf->dol_hide_leftmenu;
|
||||
$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen;
|
||||
$dol_no_mouse_hover=$conf->dol_no_mouse_hover;
|
||||
$dol_use_jmobile=$conf->dol_use_jmobile;
|
||||
|
||||
|
||||
//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0;
|
||||
@ -221,7 +220,6 @@ print 'dol_hide_topmenu='.$dol_hide_topmenu."\n";
|
||||
print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n";
|
||||
print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n";
|
||||
print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n";
|
||||
print 'dol_use_jmobile='.$dol_use_jmobile."\n";
|
||||
print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n";
|
||||
print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n";
|
||||
print 'fontsize='.$fontsize."\n";
|
||||
@ -261,8 +259,6 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla
|
||||
background-color: #FDFDFD;
|
||||
}
|
||||
|
||||
<?php if (empty($dol_use_jmobile)) { ?>
|
||||
|
||||
input:focus, textarea:focus, button:focus, select:focus {
|
||||
box-shadow: 0 0 4px #8091BF;
|
||||
}
|
||||
@ -308,8 +304,6 @@ span.timesheetalreadyrecorded input {
|
||||
/*background: transparent;*/
|
||||
}
|
||||
|
||||
<?php } ?>
|
||||
|
||||
select.flat, form.flat select {
|
||||
font-weight: normal;
|
||||
}
|
||||
@ -347,9 +341,9 @@ input[type=radio] { background-color: transparent; border: none; box-shadow:
|
||||
input[type=image] { background-color: transparent; border: none; box-shadow: none; }
|
||||
input[type=text] { min-width: 20px; }
|
||||
input:-webkit-autofill {
|
||||
background-color: <?php echo empty($dol_use_jmobile)?'#FBFFEA':'#FFFFFF' ?> !important;
|
||||
background-color: #FBFFEA !important;
|
||||
background-image:none !important;
|
||||
-webkit-box-shadow: 0 0 0 50px <?php echo empty($dol_use_jmobile)?'#FBFFEA':'#FFFFFF' ?> inset;
|
||||
-webkit-box-shadow: 0 0 0 50px #FBFFEA inset;
|
||||
}
|
||||
::-webkit-input-placeholder { color:#ccc; }
|
||||
:-moz-placeholder { color:#bbb; } /* firefox 18- */
|
||||
@ -357,9 +351,6 @@ input:-webkit-autofill {
|
||||
:-ms-input-placeholder { color:#ccc; } /* ie */
|
||||
input:-moz-placeholder { color:#ccc; }
|
||||
|
||||
<?php if (! empty($dol_use_jmobile)) { ?>
|
||||
legend { margin-bottom: 8px; }
|
||||
<?php } ?>
|
||||
fieldset { border: 1px solid #AAAAAA !important; }
|
||||
|
||||
|
||||
@ -549,7 +540,7 @@ div.myavailability {
|
||||
margin-top: 6px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.selectlimit {
|
||||
.selectlimit, .marginrightonly {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.strikefordisabled {
|
||||
@ -627,12 +618,14 @@ div.myavailability {
|
||||
.minwidth500imp { min-width: 500px !important; }
|
||||
}
|
||||
.maxwidth50 { max-width: 50px; }
|
||||
.maxwidth75 { max-width: 75px; }
|
||||
.maxwidth100 { max-width: 100px; }
|
||||
.maxwidth150 { max-width: 150px; }
|
||||
.maxwidth200 { max-width: 200px; }
|
||||
.maxwidth300 { max-width: 300px; }
|
||||
.maxwidth400 { max-width: 400px; }
|
||||
.maxwidth500 { max-width: 500px; }
|
||||
.maxwidth50imp { max-width: 50px !important; }
|
||||
.minheight20 { min-height: 20px; }
|
||||
.minheight40 { min-height: 40px; }
|
||||
.titlefieldcreate { width: 20%; }
|
||||
@ -667,25 +660,40 @@ div.myavailability {
|
||||
/* Force values for small screen 570 */
|
||||
@media only screen and (max-width: 570px)
|
||||
{
|
||||
.tdoverflowonsmartphone {
|
||||
max-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.titre {
|
||||
line-height: 2em;
|
||||
}
|
||||
.border tbody tr, .border tbody tr td, div.tabBar table.border tr {
|
||||
height: 40px !important;
|
||||
}
|
||||
|
||||
input[type=text], select, textarea {
|
||||
.quatrevingtpercent, .inputsearch {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
input, input[type=text], input[type=password], select, textarea {
|
||||
min-width: 20px;
|
||||
min-height: 1.4em;
|
||||
line-height: 1.4em;
|
||||
margin: .5em 0;
|
||||
padding: .4em .1em;
|
||||
border: 1px solid #BBB;
|
||||
/* max-width: inherit; why this */
|
||||
}
|
||||
|
||||
.hideonsmartphone { display: none; }
|
||||
.noenlargeonsmartphone { width : 50px !important; display: inline !important; }
|
||||
.maxwidthonsmartphone { max-width: 100px; }
|
||||
.maxwidth50onsmartphone { max-width: 50px; }
|
||||
.maxwidth100onsmartphone { max-width: 100px; }
|
||||
.maxwidth150onsmartphone { max-width: 150px; }
|
||||
.maxwidth50onsmartphone { max-width: 40px; }
|
||||
.maxwidth75onsmartphone { max-width: 50px; }
|
||||
.maxwidth100onsmartphone { max-width: 70px; }
|
||||
.maxwidth150onsmartphone { max-width: 120px; }
|
||||
.maxwidth200onsmartphone { max-width: 200px; }
|
||||
.maxwidth300onsmartphone { max-width: 300px; }
|
||||
.maxwidth400onsmartphone { max-width: 400px; }
|
||||
@ -697,6 +705,31 @@ div.myavailability {
|
||||
.minwidth500imp { min-width: 50px !important; }
|
||||
.titlefield { width: auto; }
|
||||
.titlefieldcreate { width: auto; }
|
||||
|
||||
#tooltip {
|
||||
position: absolute;
|
||||
width: <?php print dol_size(300,'width'); ?>px;
|
||||
}
|
||||
|
||||
/* intput, input[type=text], */
|
||||
select {
|
||||
width: 98%;
|
||||
min-width: 40px;
|
||||
}
|
||||
|
||||
div.divphotoref {
|
||||
padding-right: 5px;
|
||||
}
|
||||
img.photoref, div.photoref {
|
||||
border: none;
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
padding: 4px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
.linkobject { cursor: pointer; }
|
||||
<?php if (GETPOST("optioncss") == 'print') { ?>
|
||||
@ -2114,13 +2147,11 @@ span.butAction, span.butActionDelete {
|
||||
color: #ffffff !important;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
background-color: #006dcc;
|
||||
<?php // if (($conf->dol_use_jmobile != 4)) { ?>
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
|
||||
<?php // } ?>
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
|
||||
border-color: #0044cc #0044cc #002a80;
|
||||
@ -2245,10 +2276,7 @@ table.borderplus {
|
||||
border: 1px solid #BBB;
|
||||
}
|
||||
|
||||
.border tbody tr, .border tbody tr td {
|
||||
height: 20px;
|
||||
}
|
||||
div.tabBar table.border tr {
|
||||
.border tbody tr, .border tbody tr td, div.tabBar table.border tr {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
@ -2273,6 +2301,7 @@ td.border, div.tagtable div div.border {
|
||||
width:auto;
|
||||
}
|
||||
|
||||
|
||||
/* Main boxes */
|
||||
|
||||
table.liste, table.noborder, table.formdoc, div.noborder {
|
||||
@ -2285,36 +2314,16 @@ table.liste, table.noborder, table.formdoc, div.noborder {
|
||||
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
|
||||
border-top-style: solid;
|
||||
|
||||
/* border-right-width: 1px;
|
||||
border-right-color: #BBB;
|
||||
border-right-style: solid;
|
||||
|
||||
border-left-width: 1px;
|
||||
border-left-color: #BBB;
|
||||
border-left-style: solid;
|
||||
*/
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-color: #BBB;
|
||||
border-bottom-style: solid;
|
||||
|
||||
margin: 0px 0px 8px 0px;
|
||||
/*
|
||||
-moz-box-shadow: 2px 2px 4px #CCC;
|
||||
-webkit-box-shadow: 2px 2px 4px #CCC;
|
||||
box-shadow: 2px 2px 4px #CCC;
|
||||
*/
|
||||
/* box-shadow: 0 0 3px rgba(0,0,0,0.16); */
|
||||
|
||||
-moz-border-radius: 0.1em;
|
||||
-webkit-border-radius: 0.1em;
|
||||
border-radius: 0.1em;
|
||||
}
|
||||
/*
|
||||
#tablelines tr.liste_titre:first-child td, form.formnoborder, tr.liste_titre.trnoborder td {
|
||||
border-top-width: 1px;
|
||||
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
|
||||
border-top-style: solid;
|
||||
}*/
|
||||
table.noborder tr, div.noborder form {
|
||||
border-top-color: #FEFEFE;
|
||||
|
||||
@ -2327,6 +2336,10 @@ table.noborder tr, div.noborder form {
|
||||
border-left-style: solid;
|
||||
min-height: 26px;
|
||||
}
|
||||
table.paddingtopbottomonly tr td {
|
||||
padding-top: 1px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd
|
||||
{
|
||||
@ -2382,7 +2395,7 @@ table.listwithfilterbefore {
|
||||
|
||||
/* Pagination */
|
||||
div.refidpadding {
|
||||
padding-top: <?php print ($conf->dol_use_jmobile != 4)?'3':'14'; ?>px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
div.refid {
|
||||
font-weight: bold;
|
||||
@ -2418,10 +2431,8 @@ div.pagination li {
|
||||
display: inline-block;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
<?php if (($conf->dol_use_jmobile != 4)) { ?>
|
||||
padding-top: 6px;
|
||||
padding-bottom: 5px;
|
||||
<?php } ?>
|
||||
}
|
||||
.pagination {
|
||||
display: inline-block;
|
||||
@ -2431,7 +2442,6 @@ div.pagination li {
|
||||
|
||||
div.pagination li.pagination a,
|
||||
div.pagination li.pagination span {
|
||||
<?php if ($conf->dol_use_jmobile != 4) { ?>
|
||||
padding: 6px 12px;
|
||||
margin-left: -1px;
|
||||
line-height: 1.42857143;
|
||||
@ -2445,7 +2455,6 @@ div.pagination li.pagination span {
|
||||
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
||||
background-repeat: repeat-x;
|
||||
<?php } ?>
|
||||
}
|
||||
div.pagination li.pagination span.inactive {
|
||||
cursor: default;
|
||||
@ -2458,13 +2467,6 @@ border: none;
|
||||
padding-left: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
<?php if ($conf->dol_use_jmobile == 4) { ?>
|
||||
div.pagination li.litext {
|
||||
padding-top: 13px;
|
||||
vertical-align: top;
|
||||
}
|
||||
<?php } ?>
|
||||
<?php if ($conf->dol_use_jmobile != 4) { ?>
|
||||
div.pagination li.noborder a:hover {
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
@ -2516,7 +2518,6 @@ div.pagination .disabled a:focus {
|
||||
background-color: #fff;
|
||||
border-color: #ddd;
|
||||
}
|
||||
<?php } ?>
|
||||
div.pagination li.pagination .active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@ -4114,11 +4115,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i
|
||||
min-width: .4em;
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
<?php if (! empty($dol_use_jmobile)) { ?>
|
||||
font-size: 13px;
|
||||
<?php } else { ?>
|
||||
font-size: <?php print $fontsize ?>px;
|
||||
<?php } ?>
|
||||
/* white-space: normal; */ /* Warning, enable this break the truncate feature */
|
||||
}
|
||||
.ui-btn-icon-right .ui-btn-inner {
|
||||
@ -4543,7 +4540,6 @@ img.demothumb {
|
||||
}
|
||||
select {
|
||||
width: 98%;
|
||||
<?php if (empty($conf->dol_use_jmobile)) { ?>max-width: 100px;<?php } ?>
|
||||
min-width: 0 !important;
|
||||
}
|
||||
div.divphotoref {
|
||||
|
||||
@ -169,7 +169,7 @@ print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print "<td>".$langs->trans("Parameter")."</td>";
|
||||
print "<td>".$langs->trans("Name")."</td>";
|
||||
print "<td>".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)</td>';
|
||||
print "<td>".$langs->trans("ExtSiteUrlAgenda").'<div class="hideonsmartphone">'." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)</div></td>';
|
||||
print "<td>".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).'</td>';
|
||||
print '<td align="right">'.$langs->trans("Color").'</td>';
|
||||
print "</tr>";
|
||||
@ -187,13 +187,13 @@ while ($i <= $MAXAGENDA)
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
// Nb
|
||||
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
print '<td class="maxwidth50onsmartphone">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
// Name
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key):$object->conf->$name) . '" size="28"></td>';
|
||||
print '<td class="maxwidth50onsmartphone"><input type="text" class="flat hideifnotset minwidth100" name="AGENDA_EXT_NAME_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key):$object->conf->$name) . '"></td>';
|
||||
// URL
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key):$object->conf->$src) . '" size="60"></td>';
|
||||
print '<td class="maxwidth50onsmartphone"><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key):$object->conf->$src) . '"></td>';
|
||||
// Offset TZ
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key):$object->conf->$offsettz) . '" size="2"></td>';
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key):$object->conf->$offsettz) . '" size="1"></td>';
|
||||
// Color (Possible colors are limited by Google)
|
||||
print '<td class="nowrap" align="right">';
|
||||
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user