Merge remote-tracking branch 'Upstream/develop' into 5.0-17

This commit is contained in:
aspangaro 2016-12-27 15:07:29 +01:00
commit 5f861c1067
56 changed files with 785 additions and 401 deletions

View File

@ -152,6 +152,52 @@ Dolibarr better:
- The trigger that activate or close a contract line is run on a contract line, not on contract. - The trigger that activate or close a contract line is run on a contract line, not on contract.
***** ChangeLog for 4.0.3 to 4.0.2 *****
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
FIX: #5958 no discount on supplier command made by replenishment
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
FIX: #5972 #5734
FIX: #6007
FIX: #6010
FIX: #6029
FIX: #6043 - Payment mode not visible on supplier invoice list
FIX: #6051
FIX: #6062
FIX: #6088
FIX: A draft can be deleted by a user with create permission.
FIX: bad permission to see contract on home page
FIX: bad permission to see contract statistics
FIX: Bcc must not appears to recipient when using SMTPs lib
FIX: Consistent description for add or edit product
FIX: delete contract extrafields on contract deletion
FIX: Deposits and credit notes weren't added in the received and pending columns
FIX: export extrafields must not include separe type
FIX: Export of opportunity status must be code, not id.
FIX: False positive on services not activated
FIX: Filter was wrong or lost during navigation
FIX: HT and TTC price should always be displayed together
FIX: if a supplier price reference is changed after creating an order, we can't clone order.
FIX: in export. Error when using a separate extrafields.
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
FIX: javascript error when using on mobile/smartphone
FIX: javascript xss injection and a translation
FIX: Label of project is in field title not label.
FIX: List of people able to validate an expense report was not complete.
FIX: Missing field
FIX: Module gravatar was not triggered on thirdparty and contact card
FIX: Must use external link into a forged email content.
FIX: Pb in management of date end of projects
FIX: Regression when deleting product
FIX: rendering of output of estimated amount on project overview page.
FIX: Sanitize title of ajax_dialog
FIX: Security to restrict email sending was not efficient
FIX: Setting supplier as client when accept a supplier proposal
FIX: Some statistics not compatible with multicompany module.
FIX: the time spent on project was not visible in its overwiew
FIX: Update intervention lline crash with PgSQL
FIX: wrong test on dict.php
FIX: wrong var name
***** ChangeLog for 4.0.2 compared to 4.0.1 ***** ***** ChangeLog for 4.0.2 compared to 4.0.1 *****
FIX: #5340 FIX: #5340
FIX: #5779 FIX: #5779

22
build/generate_filelist_xml.php Normal file → Executable file
View File

@ -65,6 +65,8 @@ fputs($fp, '<checksum_list version="'.$release.'">'."\n");
fputs($fp, '<dolibarr_htdocs_dir>'."\n"); fputs($fp, '<dolibarr_htdocs_dir>'."\n");
$checksumconcat=array();
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/'); $dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
$iterator1 = new RecursiveIteratorIterator($dir_iterator1); $iterator1 = new RecursiveIteratorIterator($dir_iterator1);
// need to ignore document custom etc // need to ignore document custom etc
@ -81,12 +83,22 @@ foreach ($files as $file) {
$needtoclose=1; $needtoclose=1;
} }
if (filetype($file)=="file") { if (filetype($file)=="file") {
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n"); $md5=md5_file($file);
$checksumconcat[]=$md5;
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
} }
} }
fputs($fp, '</dir>'."\n"); fputs($fp, '</dir>'."\n");
fputs($fp, '</dolibarr_htdocs_dir>'."\n"); fputs($fp, '</dolibarr_htdocs_dir>'."\n");
asort($checksumconcat); // Sort list of checksum
//var_dump($checksumconcat);
fputs($fp, '<dolibarr_htdocs_dir_checksum>'."\n");
fputs($fp, md5(join(',',$checksumconcat))."\n");
fputs($fp, '</dolibarr_htdocs_dir_checksum>'."\n");
$checksumconcat=array();
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n"); fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
@ -106,12 +118,18 @@ foreach ($files as $file) {
$needtoclose=1; $needtoclose=1;
} }
if (filetype($file)=="file") { if (filetype($file)=="file") {
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n"); $md5=md5_file($file);
$checksumconcat[]=$md5;
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
} }
} }
fputs($fp, '</dir>'."\n"); fputs($fp, '</dir>'."\n");
fputs($fp, '</dolibarr_script_dir>'."\n"); fputs($fp, '</dolibarr_script_dir>'."\n");
asort($checksumconcat); // Sort list of checksum
fputs($fp, '<dolibarr_script_dir_checksum>'."\n");
fputs($fp, md5(join(',',$checksumconcat))."\n");
fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
fputs($fp, '</checksum_list>'."\n"); fputs($fp, '</checksum_list>'."\n");
fclose($fp); fclose($fp);

View File

@ -89,8 +89,11 @@ if ($user->societe_id > 0)
//accessforbidden(); //accessforbidden();
} }
// Initialize technical object to manage context to save list fields
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'mymodulelist';
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('skeletonlist')); $hookmanager->initHooks(array('mymodulelist'));
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
@ -305,6 +308,7 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);

View File

@ -357,7 +357,7 @@ class AccountancyExport
$Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_compte, 20), 20); $Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_compte, 20), 20);
$Tab['sens'] = $data->sens; // C or D $Tab['sens'] = $data->sens; // C or D
$Tab['signe_montant'] = '+'; $Tab['signe_montant'] = '+';
$Tab['montant'] = str_pad(abs($data->montant) * 100, 12, '0', STR_PAD_LEFT); // TODO manage negative amount $Tab['montant'] = str_pad(abs($data->montant), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
$Tab['contrepartie'] = str_repeat(' ', 8); $Tab['contrepartie'] = str_repeat(' ', 8);
if (! empty($data->date_echeance)) if (! empty($data->date_echeance))
$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); $Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);

View File

@ -1274,6 +1274,7 @@ if ($id)
// Title line with search boxes // Title line with search boxes
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
$filterfound=0;
foreach ($fieldlist as $field => $value) foreach ($fieldlist as $field => $value)
{ {
$showfield=1; // By defaut $showfield=1; // By defaut
@ -1284,21 +1285,25 @@ if ($id)
{ {
if ($value == 'country') if ($value == 'country')
{ {
print '<td>'; print '<td class="liste_titre">';
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone'); print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
print '</td>'; print '</td>';
$filterfound++;
} }
else else
{ {
print '<td></td>'; print '<td class="liste_titre"></td>';
} }
} }
} }
if ($id == 4) print '<td></td>'; if ($id == 4) print '<td></td>';
print '<td></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre" colspan="2" align="right">'; print '<td class="liste_titre" colspan="2" align="right">';
$searchpitco=$form->showFilterAndCheckAddButtons(0); if ($filterfound)
print $searchpitco; {
$searchpitco=$form->showFilterAndCheckAddButtons(0);
print $searchpitco;
}
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -1314,19 +1319,17 @@ if ($id)
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">'; print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
{ {
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
$tmpaction='edit'; $tmpaction='edit';
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors; $error=$hookmanager->error; $errors=$hookmanager->errors;
// Show fields
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
print '<td colspan="3" align="center">'; print '<td colspan="3" align="center">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>'; print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';

View File

@ -619,6 +619,12 @@ else
print '</div>'; print '</div>';
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
$text = $langs->trans("WarningPHPMail");
print info_admin($text);
}
// Run the test to connect // Run the test to connect
if ($action == 'testconnect') if ($action == 'testconnect')
{ {

View File

@ -75,9 +75,9 @@ $file_list = array('missing' => array(), 'updated' => array());
// File to analyze // File to analyze
//$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml'; //$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml';
$xmlshortfile = '/install/filelist-'.DOL_VERSION.'.xml'; $xmlshortfile = GETPOST('xmlshortfile')?GETPOST('xmlshortfile'):'/install/filelist-'.DOL_VERSION.'.xml';
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile; $xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml'; $xmlremote = GETPOST('xmlremote')?GETPOST('xmlremote'):'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
// Test if remote test is ok // Test if remote test is ok
@ -87,21 +87,27 @@ if (preg_match('/beta|alpha/i', DOL_VERSION)) $enableremotecheck=False;
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">'; print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>'; print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
if (dol_is_file($xmlfile)) if (dol_is_file($xmlfile))
{ {
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>'; print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
} }
else else
{ {
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span><br>'; print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile;
if (! GETPOST('xmlshortfile')) print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
print '<br>';
} }
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
if ($enableremotecheck) if ($enableremotecheck)
{ {
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>'; print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>';
} }
else else
{ {
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote.' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span><br>'; print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
if (! GETPOST('xmlremote')) print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
print '<br>';
} }
print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>'; print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
print '</form>'; print '</form>';
@ -128,7 +134,8 @@ if (GETPOST('target') == 'remote')
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404') if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
{ {
$xmlfile = $xmlarray['content']; $xmlfile = $xmlarray['content'];
$xml = simplexml_load_file($xmlfile); //print "eee".$xmlfile."eee";
$xml = simplexml_load_string($xmlfile);
} }
else else
{ {
@ -141,10 +148,13 @@ if (GETPOST('target') == 'remote')
if ($xml) if ($xml)
{ {
$checksumconcat = array();
// Scan htdocs
if (is_object($xml->dolibarr_htdocs_dir[0])) if (is_object($xml->dolibarr_htdocs_dir[0]))
{ {
$file_list = array(); $file_list = array();
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0]); // Fill array $file_list $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
print '<table class="noborder">'; print '<table class="noborder">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -181,10 +191,10 @@ if ($xml)
print '<td align="right">' . $langs->trans("DateModification") . '</td>'; print '<td align="right">' . $langs->trans("DateModification") . '</td>';
print '</tr>'."\n"; print '</tr>'."\n";
$var = true; $var = true;
$tmpfilelist = dol_sort_array($file_list['updated'], 'filename'); $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
if (is_array($tmpfilelist) && count($tmpfilelist)) if (is_array($tmpfilelist2) && count($tmpfilelist2))
{ {
foreach ($tmpfilelist as $file) foreach ($tmpfilelist2 as $file)
{ {
$var = !$var; $var = !$var;
print '<tr ' . $bc[$var] . '>'; print '<tr ' . $bc[$var] . '>';
@ -201,12 +211,44 @@ if ($xml)
print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
print '</table>'; print '</table>';
if (empty($tmpfilelist) && empty($tmpfilelist2))
{
setEventMessage($langs->trans("FileIntegrityIsStrictlyConformedWithReference"));
}
else
{
setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings');
}
} }
else else
{ {
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile; print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
$error++; $error++;
} }
// Scan scripts
/*
if (is_object($xml->dolibarr_script_dir[0]))
{
$file_list = array();
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
}*/
asort($checksumconcat); // Sort list of checksum
//var_dump($checksumconcat);
$checksumget = md5(join(',',$checksumconcat));
$checksumtoget = $xml->dolibarr_htdocs_dir_checksum;
if ($checksumtoget)
{
print '<br>';
print '<strong>'.$langs->trans("GlobalChecksum").'</strong><br>';
print $langs->trans("ExpectedChecksum").' = '.$checksumtoget.'<br>';
print $langs->trans("CurrentChecksum").' = '.$checksumget;
}
} }
@ -223,12 +265,14 @@ exit($error);
* Function to get list of updated or modified files. * Function to get list of updated or modified files.
* $file_list is used as global variable * $file_list is used as global variable
* *
* @param array $file_list Array for response * @param array $file_list Array for response
* @param SimpleXMLElement $dir SimpleXMLElement of files to test * @param SimpleXMLElement $dir SimpleXMLElement of files to test
* @param string $path Path of file * @param string $path Path of files relative to $pathref. We start with ''. Used by recursive calls.
* @return array Array of filenames * @param string $pathref Path ref (DOL_DOCUMENT_ROOT)
* @param array $checksumconcat Array of checksum
* @return array Array of filenames
*/ */
function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '') function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathref = '', &$checksumconcat = array())
{ {
$exclude = 'install'; $exclude = 'install';
@ -236,20 +280,21 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '')
{ {
$filename = $path.$file['name']; $filename = $path.$file['name'];
if (preg_match('#'.$exclude.'#', $filename)) continue; //if (preg_match('#'.$exclude.'#', $filename)) continue;
if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename)) if (!file_exists($pathref.'/'.$filename))
{ {
$file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file); $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file);
} }
else else
{ {
$md5_local = md5_file(DOL_DOCUMENT_ROOT.'/'.$filename); $md5_local = md5_file($pathref.'/'.$filename);
if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local); if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local);
} $checksumconcat[] = $md5_local;
}
} }
foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/'); foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/', $pathref, $checksumconcat);
return $file_list; return $file_list;
} }

View File

@ -278,7 +278,7 @@ if ($action == 'add')
if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby","int"); if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby","int");
} }
$object->note = trim($_POST["note"]); $object->note = trim(GETPOST("note"));
if (isset($_POST["contactid"])) $object->contact = $contact; if (isset($_POST["contactid"])) $object->contact = $contact;
@ -290,11 +290,6 @@ if ($action == 'add')
$object->societe = $object->thirdparty; // For backward compatibility $object->societe = $object->thirdparty; // For backward compatibility
} }
// Special for module webcal and phenix
// TODO external modules
if (! empty($conf->webcalendar->enabled) && GETPOST('add_webcal') == 'on') $object->use_webcal=1;
if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $object->use_phenix=1;
// Check parameters // Check parameters
if (empty($object->userownerid) && empty($_SESSION['assignedtouser'])) if (empty($object->userownerid) && empty($_SESSION['assignedtouser']))
{ {

View File

@ -94,7 +94,7 @@ class AgendaEvents extends DolibarrApi
* @param int $limit Limit for list * @param int $limit Limit for list
* @param int $page Page number * @param int $page Page number
* @param string $user_ids User ids filter field (owners of event). Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i} * @param string $user_ids User ids filter field (owners of event). 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')" * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.date_creation:<:'20160101')"
* @return array Array of Agenda Events objects * @return array Array of Agenda Events objects
*/ */
function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0, $sqlfilters = '') { function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0, $sqlfilters = '') {

View File

@ -756,8 +756,9 @@ else
$sendingmode=$conf->global->MAIN_MAIL_SENDMODE; $sendingmode=$conf->global->MAIN_MAIL_SENDMODE;
if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function
// MAILING_NO_USING_PHPMAIL may be defined or not // MAILING_NO_USING_PHPMAIL may be defined or not.
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0, MAILING_LIMIT_SENDBYCLI may be defined ot not. // MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0=no limit).
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail') if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
{ {
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent. // EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
@ -797,7 +798,7 @@ else
} }
$text.=$langs->trans('ConfirmSendingEmailing').'<br>'; $text.=$langs->trans('ConfirmSendingEmailing').'<br>';
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB); $text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,270); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,300);
} }
} }
@ -844,23 +845,28 @@ else
print $langs->trans("TotalNbOfDistinctRecipients"); print $langs->trans("TotalNbOfDistinctRecipients");
print '</td><td colspan="3">'; print '</td><td colspan="3">';
$nbemail = ($object->nbemail?$object->nbemail:img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>'); $nbemail = ($object->nbemail?$object->nbemail:img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>');
if ($object->statut != 3 && !empty($conf->global->MAILING_LIMIT_SENDBYWEB) && is_numeric($nbemail) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) if ($object->statut != 3 && is_numeric($nbemail))
{ {
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0) $text='';
{ if (! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB); {
print $form->textwithpicto($nbemail,$text,1,'warning'); if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
} {
else $text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
{ }
$text=$langs->trans('NotEnoughPermissions'); else
print $form->textwithpicto($nbemail,$text,1,'warning'); {
} $text.=$langs->trans('NotEnoughPermissions');
}
} }
else if ($text)
{ {
print $nbemail; print $form->textwithpicto($nbemail,$text,1,'warning');
}
else
{
print $nbemail;
}
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -132,9 +132,9 @@ if ($id > 0 || ! empty($ref))
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
$cssclass="titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
print '</div>';
print '</div>'; print '</div>';
dol_fiche_end(); dol_fiche_end();

View File

@ -99,7 +99,7 @@ if (! $sortfield) $sortfield='c.ref';
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
// Initialize technical object to manage context to save list fields // Initialize technical object to manage context to save list fields
$contextpage='orderlist'; $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'orderlist';
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array($contextpage)); $hookmanager->initHooks(array($contextpage));
@ -653,6 +653,7 @@ if ($resql)
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">'; print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);

View File

@ -3723,7 +3723,7 @@ else if ($id > 0 || ! empty($ref))
else else
print $langs->trans('ExcessReceived'); print $langs->trans('ExcessReceived');
print ' :</td>'; print ' :</td>';
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':$cssforamountpaymentcomplete).'>' . price($resteapayeraffiche) . '</td>'; print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>';
print '<td class="nowrap">&nbsp;</td></tr>'; print '<td class="nowrap">&nbsp;</td></tr>';
} }
else // Credit note else // Credit note

View File

@ -867,18 +867,20 @@ if ($resql)
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
$facturestatic->statut=$obj->fk_statut; $facturestatic->statut=$obj->fk_statut;
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite); $facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
$facturestatic->type=$obj->type;
$facturestatic->note_public=$obj->note_public; $facturestatic->note_public=$obj->note_public;
$facturestatic->note_private=$obj->note_private; $facturestatic->note_private=$obj->note_private;
$paiement = $facturestatic->getSommePaiement();
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
if (! empty($arrayfields['f.facnumber']['checked'])) if (! empty($arrayfields['f.facnumber']['checked']))
{ {
print '<td class="nowrap">'; print '<td class="nowrap">';
$paiement = $facturestatic->getSommePaiement();
$remaintopay = $obj->total_ttc - $paiement;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowrap">';
@ -1028,10 +1030,10 @@ if ($resql)
if (! empty($arrayfields['dynamount_payed']['checked'])) if (! empty($arrayfields['dynamount_payed']['checked']))
{ {
print '<td align="right">'.(! empty($paiement)?price($paiement,0,$langs):'&nbsp;').'</td>'; // TODO Use a denormalized field print '<td align="right">'.(! empty($totalpay)?price($totalpay,0,$langs):'&nbsp;').'</td>'; // TODO Use a denormalized field
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; if (! $i) $totalarray['totalamfield']=$totalarray['nbfield'];
$totalarray['totalam'] += $paiement; $totalarray['totalam'] += $totalpay;
} }
if (! empty($arrayfields['rtp']['checked'])) if (! empty($arrayfields['rtp']['checked']))

View File

@ -556,34 +556,42 @@ if ($id > 0)
print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("Type").'</td>'; print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>'; print '<td align="right">'.$langs->trans("Amount").'</td>';
print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
$var=True; $var=true;
while ($i < $num) if ($num > 0)
{
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var]."><td>";
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
$labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount)."</td>\n";
print "</tr>";
$totalpaye += $objp->amount;
$i++;
}
}
else
{ {
$objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr ".$bc[$var]."><td>"; print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td><td></td></tr>';
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
$labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td>\n";
print "</tr>";
$totalpaye += $objp->amount;
$i++;
} }
if ($object->paye == 0) if ($object->paye == 0)
{ {
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaye)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td></tr>\n"; print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaye)."</td></tr>\n";
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td></tr>\n"; print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td></tr>\n";
$resteapayer = $object->amount - $totalpaye; $resteapayer = $object->amount - $totalpaye;
$cssforamountpaymentcomplete = 'amountpaymentcomplete';
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>"; print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
print "<td align=\"right\">".price($resteapayer)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td></tr>\n"; print '<td align="right"'.($resteapayer?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>'.price($resteapayer)."</td></tr>\n";
} }
print "</table>"; print "</table>";
$db->free($resql); $db->free($resql);

View File

@ -510,7 +510,7 @@ class ChargeSociales extends CommonObject
function info($id) function info($id)
{ {
$sql = "SELECT e.rowid, e.tms as datem, e.date_creation as datec, e.date_valid as datev, e.import_key,"; $sql = "SELECT e.rowid, e.tms as datem, e.date_creation as datec, e.date_valid as datev, e.import_key,";
$sql.= " fk_user_author, fk_user_modif, fk_user_valid"; $sql.= " e.fk_user_author, e.fk_user_modif, e.fk_user_valid";
$sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as e"; $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as e";
$sql.= " WHERE e.rowid = ".$id; $sql.= " WHERE e.rowid = ".$id;
@ -543,7 +543,7 @@ class ChargeSociales extends CommonObject
} }
$this->date_creation = $this->db->jdate($obj->datec); $this->date_creation = $this->db->jdate($obj->datec);
if (! empty($obj->fk_user_modif)) $this->date_modification = $this->db->jdate($obj->datem); $this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev); $this->date_validation = $this->db->jdate($obj->datev);
$this->import_key = $obj->import_key; $this->import_key = $obj->import_key;
} }

View File

@ -250,11 +250,16 @@ $dolibarr_main_restrict_os_commands='mysqldump, mysql, pg_dump, pgrestore';
$dolibarr_nocsrfcheck='0'; $dolibarr_nocsrfcheck='0';
// dolibarr_mailing_limit_sendbyweb // dolibarr_mailing_limit_sendbyweb
// Can set a limit for mailing send by web. Can be used for a restricted mode. // Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level.
// Default value: 0 (use database value if exist) // Default value: '25'
// Examples: // Examples: '-1' (sending by web is forbidden)
// $dolibarr_mailing_limit_sendbyweb='0'; // $dolibarr_mailing_limit_sendbyweb='25';
// dolibarr_mailing_limit_sendbycli
// Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level.
// Default value: '0' (no hard limit, use soft database value if exists)
// Examples: '-1' (sending by cli is forbidden)
// $dolibarr_mailing_limit_sendbycli='0';
//################## //##################
@ -273,18 +278,6 @@ $dolibarr_nocsrfcheck='0';
// Examples: // Examples:
// $dolibarr_main_limit_users='0'; // $dolibarr_main_limit_users='0';
// dolibarr_mailing_limit_sendbyweb
// Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level.
// Default value: '0' (no overwrite, use database value if exists)
// Examples: '-1' (sending by web is forbidden)
// $dolibarr_mailing_limit_sendbyweb='0';
// dolibarr_mailing_limit_sendbycli
// Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level.
// Default value: '0' (no overwrite, use database value if exists)
// Examples: '-1' (sending by cli is forbidden)
// $dolibarr_mailing_limit_sendbycli='0';
// dolibarr_strict_mode // dolibarr_strict_mode
// Set this to 1 to enable the PHP strict mode. For dev environment only. // Set this to 1 to enable the PHP strict mode. For dev environment only.
// Default value: 0 (use database value if exist) // Default value: 0 (use database value if exist)

View File

@ -488,27 +488,34 @@ class CMailFile
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL // Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10; if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
$tmparray = explode(',', $this->addr_to); $tmparray1 = explode(',', $this->addr_to);
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL) if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)
{ {
$this->error = 'Too much recipients in to:'; $this->error = 'Too much recipients in to:';
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
return false; return false;
} }
$tmparray = explode(',', $this->addr_cc); $tmparray2 = explode(',', $this->addr_cc);
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL) if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)
{ {
$this->error = 'Too much recipients in cc:'; $this->error = 'Too much recipients in cc:';
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
return false; return false;
} }
$tmparray = explode(',', $this->addr_bcc); $tmparray3 = explode(',', $this->addr_bcc);
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL) if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)
{ {
$this->error = 'Too much recipients in bcc:'; $this->error = 'Too much recipients in bcc:';
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
return false; return false;
} }
if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
{
$this->error = 'Too much recipients in to:, cc:, bcc:';
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
return false;
}
// Action according to choosed sending method // Action according to choosed sending method
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
@ -538,25 +545,28 @@ class CMailFile
} }
else else
{ {
$bounce = ''; // By default $additionnalparam = ''; // By default
if (! empty($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F)) if (! empty($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F))
{ {
// le "Return-Path" (retour des messages bounced) dans les header ne fonctionne pas avec tous les MTA // le "Return-Path" (retour des messages bounced) dans les header ne fonctionne pas avec tous les MTA
// Le forcage de la valeur grace à l'option -f de sendmail est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie. // Le forcage de la valeur grace à l'option -f de sendmail est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie.
// La variable definie pose des pb avec certains sendmail securisee (option -f refusee car dangereuse) // Having this variable defined may create problems with some sendmail (option -f refused)
$bounce .= ($bounce?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') ); // Having this variable not defined may create problems with some other sendmail (option -f required)
$additionnalparam .= ($additionnalparam?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') );
} }
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender
{ {
$bounce .= ($bounce?' ':'').'-ba'; $additionnalparam .= ($additionnalparam?' ':'').'-ba';
} }
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$bounce, LOG_DEBUG); if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
$this->message=stripslashes($this->message); $this->message=stripslashes($this->message);
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail(); 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); if (! empty($additionnalparam)) $res = mail($dest, $this->encodetorfc2822($this->subject), $this->message, $this->headers, $additionnalparam);
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) if (! $res)

View File

@ -282,6 +282,7 @@ class Conf
// Define default dir_output and dir_temp for directories of modules // Define default dir_output and dir_temp for directories of modules
foreach($this->modules as $module) foreach($this->modules as $module)
{ {
//var_dump($module);
// For multicompany sharings // For multicompany sharings
$this->$module->multidir_output = array($this->entity => $rootfordata."/".$module); $this->$module->multidir_output = array($this->entity => $rootfordata."/".$module);
$this->$module->multidir_temp = array($this->entity => $rootfordata."/".$module."/temp"); $this->$module->multidir_temp = array($this->entity => $rootfordata."/".$module."/temp");

View File

@ -5633,18 +5633,18 @@ class Form
* Return a HTML area with the reference of object and a navigation bar for a business object * Return a HTML area with the reference of object and a navigation bar for a business object
* To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria. * To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
* *
* @param object $object Object to show * @param object $object Object to show.
* @param string $paramid Name of parameter to use to name the id into the URL next/previous link * @param string $paramid Name of parameter to use to name the id into the URL next/previous link.
* @param string $morehtml More html content to output just before the nav bar * @param string $morehtml More html content to output just before the nav bar.
* @param int $shownav Show Condition (navigation is shown if value is 1) * @param int $shownav Show Condition (navigation is shown if value is 1).
* @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field) * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field).
* @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref. * @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref.
* @param string $morehtmlref More html to show after ref * @param string $morehtmlref More html to show after ref.
* @param string $moreparam More param to add in nav link url. * @param string $moreparam More param to add in nav link url. Must start with '&...'.
* @param int $nodbprefix Do not include DB prefix to forge table name * @param int $nodbprefix Do not include DB prefix to forge table name.
* @param string $morehtmlleft More html code to show before ref * @param string $morehtmlleft More html code to show before ref.
* @param string $morehtmlstatus More html code to show under navigation arrows (status place) * @param string $morehtmlstatus More html code to show under navigation arrows (status place).
* @param string $morehtmlright More html code to show after ref * @param string $morehtmlright More html code to show after ref.
* @return string Portion HTML with ref + navigation buttons * @return string Portion HTML with ref + navigation buttons
*/ */
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')

View File

@ -239,7 +239,7 @@ function show_array_actions_to_do($max=5)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("LastActionsToDo",$max).'</td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("LastActionsToDo",$max).'</td>';
print '<td colspan="2" align="right"><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?status=todo">'.$langs->trans("FullList").'</a>'; print '<td colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/listactions.php?status=todo">'.$langs->trans("FullList").'</a>';
print '</tr>'; print '</tr>';
$var = true; $var = true;
@ -336,7 +336,7 @@ function show_array_last_actions_done($max=5)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("LastDoneTasks",$max).'</td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("LastDoneTasks",$max).'</td>';
print '<td colspan="2" align="right"><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?status=done">'.$langs->trans("FullList").'</a>'; print '<td colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/listactions.php?status=done">'.$langs->trans("FullList").'</a>';
print '</tr>'; print '</tr>';
$var = true; $var = true;
$i = 0; $i = 0;

View File

@ -993,16 +993,26 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$sql.= " u.login, u.rowid as user_id"; $sql.= " u.login, u.rowid as user_id";
if (get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname"; if (get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
if (get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname"; if (get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
$sql.= " WHERE u.rowid = a.fk_user_author"; $sql.= " WHERE u.rowid = a.fk_user_author";
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")"; $sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
if (get_class($filterobj) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; if (get_class($filterobj) == 'Adherent')
if (get_class($filterobj) == 'Adherent' && $filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; {
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
if (get_class($filterobj) == 'CommandeFournisseur')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id; if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id;
// Condition on actioncode // Condition on actioncode
if (! empty($actioncode)) if (! empty($actioncode))
@ -1133,6 +1143,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; 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.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
@ -1142,9 +1153,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$userstatic=new User($db); $userstatic=new User($db);
$contactstatic = new Contact($db); $contactstatic = new Contact($db);
// TODO uniformize // TODO mutualize/uniformize
$propalstatic=new Propal($db); $propalstatic=new Propal($db);
$orderstatic=new Commande($db); $orderstatic=new Commande($db);
$supplierorderstatic=new CommandeFournisseur($db);
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
$out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; $out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
@ -1286,7 +1298,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
//$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>'; //$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>';
// Objet lie // Objet lie
// TODO uniformize // TODO mutualize/uniformize
$out.='<td>'; $out.='<td>';
//var_dump($histo[$key]['elementtype']); //var_dump($histo[$key]['elementtype']);
if (isset($histo[$key]['elementtype'])) if (isset($histo[$key]['elementtype']))

View File

@ -101,7 +101,8 @@ function facturefourn_prepare_head($object)
*/ */
function ordersupplier_prepare_head($object) function ordersupplier_prepare_head($object)
{ {
global $db, $langs, $conf; global $db, $langs, $conf, $user;
$h = 0; $h = 0;
$head = array(); $head = array();
@ -159,7 +160,12 @@ function ordersupplier_prepare_head($object)
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/info.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1].= $langs->trans("Events");
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
$head[$h][1].= '/';
$head[$h][1].= $langs->trans("Agenda");
}
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_order', 'remove'); complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_order', 'remove');

View File

@ -1103,7 +1103,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$morehtmlref.='</div>'; $morehtmlref.='</div>';
} }
print '<div class="'.($onlybanner?'':'arearef ').'heightref valignmiddle" width="100%">'; print '<div class="'.($onlybanner?'arearefnobottom ':'arearef ').'heightref valignmiddle" width="100%">';
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright); print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
print '</div>'; print '</div>';
print '<div class="underrefbanner clearboth"></div>'; print '<div class="underrefbanner clearboth"></div>';

View File

@ -2007,13 +2007,14 @@ function getElementProperties($element_type)
/** /**
* Fetch an object from its id and element_type * Fetch an object from its id and element_type
* Inclusion classes is automatic * Inclusion of classes is automatic
* *
* @param int $element_id Element id * @param int $element_id Element id
* @param string $element_type Element type * @param string $element_type Element type
* @param ref $element_ref Element ref (Use this if element_id but not both)
* @return int|object object || 0 || -1 if error * @return int|object object || 0 || -1 if error
*/ */
function fetchObjectByElement($element_id, $element_type) function fetchObjectByElement($element_id, $element_type, $element_ref='')
{ {
global $conf; global $conf;
global $db,$conf; global $db,$conf;
@ -2023,11 +2024,11 @@ function fetchObjectByElement($element_id, $element_type)
{ {
dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php'); dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php');
$objectstat = new $element_prop['classname']($db); $objecttmp = new $element_prop['classname']($db);
$ret = $objectstat->fetch($element_id); $ret = $objecttmp->fetch($element_id, $element_ref);
if ($ret >= 0) if ($ret >= 0)
{ {
return $objectstat; return $objecttmp;
} }
} }
return 0; return 0;

View File

@ -844,7 +844,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->commande->enabled)) if (! empty($conf->commande->enabled))
{ {
$langs->load("orders"); $langs->load("orders");
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&amp;viewstatut=-3&amp;billed=0", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); if (! empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&amp;viewstatut=-3&amp;billed=0&amp;contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
// if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); // if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
} }

View File

@ -129,6 +129,7 @@ class pdf_einstein extends ModelePDFCommandes
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
$this->posxunit-=20;
$this->posxdiscount-=20; $this->posxdiscount-=20;
$this->postotalht-=20; $this->postotalht-=20;
} }

View File

@ -135,12 +135,14 @@ class pdf_crabe extends ModelePDFFactures
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20; $this->posxpicture-=20;
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
$this->posxdiscount-=20; $this->posxunit-=20;
$this->postotalht-=20; $this->posxdiscount-=20;
$this->posxprogress-=20;
$this->postotalht-=20;
} }
$this->tva=array(); $this->tva=array();
@ -297,7 +299,7 @@ class pdf_crabe extends ModelePDFFactures
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS)) if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS)) // retreive space not used by discount
{ {
$this->posxpicture+=($this->postotalht - $this->posxdiscount); $this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount); $this->posxtva+=($this->postotalht - $this->posxdiscount);
@ -527,9 +529,9 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($this->posxprogress-$this->posxdiscount+2, 3, $remise_percent, 0, 'R'); $pdf->MultiCell($this->posxprogress-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
} }
// Situation progress
if ($this->situationinvoice) if ($this->situationinvoice)
{ {
// Situation progress
$progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails); $progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxprogress, $curY); $pdf->SetXY($this->posxprogress, $curY);
$pdf->MultiCell($this->postotalht-$this->posxprogress, 3, $progress, 0, 'R'); $pdf->MultiCell($this->postotalht-$this->posxprogress, 3, $progress, 0, 'R');

View File

@ -127,6 +127,7 @@ class pdf_azur extends ModelePDFPropales
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
$this->posxunit-=20;
$this->posxdiscount-=20; $this->posxdiscount-=20;
$this->postotalht-=20; $this->postotalht-=20;
} }

View File

@ -113,6 +113,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
$this->posxunit-=20;
$this->posxdiscount-=20; $this->posxdiscount-=20;
$this->postotalht-=20; $this->postotalht-=20;
} }

View File

@ -127,6 +127,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
$this->posxunit-=20;
$this->posxdiscount-=20; $this->posxdiscount-=20;
$this->postotalht-=20; $this->postotalht-=20;
} }

View File

@ -115,6 +115,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
$this->posxunit-=20;
$this->posxdiscount-=20; $this->posxdiscount-=20;
$this->postotalht-=20; $this->postotalht-=20;
} }

View File

@ -22,6 +22,9 @@
* *
* $cols * $cols
*/ */
?>
<!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
<?php
//$res = $object->fetch_optionals($object->id, $extralabels); //$res = $object->fetch_optionals($object->id, $extralabels);
$parameters = array('colspan' => ' colspan="'.$cols.'"', 'cols' => $cols, 'socid' => $object->fk_soc); $parameters = array('colspan' => ' colspan="'.$cols.'"', 'cols' => $cols, 'socid' => $object->fk_soc);
@ -47,7 +50,9 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
if (!empty($extrafields->attribute_hidden[$key])) print '<tr class="hideobject"><td>'; if (!empty($extrafields->attribute_hidden[$key])) print '<tr class="hideobject"><td>';
else print '<tr><td>'; else print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td'; print '<table width="100%" class="nobordernopadding">';
print '<tr>';
print '<td';
//var_dump($action);exit; //var_dump($action);exit;
if ((! empty($action) && ($action == 'create' || $action == 'edit')) && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"'; if ((! empty($action) && ($action == 'create' || $action == 'edit')) && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>' . $langs->trans($label) . '</td>'; print '>' . $langs->trans($label) . '</td>';
@ -100,3 +105,5 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
} }
} }
} }
?>
<!-- END PHP TEMPLATE admin_extrafields_view.tpl.php -->

View File

@ -10,21 +10,21 @@ print '<div class="tagtable centpercent noborder allwidth">';
if($mode == 'edit' ) if($mode == 'edit' )
{ {
print '<form class="tagtr liste_titre">'; print '<form class="tagtr liste_titre">';
print '<div class="tagtd">'.$langs->trans('Resource').'</div>'; print '<div class="tagtd liste_titre">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Type').'</div>'; print '<div class="tagtd liste_titre">'.$langs->trans('Type').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>'; print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>'; print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd"></div>'; print '<div class="tagtd liste_titre"></div>';
print '</form>'; print '</form>';
} }
else else
{ {
print '<form class="tagtr liste_titre">'; print '<form class="tagtr liste_titre">';
print '<div class="tagtd">'.$langs->trans('Resource').'</div>'; print '<div class="tagtd liste_titre">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Type').'</div>'; print '<div class="tagtd liste_titre">'.$langs->trans('Type').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>'; print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>'; print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd"></div>'; print '<div class="tagtd liste_titre"></div>';
print '</form>'; print '</form>';
} }
@ -66,7 +66,7 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print '<div class="tagtd">'; print '<div class="tagtd">';
print $object_resource->getNomUrl(1); print $object_resource->getNomUrl(1);
print '</div class="tagtd">'; print '</div>';
print '<div class="tagtd">'; print '<div class="tagtd">';
print $object_resource->type_label; print $object_resource->type_label;

View File

@ -1395,10 +1395,12 @@ else if ($id > 0 || ! empty($ref))
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Description').'</td>'; print '<td class="liste_titre">'.$langs->trans('Description').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>'; print '<td class="liste_titre" align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>'; print '<td class="liste_titre" align="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
print '<td width="48" colspan="3">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }
$var=true; $var=true;

View File

@ -383,7 +383,7 @@ class Fichinter extends CommonObject
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
} }

View File

@ -45,7 +45,11 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db); $object = new Fichinter($db);
$result = $object->fetch($id,$ref); $result = $object->fetch($id,$ref);
if (! $result)
{
print 'Record not found';
exit;
}
/* /*
* Adding a new contact * Adding a new contact
@ -166,7 +170,7 @@ if ($id > 0 || ! empty($ref))
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, 0, 0, '', '', 1); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
dol_fiche_end(); dol_fiche_end();

View File

@ -253,7 +253,7 @@ if ($result)
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">'; print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref","",$param,'width="15%"',$sortfield,$sortorder); if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['f.description']['checked'])) print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['f.description']['checked'])) print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['fd.description']['checked'])) print_liste_field_titre('',$_SERVER["PHP_SELF"],''); if (! empty($arrayfields['fd.description']['checked'])) print_liste_field_titre('',$_SERVER["PHP_SELF"],'');
@ -407,10 +407,11 @@ if ($result)
print $warnornote; print $warnornote;
print '</td>'; print '</td>';
} }
// Other picto tool // Other picto tool
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->fichinter->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->ficheinter->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';

View File

@ -184,7 +184,7 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='</div>'; $morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
dol_fiche_end(); dol_fiche_end();

View File

@ -625,9 +625,9 @@ if ($id > 0 || ! empty($ref)) {
// Message if nothing to dispatch // Message if nothing to dispatch
if (! $nbproduct) { if (! $nbproduct) {
if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED)) if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
print $langs->trans("NoPredefinedProductToDispatch"); // No predefined line at all print '<div class="opacitymedium">'.$langs->trans("NoPredefinedProductToDispatch").'</div>'; // No predefined line at all
else else
print $langs->trans("NoMorePredefinedProductToDispatch"); // No predefined line that remain to be dispatched. print '<div class="opacitymedium">'.$langs->trans("NoMorePredefinedProductToDispatch").'</div>'; // No predefined line that remain to be dispatched.
} }
print '</form>'; print '</form>';

View File

@ -27,6 +27,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$langs->load("orders"); $langs->load("orders");
$langs->load("suppliers"); $langs->load("suppliers");
@ -35,11 +36,44 @@ $langs->load('stocks');
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$ref=GETPOST('ref','alpha'); $ref=GETPOST('ref','alpha');
$action = GETPOST('action','alpha');
if (GETPOST('actioncode','array'))
{
$actioncode=GETPOST('actioncode','array',3);
if (! count($actioncode)) $actioncode='0';
}
else
{
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
$search_agenda_label=GETPOST('search_agenda_label');
// Security check // Security check
$socid=''; $socid=0;
if (! empty($user->societe_id)) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $id, '', 'commande'); $result=restrictedArea($user,'fournisseur',$id,'', 'commande');
if (!$user->rights->fournisseur->commande->lire) accessforbidden();
/*
* Actions
*/
$parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
{
$actioncode='';
$search_agenda_label='';
}
/* /*
@ -47,89 +81,143 @@ $result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
*/ */
$form = new Form($db); $form = new Form($db);
$object = new CommandeFournisseur($db);
$now=dol_now();
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
$soc = new Societe($db); $object->fetch($id, $ref);
$object = new CommandeFournisseur($db); $object->fetch_thirdparty();
$object->info($object->id);
$result=$object->fetch($id,$ref);
if ($result >= 0)
{
$object->info($object->id);
$soc->fetch($object->socid);
$help_url='EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
llxHeader('',$langs->trans("Order"),$help_url);
$head = ordersupplier_prepare_head($object);
$title=$langs->trans("SupplierOrder");
dol_fiche_head($head, 'info', $title, 0, 'order');
/*
* Commande
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
print '<td colspan="2">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
print '</td>';
print '</tr>';
// Fournisseur
print '<tr><td>'.$langs->trans("Supplier")."</td>";
print '<td colspan="2">'.$soc->getNomUrl(1,'supplier').'</td>';
print '</tr>';
// Statut
print '<tr>';
print '<td>'.$langs->trans("Status").'</td>';
print '<td colspan="2">';
print $object->getLibStatut(4);
print "</td></tr>";
// Date
if ($object->methode_commande_id > 0)
{
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
if ($object->date_commande)
{
print dol_print_date($object->date_commande,"dayhourtext")."\n";
}
print "</td></tr>";
if ($object->methode_commande)
{
print '<tr><td>'.$langs->trans("Method").'</td><td colspan="2">'.$object->getInputMethod().'</td></tr>';
}
}
print "</table>\n";
print "<br>";
print '<table width="100%"><tr><td>';
dol_print_object_info($object, 1);
print '</td></tr></table>';
print '</div>';
}
else
{
/* Order not found */
print "OrderNotFound";
}
} }
$title=$langs->trans("SupplierOrder").' - '.$object->ref.' '.$object->name;
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref.' '.$object->name.' - '.$langs->trans("Info");
$help_url='EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
llxHeader('',$title,$help_url);
$now=dol_now();
$head = ordersupplier_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("SupplierOrder"), 0, 'order');
// Supplier order card
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">';
// Ref supplier
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->fournisseur->commande->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
dol_print_object_info($object, 1);
print '</div>';
print '<div class="clearboth"></div>';
dol_fiche_end();
// Actions buttons
$out='';
$permok=$user->rights->agenda->myactions->create;
if ($permok)
{
$out.='&originid='.$object->id.'&origin=order_supplier';
}
print '<div class="tabsAction">';
if (! empty($conf->agenda->enabled))
{
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("AddAction").'</a>';
}
else
{
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
}
}
print '</div>';
if (!empty($object->id))
{
$param='&id='.$object->id;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print load_fiche_titre($langs->trans("ActionsOnOrder"),'','');
// List of actions on element
/*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'project',0);*/
// List of todo actions
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);
// List of done actions
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
// List of all actions
$filters=array();
$filters['search_agenda_label']=$search_agenda_label;
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters);
}
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -43,6 +43,6 @@ insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RE
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1); insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1);
insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1); insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1);
-- Argentina (country 23) -- Argentina (country 23)
insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto (typo A)', 23, 0);
insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto (typo B)', 23, 0);
insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento (typo C)', 23, 0);

View File

@ -230,6 +230,7 @@ ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_valid (fk_user
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_approve (fk_user_approve); ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_approve (fk_user_approve);
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_approve); ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_approve);
DELETE FROM llx_actioncomm_resources WHERE fk_actioncomm not in (select id from llx_actioncomm);
-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate. -- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate.
drop table tmp_links_double; drop table tmp_links_double;

View File

@ -143,6 +143,10 @@ delete from llx_element_element where sourcetype='facture' and fk_source not in
delete from llx_element_element where sourcetype='commande' and fk_source not in (select rowid from llx_commande); delete from llx_element_element where sourcetype='commande' and fk_source not in (select rowid from llx_commande);
-- Fix: delete orphelin actioncomm_resources
DELETE FROM llx_actioncomm_resources WHERE fk_actioncomm not in (select id from llx_actioncomm);
UPDATE llx_product SET canvas = NULL where canvas = 'default@product'; UPDATE llx_product SET canvas = NULL where canvas = 'default@product';
UPDATE llx_product SET canvas = NULL where canvas = 'service@product'; UPDATE llx_product SET canvas = NULL where canvas = 'service@product';

View File

@ -541,16 +541,20 @@ if (! $error && $db->connected && $action == "set")
{ {
if ($db->connected) if ($db->connected)
{ {
$resultbis = 1;
// Create user // Create user
$tmpdolibarr_main_db_host = $dolibarr_main_db_host; $result=$db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
// Create user bis
if ($databasefortest == 'mysql') if ($databasefortest == 'mysql')
{ {
if (! in_array($conf->db->host, array('127.0.0.1', 'localhost', 'localhost.local'))) $tmpdolibarr_main_db_host='%'; if (! in_array($dolibarr_main_db_host, array('127.0.0.1', '::1', 'localhost', 'localhost.local')))
{
$resultbis=$db->DDLCreateUser('%', $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
}
} }
$result=$db->DDLCreateUser($tmpdolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); if ($result > 0 && $resultbis > 0)
if ($result > 0)
{ {
print '<tr><td>'; print '<tr><td>';

View File

@ -10,6 +10,9 @@ VersionUnknown=Unknown
VersionRecommanded=Recommended VersionRecommanded=Recommended
FileCheck=Files integrity checker FileCheck=Files integrity checker
FileCheckDesc=This tool allows you to check the integrity of files of your application, comparing each files with the official ones. You can use this tool to detect if some files were modified by a hacker for example. FileCheckDesc=This tool allows you to check the integrity of files of your application, comparing each files with the official ones. You can use this tool to detect if some files were modified by a hacker for example.
FileIntegrityIsStrictlyConformedWithReference=Files integrity is strictly conformed with the reference.
FileIntegritySomeFilesWereRemovedOrModified=Files integrity check has failed. Some files were modified of removed.
GlobalChecksum=Global checksum
MakeIntegrityAnalysisFrom=Make integrity analysis of application files from MakeIntegrityAnalysisFrom=Make integrity analysis of application files from
LocalSignature=Embedded local signature (less reliable) LocalSignature=Embedded local signature (less reliable)
RemoteSignature=Remote distant signature (more reliable) RemoteSignature=Remote distant signature (more reliable)
@ -411,6 +414,7 @@ ModuleCompanyCodePanicum=Return an empty accountancy code.
ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code. ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code.
Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).<br>Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required. Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).<br>Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required.
UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than... UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than...
WarningPHPMail=WARNING: Some email providers (like Yahoo) does not allow you to send an email from another server than the Yahoo server if the email address used as a sender is your Yahoo email (like myemail@yahoo.com, myemail@yahoo.fr, ...). Your current setup use the server of the application to send email, so some recipients (the one compatible with the restrictive DMARC protocol), will ask Yahoo if they can accept your email and Yahoo will respond "no" because the server is not a server owned by Yahoo, so few of your sent Emails may not be accepted.<br>If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account).
# Modules # Modules
Module0Name=Users & groups Module0Name=Users & groups

View File

@ -27,7 +27,7 @@ DeleteAMailing=Delete an emailing
PreviewMailing=Preview emailing PreviewMailing=Preview emailing
CreateMailing=Create emailing CreateMailing=Create emailing
TestMailing=Test email TestMailing=Test email
ValidMailing=Valid emailing ValidMailing=Validate emailing
MailingStatusDraft=Draft MailingStatusDraft=Draft
MailingStatusValidated=Validated MailingStatusValidated=Validated
MailingStatusSent=Sent MailingStatusSent=Sent

View File

@ -48,7 +48,6 @@ $search_agenda_label=GETPOST('search_agenda_label');
// Security check // Security check
$socid=0; $socid=0;
$id = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'projet',$id,''); $result=restrictedArea($user,'projet',$id,'');
@ -80,11 +79,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$form = new Form($db); $form = new Form($db);
$object = new Project($db); $object = new Project($db);
$title=$langs->trans("Project").' - '.$object->ref.' '.$object->name;
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref.' '.$object->name.' - '.$langs->trans("Info");
$help_url="EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos";
llxHeader("",$title,$help_url);
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
$object->fetch($id, $ref); $object->fetch($id, $ref);
@ -92,6 +86,11 @@ if ($id > 0 || ! empty($ref))
$object->info($object->id); $object->info($object->id);
} }
$title=$langs->trans("Project").' - '.$object->ref.' '.$object->name;
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref.' '.$object->name.' - '.$langs->trans("Info");
$help_url="EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos";
llxHeader("",$title,$help_url);
$head = project_prepare_head($object); $head = project_prepare_head($object);
dol_fiche_head($head, 'agenda', $langs->trans("Project"), 0, ($object->public?'projectpub':'project')); dol_fiche_head($head, 'agenda', $langs->trans("Project"), 0, ($object->public?'projectpub':'project'));
@ -162,6 +161,10 @@ print '</div>';
if (!empty($object->id)) if (!empty($object->id))
{ {
$param='&id='.$object->id;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print load_fiche_titre($langs->trans("ActionsOnProject"),'',''); print load_fiche_titre($langs->trans("ActionsOnProject"),'','');
// List of actions on element // List of actions on element

View File

@ -51,13 +51,13 @@ $hookmanager->initHooks(array('element_resource'));
$object->available_resources = array('dolresource'); $object->available_resources = array('dolresource');
// Get parameters // Get parameters
$id = GETPOST('id','int'); $id = GETPOST('id','int'); // resource id
$ref = GETPOST('ref','alpha'); $element_id = GETPOST('element_id','int'); // element_id
$element_ref = GETPOST('ref','alpha'); // element ref
$element = GETPOST('element','alpha'); // element_type
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$mode = GETPOST('mode','alpha'); $mode = GETPOST('mode','alpha');
$lineid = GETPOST('lineid','int'); $lineid = GETPOST('lineid','int');
$element = GETPOST('element','alpha'); // element_type
$element_id = GETPOST('element_id','int');
$resource_id = GETPOST('fk_resource','int'); $resource_id = GETPOST('fk_resource','int');
$resource_type = GETPOST('resource_type','alpha'); $resource_type = GETPOST('resource_type','alpha');
$busy = GETPOST('busy','int'); $busy = GETPOST('busy','int');
@ -66,7 +66,7 @@ $cancel = GETPOST('cancel','alpha');
$confirm = GETPOST('confirm','alpha'); $confirm = GETPOST('confirm','alpha');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
if ($socid > 0) if ($socid > 0) // Special for thirdparty
{ {
$element_id = $socid; $element_id = $socid;
$element = 'societe'; $element = 'societe';
@ -183,11 +183,11 @@ else
// Specific to agenda module // Specific to agenda module
if ($element_id && $element == 'action') if (($element_id || $element_ref) && $element == 'action')
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
$act = fetchObjectByElement($element_id,$element); $act = fetchObjectByElement($element_id,$element, $element_ref);
if (is_object($act)) if (is_object($act))
{ {
@ -212,16 +212,10 @@ else
$linkback.=$out; $linkback.=$out;
dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '', "&element=".$element); dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '', '&element='.$element, 0, '', '');
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
// Ref
/*print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print '</td></tr>';*/
// Affichage fiche action en mode visu
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Type // Type
@ -248,11 +242,6 @@ else
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>'; print '</td></tr>';
// Status
/*print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
print $act->getLibStatut(4);
print '</td></tr>';*/
// Location // Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{ {
@ -301,9 +290,9 @@ else
} }
// Specific to thirdparty module // Specific to thirdparty module
if ($element_id && $element == 'societe') if (($element_id || $element_ref) && $element == 'societe')
{ {
$socstatic = fetchObjectByElement($element_id, $element); $socstatic = fetchObjectByElement($element_id, $element, $element_ref);
if (is_object($socstatic)) { if (is_object($socstatic)) {
$savobject = $object; $savobject = $object;
@ -314,7 +303,7 @@ else
dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"), 0, 'company'); dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($socstatic, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom'); dol_banner_tab($socstatic, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom', '', '&element='.$element);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
@ -337,12 +326,12 @@ else
} }
// Specific to fichinter module // Specific to fichinter module
if ($element_id && $element == 'fichinter') if (($element_id || $element_ref) && $element == 'fichinter')
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
$fichinter = new Fichinter($db); $fichinter = new Fichinter($db);
$fichinter->fetch($element_id); $fichinter->fetch($element_id, $element_ref);
$fichinter->fetch_thirdparty(); $fichinter->fetch_thirdparty();
if (is_object($fichinter)) if (is_object($fichinter))
@ -395,7 +384,7 @@ else
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
dol_banner_tab($fichinter, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); dol_banner_tab($fichinter, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '&element='.$element, 0, '', '', 1);
dol_fiche_end(); dol_fiche_end();
} }
@ -403,7 +392,7 @@ else
// hook for other elements linked // hook for other elements linked
$parameters=array('element'=>$element, 'element_id'=>$element_id ); $parameters=array('element'=>$element, 'element_id'=>$element_id, 'element_ref'=>$element_ref);
$reshook=$hookmanager->executeHooks('printElementTab',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('printElementTab',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -1408,17 +1408,6 @@ if ($action == 'create')
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref
/*
print '<tr><td class="titlefield">' . $langs->trans('Ref') . '</td><td colspan="5">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';
// Company
print '<tr><td>' . $langs->trans('Supplier') . '</td><td colspan="5">' . $soc->getNomUrl(1) . '</td>';
print '</tr>';
*/
// Payment term // Payment term
print '<tr><td class="titlefield">'; print '<tr><td class="titlefield">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';

View File

@ -93,26 +93,70 @@ if ($object->id > 0)
$totalsize+=$file['size']; $totalsize+=$file['size'];
} }
// Supplier proposal card
$linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
// Ref supplier
//$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
//$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->supplier_proposal->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border"width="100%">'; print '<table class="border"width="100%">';
$linkback='<a href="'.DOL_URL_ROOT.'/supplier_proposal/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
print '</td></tr>';
// Supplier
print "<tr><td>".$langs->trans("Supplier")."</td>";
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end();
$modulepart = 'supplier_proposal'; $modulepart = 'supplier_proposal';
$permission = $user->rights->supplier_proposal->creer; $permission = $user->rights->supplier_proposal->creer;
$permtoedit = $user->rights->supplier_proposal->creer; $permtoedit = $user->rights->supplier_proposal->creer;

View File

@ -49,10 +49,65 @@ $object = new SupplierProposal($db);
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$object->info($object->id);
$head = supplier_proposal_prepare_head($object); $head = supplier_proposal_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans('CommRequest'), 0, 'supplier_proposal'); dol_fiche_head($head, 'info', $langs->trans('CommRequest'), 0, 'supplier_proposal');
$object->info($object->id); // Supplier proposal card
$linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
// Ref supplier
//$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
//$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->supplier_proposal->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';
dol_print_object_info($object); dol_print_object_info($object);
@ -60,6 +115,7 @@ print '</td></tr></table>';
print '</div>'; print '</div>';
dol_fiche_end();
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -45,19 +45,18 @@ $object = new SupplierProposal($db);
/******************************************************************************/ /*
/* Actions */ * Actions
/******************************************************************************/ */
$permissionnote=$user->rights->supplier_proposal->creer; // Used by the include of actions_setnotes.inc.php $permissionnote=$user->rights->supplier_proposal->creer; // Used by the include of actions_setnotes.inc.php
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
/*
/******************************************************************************/ * View
/* Affichage fiche */ */
/******************************************************************************/
llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur'); llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur');
@ -71,48 +70,72 @@ if ($id > 0 || ! empty($ref))
if ($object->fetch($id, $ref)) if ($object->fetch($id, $ref))
{ {
$object->fetch_thirdparty();
$societe = new Societe($db); $societe = new Societe($db);
if ( $societe->fetch($object->socid) ) if ( $societe->fetch($object->socid) )
{ {
$head = supplier_proposal_prepare_head($object); $head = supplier_proposal_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans('CommRequest'), 0, 'supplier_proposal'); dol_fiche_head($head, 'note', $langs->trans('CommRequest'), 0, 'supplier_proposal');
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/supplier_proposal/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans('BackToList').'</a>'; // Supplier proposal card
$linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
print '</td></tr>';
// Customer $morehtmlref='<div class="refidno">';
if ( is_null($object->thirdparty) ) // Ref supplier
$object->fetch_thirdparty(); //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
print "<tr><td>".$langs->trans("Supplier")."</td>"; //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>'; // Thirdparty
$morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->supplier_proposal->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
// Payment term
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort');
print '</td>';
print '</tr></table>';
print '</td><td colspan="3">';
$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'none', 1);
print '</td>';
print '</tr>';
print '<tr><td>'.$langs->trans('SupplierProposalDate').'</td><td colspan="3">';
print dol_print_date($object->date_livraison,'daytext');
print '</td>';
print '</tr>';
print "</table>"; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<br>';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$cssclass="titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
print '</div>';
dol_fiche_end(); dol_fiche_end();
} }
} }

View File

@ -254,6 +254,7 @@ a.tab { font-weight: bold !important; }
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: normal; color: rgb(<?php print $colortextlink; ?>); text-decoration: none; } a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: normal; color: rgb(<?php print $colortextlink; ?>); text-decoration: none; }
a:hover { text-decoration: underline; color: rgb(<?php print $colortextlink; ?>); } a:hover { text-decoration: underline; color: rgb(<?php print $colortextlink; ?>); }
a.commonlink { color: rgb(<?php print $colortextlink; ?>) !important; text-decoration: none; }
input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {
background-color: #FFF; background-color: #FFF;
@ -967,12 +968,13 @@ div.attacharea {
} }
div.arearef { div.arearef {
/*border-bottom: 1px solid #bbb;*/
padding-top: 2px; padding-top: 2px;
padding-bottom: 5px;
/*padding-right: 3px;
padding-left: 2px;*/
margin-bottom: 10px; margin-bottom: 10px;
padding-bottom: 7px;
}
div.arearefnobottom {
padding-top: 2px;
padding-bottom: 4px;
} }
div.heightref { div.heightref {
min-height: 80px; min-height: 80px;
@ -1961,15 +1963,8 @@ div.tabBar {
color: #<?php echo $colortextbacktab; ?>; color: #<?php echo $colortextbacktab; ?>;
padding-top: 16px; padding-top: 16px;
padding-left: 0px; padding-right: 0px; padding-left: 0px; padding-right: 0px;
/*padding-left: 18px;
padding-right: 18px;*/
padding-bottom: 14px; padding-bottom: 14px;
margin: 0px 0px 14px 0px; margin: 0px 0px 14px 0px;
/*-moz-border-radius:4px;
-webkit-border-radius: 4px;
border-radius: 4px;
border-right: 1px solid #AAA;
border-left: 1px solid #AAA; */
border-top: 1px solid #BBB; border-top: 1px solid #BBB;
border-bottom: 1px solid #AAA; border-bottom: 1px solid #AAA;
width: auto; width: auto;
@ -2456,11 +2451,16 @@ table.liste tr, table.noborder tr, div.noborder form {
table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.noborder tr.box_titre td { table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.noborder tr.box_titre td {
padding: 8px 2px 8px 3px; /* t r b l */ padding: 8px 2px 8px 3px; /* t r b l */
} }
tr.box_titre .nobordernopadding td { padding: 0px ! important; } table.liste td, table.noborder td, div.noborder form div {
table.liste td, table.noborder td, div.noborder form, div.noborder form div { padding: 8px 2px 8px 3px; /* t r b l */
padding: 5px 2px 5px 3px; /* t r b l */ }
div.liste_titre_bydiv .divsearchfield {
padding: 2px 1px 2px 0px; /* t r b l */
} }
tr.box_titre .nobordernopadding td {
padding: 0px ! important;
}
table.nobordernopadding { table.nobordernopadding {
border-collapse: collapse !important; border-collapse: collapse !important;
border: 0px; border: 0px;
@ -2725,7 +2725,7 @@ tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair
padding: 5px 2px 5px 3px; padding: 5px 2px 5px 3px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td { form.tagtr:last-of-type div.tagtd, tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td {
border-bottom: 0px !important; border-bottom: 0px !important;
} }
tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td { tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td {
@ -2737,26 +2737,18 @@ td.nobottom, td.nobottom {
div.liste_titre .tagtd { div.liste_titre .tagtd {
vertical-align: middle; vertical-align: middle;
} }
div.liste_titre { /*div.liste_titre {
box-shadow: 2px 2px 4px #CCC; box-shadow: 2px 2px 4px #CCC;
} }*/
div.liste_titre { div.liste_titre {
min-height: 26px !important; /* We cant use height because it's a div and it should be higher if content is more. but min-height does not work either for div */ min-height: 26px !important; /* We cant use height because it's a div and it should be higher if content is more. but min-height does not work either for div */
padding-top: 2px; padding-top: 2px;
padding-bottom: 2px; padding-bottom: 2px;
/*border-right-width: 1px; /* border-top-width: 1px;
border-right-color: #BBB;
border-right-style: solid;
border-left-width: 1px;
border-left-color: #BBB;
border-left-style: solid;*/
border-top-width: 1px;
border-top-color: #BBB; border-top-color: #BBB;
border-top-style: solid; border-top-style: solid;*/
} }
div.liste_titre_bydiv { div.liste_titre_bydiv {
border-top-width: <?php echo $borderwith ?>px; border-top-width: <?php echo $borderwith ?>px;
@ -2773,7 +2765,7 @@ tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, tabl
{ {
height: 26px !important; height: 26px !important;
} }
div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
{ {
<?php if ($usegradienttitle) { ?> <?php if ($usegradienttitle) { ?>
background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.4) 100%); background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.4) 100%);
@ -2791,11 +2783,11 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list
border-bottom: 1px solid #FDFFFF; border-bottom: 1px solid #FDFFFF;
text-align: <?php echo $left; ?>; text-align: <?php echo $left; ?>;
} }
tr.liste_titre th, tr.liste_titre td, th.liste_titre, form.liste_titre div, div.liste_titre tr.liste_titre th, tr.liste_titre td, th.liste_titre
{ {
border-bottom: 1px solid #<?php echo ($colorbacktitle1 == '255,255,255'?'BBBBBB':'FDFFFF'); ?>; border-bottom: 1px solid #<?php echo ($colorbacktitle1 == '255,255,255'?'BBBBBB':'FDFFFF'); ?>;
} }
tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div, div.liste_titre tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div
{ {
font-family: <?php print $fontlist ?>; font-family: <?php print $fontlist ?>;
font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>; font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>;
@ -2819,7 +2811,7 @@ tr.liste_titre_topborder td {
.liste_titre td a.notasortlink:hover { .liste_titre td a.notasortlink:hover {
background: transparent; background: transparent;
} }
tr.liste_titre td.liste_titre { /* For last line of table headers only */ tr.liste_titre td.liste_titre, form.liste_titre div.tagtd { /* For last line of table headers only */
border-bottom: 1px solid rgb(<?php echo $colortopbordertitle1 ?>); border-bottom: 1px solid rgb(<?php echo $colortopbordertitle1 ?>);
} }

View File

@ -254,6 +254,7 @@ a.tab { font-weight: bold !important; }
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: normal; color: rgb(<?php print $colortextlink; ?>); text-decoration: none; } a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: normal; color: rgb(<?php print $colortextlink; ?>); text-decoration: none; }
a:hover { text-decoration: underline; color: rgb(<?php print $colortextlink; ?>); } a:hover { text-decoration: underline; color: rgb(<?php print $colortextlink; ?>); }
a.commonlink { color: rgb(<?php print $colortextlink; ?>) !important; text-decoration: none; }
input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {
background-color: #FDFDFD; background-color: #FDFDFD;
@ -1016,13 +1017,14 @@ div.attacharea {
padding-bottom: 10px; padding-bottom: 10px;
} }
div.arearef { div.arearef {
/*border-bottom: 1px solid #bbb;*/
padding-top: 2px; padding-top: 2px;
padding-bottom: 5px; padding-bottom: 5px;
/*padding-right: 3px;
padding-left: 2px;*/
margin-bottom: 10px; margin-bottom: 10px;
} }
div.arearefnobottom {
padding-top: 2px;
padding-bottom: 4px;
}
div.heightref { div.heightref {
min-height: 80px; min-height: 80px;
} }
@ -2379,6 +2381,13 @@ table.noborder td, div.noborder form, div.noborder form div {
padding: 4px 2px 4px 3px; /* t r b l */ padding: 4px 2px 4px 3px; /* t r b l */
} }
table.liste td, table.noborder td, div.noborder form div {
padding: 8px 2px 8px 3px; /* t r b l */
}
div.liste_titre_bydiv .divsearchfield {
padding: 2px 1px 2px 0px; /* t r b l */
}
table.nobordernopadding { table.nobordernopadding {
border-collapse: collapse !important; border-collapse: collapse !important;
border: 0px; border: 0px;

View File

@ -207,9 +207,9 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
print __METHOD__." Result code for creating user ".var_export($result, true)."\n"; print __METHOD__." Result code for creating user ".var_export($result, true)."\n";
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n"; print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
$this->assertEquals($result['curl_error_no'],''); $this->assertEquals($result['curl_error_no'],'');
$object=json_decode($result['content'], true); $resid=json_decode($result['content'], true);
$this->assertNotNull($object, "Parsing of json result must no be null"); $this->assertNotNull($resid, "Parsing of json result must no be null");
$this->assertGreaterThan(0, $object['id'], $object['error']['code'].' '.$object['error']['message']); $this->assertGreaterThan(0, $resid, $object['error']['code'].' '.$object['error']['message']);
// attempt to create duplicated user // attempt to create duplicated user
print __METHOD__." Request POST url=".$url."\n"; print __METHOD__." Request POST url=".$url."\n";