Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop_mc
This commit is contained in:
commit
9c2d053f74
@ -16,6 +16,8 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* The substitution key for reference of object is now __REF__ whatever is the object (it replaces __ORDERREF__,
|
||||
__PROPALREF__, ...)
|
||||
* Some REST API to access the dictionary (country, town, ...) were moved into a common API.
|
||||
* Page bank/index.php and bank/bankentries.php were renamed into bank/list.php and bank/bankentries_list.php to
|
||||
follow page naming conventions (so default filter/sort order features can also work).
|
||||
|
||||
|
||||
***** ChangeLog for 6.0.1 compared to 6.0.* *****
|
||||
|
||||
1
dev/resources/iso-normes/code_nace.txt
Normal file
1
dev/resources/iso-normes/code_nace.txt
Normal file
@ -0,0 +1 @@
|
||||
http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_CLS_DLD&StrNom=NACE_REV2&StrLanguageCode=FR&StrLayoutCode=#
|
||||
@ -87,21 +87,21 @@ if ($object->id > 0)
|
||||
|
||||
dol_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
$object->info($id);
|
||||
print dol_print_object_info($object, 1);
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'action
|
||||
|
||||
@ -1431,7 +1431,7 @@ else
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
|
||||
if (! empty($conf->societe->enabled)) $rowspan++;
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
@ -1558,16 +1558,17 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpictoimg 0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
|
||||
* @param int $maxlen length max label
|
||||
* @param string $option Page for link
|
||||
* @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref
|
||||
* @param string $morecss Add more css on link
|
||||
* @return string Chaine avec URL
|
||||
* @param int $withpictoimg 0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
|
||||
* @param int $maxlen length max label
|
||||
* @param string $option Page for link
|
||||
* @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpictoimg=0,$maxlen=0,$option='card',$mode='',$morecss='')
|
||||
function getNomUrl($withpictoimg=0, $maxlen=0, $option='card', $mode='', $morecss='', $save_lastsearch_value=-1)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -1591,15 +1592,24 @@ class Adherent extends CommonObject
|
||||
$label.= '<br><b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs);
|
||||
$label.='</div>';
|
||||
|
||||
if ($option == 'card' || $option == 'category')
|
||||
if (empty($option) || $option == 'card' || $option == 'category')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.'"';
|
||||
$url = DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id;
|
||||
}
|
||||
if ($option == 'subscription')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$this->id.'"';
|
||||
$url = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$this->id;
|
||||
}
|
||||
|
||||
if ($option != 'nolink')
|
||||
{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
}
|
||||
|
||||
$link = '<a href="'.$url.'"';
|
||||
$linkclose="";
|
||||
if (empty($notooltip))
|
||||
{
|
||||
|
||||
@ -94,7 +94,7 @@ if ($id > 0)
|
||||
$result=$membert->fetch($object->typeid);
|
||||
if ($result > 0)
|
||||
{
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
$totalsize=0;
|
||||
@ -102,7 +102,7 @@ if ($id > 0)
|
||||
{
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->notification->enabled))
|
||||
$langs->load("mails");
|
||||
|
||||
@ -110,12 +110,12 @@ if ($id > 0)
|
||||
|
||||
dol_fiche_head($head, 'document', $langs->trans("Member"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
@ -153,7 +153,7 @@ if ($id > 0)
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
$modulepart = 'member';
|
||||
|
||||
@ -96,7 +96,7 @@ $head = member_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'ldap', $langs->trans("Member"), 0, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
@ -74,12 +74,12 @@ if ($id)
|
||||
print "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
@ -601,7 +601,7 @@ if ($rowid > 0)
|
||||
|
||||
dol_fiche_head($head, 'subscription', $langs->trans("Member"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
@ -365,7 +365,7 @@ if ($rowid > 0)
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("MemberType"), -1, 'group');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ $head = member_type_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'ldap', $langs->trans("MemberType"), -1, 'group');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
@ -269,12 +269,12 @@ if ($mode != 'focus')
|
||||
{
|
||||
if ($mode != 'sortorder')
|
||||
{
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, array('object')); // Must match list into GETPOST
|
||||
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 2, array('object','objectamount')); // Must match list into GETPOST
|
||||
unset($substitutionarray['__USER_SIGNATURE__']);
|
||||
$texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
foreach($substitutionarray as $key => $val)
|
||||
{
|
||||
$texthelp.=$key.'<br>';
|
||||
$texthelp.=$key.' -> '.$val.'<br>';
|
||||
}
|
||||
$textvalue=$form->textwithpicto($langs->trans("Value"), $texthelp, 1, 'help', '', 0, 2, ''); // No tooltip on click, this also triggers the sort click
|
||||
}
|
||||
|
||||
@ -137,7 +137,17 @@ if ($action == 'update')
|
||||
}
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_METEO",$_POST["MAIN_DISABLE_METEO"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_METEO",$_POST["MAIN_DISABLE_METEO"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_USE_METEO_WITH_PERCENTAGE",GETPOST("MAIN_USE_METEO_WITH_PERCENTAGE"),'chaine',0,'',$conf->entity);
|
||||
|
||||
// For update value with percentage
|
||||
$plus='';
|
||||
if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE';
|
||||
// Update values
|
||||
for($i=0;$i<4;$i++) {
|
||||
if(isset($_POST['MAIN_METEO'.$plus.'_LEVEL'.$i])) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -196,13 +206,6 @@ if ($action == 'edit')
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
print '<br>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -244,21 +247,30 @@ else
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Boutons d'action
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="delais.php?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Show logo for weather
|
||||
print $langs->trans("DescWeather").'<br>';
|
||||
|
||||
if($action == 'edit') {
|
||||
|
||||
$str_mode_std = $langs->trans('MeteoStdModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->trans('MeteoPercentageMod'));
|
||||
$str_mode_percentage = $langs->trans('MeteoPercentageModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->trans('MeteoStdMod'));
|
||||
if(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $str_mode_enabled = $str_mode_std;
|
||||
else $str_mode_enabled = $str_mode_percentage;
|
||||
print '<a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>';
|
||||
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.$conf->global->MAIN_USE_METEO_WITH_PERCENTAGE.'" />';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
} else {
|
||||
if(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) print $langs->trans('MeteoStdModEnabled');
|
||||
else print $langs->trans('MeteoPercentageModEnabled');
|
||||
print '<br><br>';
|
||||
}
|
||||
|
||||
$offset=0;
|
||||
$cursor=10; // By default
|
||||
//if (! empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET;
|
||||
@ -267,36 +279,143 @@ $level0=$offset; if (! empty($conf->global->MAIN_METEO_LEVEL0)) $level
|
||||
$level1=$offset+1*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL1)) $level1=$conf->global->MAIN_METEO_LEVEL1;
|
||||
$level2=$offset+2*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL2)) $level2=$conf->global->MAIN_METEO_LEVEL2;
|
||||
$level3=$offset+3*$cursor; if (! empty($conf->global->MAIN_METEO_LEVEL3)) $level3=$conf->global->MAIN_METEO_LEVEL3;
|
||||
$text=''; $options='height="60px"';
|
||||
print '<table>';
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print img_weather($text,'weather-clear.png',$options);
|
||||
print '</td><td>= '.$level0.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>';
|
||||
print img_weather($text,'weather-few-clouds.png',$options);
|
||||
print '</td><td><= '.$level1.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>';
|
||||
print img_weather($text,'weather-clouds.png',$options);
|
||||
print '</td><td><= '.$level2.'</td>';
|
||||
print '</tr>';
|
||||
$text=''; $options='class="valignmiddle" height="60px"';
|
||||
|
||||
print '<tr><td>';
|
||||
print img_weather($text,'weather-many-clouds.png',$options);
|
||||
print '</td><td><= '.$level3.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>';
|
||||
print img_weather($text,'weather-storm.png',$options);
|
||||
print '</td><td>> '.$level3.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
if ($action == 'edit') {
|
||||
|
||||
|
||||
print '<div id="standard" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '' : 'style="display:none;"').'>';
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-clear.png', $options);
|
||||
print '= <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-few-clouds.png',$options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-clouds.png',$options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.'"/></td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-many-clouds.png',$options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.'"/></td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<div id="percentage" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'style="display:none;"' : '').'>';
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-clear.png',$options);
|
||||
print '= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-few-clouds.png',$options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-clouds.png',$options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'"/> %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-many-clouds.png',$options);
|
||||
print '<= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'"/> %</td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#change_mode").click(function() {
|
||||
var use_percent = $("#MAIN_USE_METEO_WITH_PERCENTAGE");
|
||||
var str_mode_std = "<?php print $str_mode_std; ?>";
|
||||
var str_mode_percentage = "<?php print $str_mode_percentage; ?>";
|
||||
|
||||
if(use_percent.val() == 1) {
|
||||
use_percent.val(0);
|
||||
$("#standard").show();
|
||||
$("#percentage").hide();
|
||||
$(this).html(str_mode_std);
|
||||
} else {
|
||||
use_percent.val(1);
|
||||
$("#standard").hide();
|
||||
$("#percentage").show();
|
||||
$(this).html(str_mode_percentage);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
} else {
|
||||
|
||||
if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-clear.png',$options);
|
||||
print '= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.' %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-few-clouds.png',$options);
|
||||
print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.' %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-clouds.png',$options);
|
||||
print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.' %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-many-clouds.png',$options);
|
||||
print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %</td>';
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-storm.png',$options);
|
||||
print '> '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %</td>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
} else {
|
||||
|
||||
print '<div>';
|
||||
print '<div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-clear.png',$options);
|
||||
print '= '.$level0;
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-few-clouds.png',$options);
|
||||
print '<= '.$level1;
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-clouds.png',$options);
|
||||
print '<= '.$level2;
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-many-clouds.png',$options);
|
||||
print '<= '.$level3;
|
||||
print '</div><div class="inline-block" style="padding-right: 20px">';
|
||||
print img_weather($text,'weather-storm.png',$options);
|
||||
print '> '.$level3;
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
if($action == 'edit') {
|
||||
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
print '<br></form>';
|
||||
|
||||
} else {
|
||||
|
||||
// Boutons d'action
|
||||
print '<br><div class="tabsAction">';
|
||||
print '<a class="butAction" href="delais.php?action=edit">'.$langs->trans("Modify").'</a></div>';
|
||||
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -56,9 +56,14 @@ class DolibarrApi
|
||||
$this->db = $db;
|
||||
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
|
||||
$this->r = new Restler($production_mode, $refreshCache);
|
||||
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
$this->r->setBaseUrls(DOL_MAIN_URL_ROOT, $urlwithroot);
|
||||
|
||||
$urlwithouturlrootautodetect=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim(DOL_MAIN_URL_ROOT));
|
||||
$urlwithrootautodetect=$urlwithouturlroot.DOL_URL_ROOT; // This is to use local domain autodetected by dolibarr from url
|
||||
|
||||
$this->r->setBaseUrls($urlwithouturlroot, $urlwithouturlrootautodetect);
|
||||
$this->r->setAPIVersion(1);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Neil Orley <neil.orley@oeris.fr>
|
||||
/* Copyright (C) 2016 Xebax Christy <xebax@wanadoo.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2017 Neil Orley <neil.orley@oeris.fr>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -21,7 +25,7 @@ require_once DOL_DOCUMENT_ROOT.'/main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
|
||||
|
||||
/**
|
||||
* API class for payment type (content of the paiement dictionary)
|
||||
* API class for dictionaries
|
||||
*
|
||||
* @access protected
|
||||
* @class DolibarrApiAccess {@requires user,external}
|
||||
@ -47,13 +51,14 @@ class Dictionary extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number {@min 0}
|
||||
* @param int $active Payment type is active or not {@min 0} {@max 1}
|
||||
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
|
||||
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'CHQ')"
|
||||
*
|
||||
* @url GET payments
|
||||
* @url GET payment/types
|
||||
*
|
||||
* @return List of payment types
|
||||
*
|
||||
* @throws RestException
|
||||
* @return array [List of payment types]
|
||||
*
|
||||
* @throws 400 RestException
|
||||
* @throws 200 OK
|
||||
*/
|
||||
function getPaymentTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
@ -67,9 +72,9 @@ class Dictionary extends DolibarrApi
|
||||
{
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
@ -94,7 +99,7 @@ class Dictionary extends DolibarrApi
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of payment types : '.$this->db->lasterror());
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
@ -447,6 +452,68 @@ class Dictionary extends DolibarrApi
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of payments terms.
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number {@min 0}
|
||||
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
||||
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
|
||||
*
|
||||
* @url GET payment/terms
|
||||
*
|
||||
* @return array List of payment terms
|
||||
*
|
||||
* @throws 400 RestException
|
||||
* @throws 200 OK
|
||||
*/
|
||||
function getPaymentTerms($sortfield = "sortorder", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT rowid as id, code, sortorder, libelle as label, libelle_facture as descr, type_cdr, nbjour, decalage, module";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_payment_term as t";
|
||||
$sql.= " WHERE t.active = ".$active;
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(400, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $this->db->order($sortfield, $sortorder);
|
||||
|
||||
if ($limit) {
|
||||
if ($page < 0) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql .= $this->db->plimit($limit, $offset);
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ use Luracast\Restler\Format\UploadFormat;
|
||||
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
/**
|
||||
* API class for receive files
|
||||
@ -54,13 +55,57 @@ class Documents extends DolibarrApi
|
||||
*
|
||||
* @param string $module_part Name of module or area concerned by file download ('facture', ...)
|
||||
* @param string $ref Reference of object (This will define subdir automatically)
|
||||
* @param string $subdir Subdirectory (Only if ref not provided)
|
||||
* @param string $subdir NOT YET AVAILABLE : Subdirectory (Only if ref not provided)
|
||||
* @return array List of documents
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws 400
|
||||
* @throws 401
|
||||
* @throws 200 OK
|
||||
*/
|
||||
public function index($module_part, $ref='', $subdir='') {
|
||||
return array('note'=>'FeatureNotYetAvailable');
|
||||
global $conf;
|
||||
|
||||
if (empty($module_part)) {
|
||||
throw new RestException(400, 'bad value for parameter modulepart');
|
||||
}
|
||||
if (empty($ref) && empty($subdir)) {
|
||||
throw new RestException(400, 'bad value for parameter ref or subdir');
|
||||
}
|
||||
if (empty($ref)) {
|
||||
throw new RestException(404, 'FeatureNotYetAvailable');
|
||||
}
|
||||
if (!DolibarrApiAccess::$user->rights->ecm->read) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$original_file = str_replace("../","/", $ref.'/'.$ref.'.pdf');
|
||||
$refname=basename(dirname($original_file)."/");
|
||||
$entity=$conf->entity;
|
||||
|
||||
$check_access = dol_check_secure_access_document($module_part,$original_file,$entity,DolibarrApiAccess::$user);
|
||||
$accessallowed = $check_access['accessallowed'];
|
||||
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
|
||||
$original_file = $check_access['original_file'];
|
||||
|
||||
if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file))
|
||||
{
|
||||
throw new RestException(401);
|
||||
}
|
||||
if (!$accessallowed) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$filename = basename($original_file);
|
||||
$original_file_osencoded=dol_osencode($original_file); // New file name encoded in OS encoding charset
|
||||
|
||||
if (! file_exists($original_file_osencoded))
|
||||
{
|
||||
throw new RestException(404, 'File not found');
|
||||
}
|
||||
|
||||
$file_content=file_get_contents($original_file_osencoded);
|
||||
return array('filename'=>$filename, 'content'=>base64_encode($file_content), 'encoding'=>'MIME base64 (base64_encode php function, http://php.net/manual/en/function.base64-encode.php)' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1202,14 +1202,13 @@ if ($id > 0)
|
||||
|
||||
// Link to other agenda views
|
||||
$out='';
|
||||
$out.=img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out.='<br>';
|
||||
$out.=img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out.=img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$linkback.=$out;
|
||||
|
||||
|
||||
@ -907,59 +907,66 @@ class ActionComm extends CommonObject
|
||||
return $db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param User $user Objet user
|
||||
* @param User $user Objet user
|
||||
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
function load_board($user)
|
||||
function load_board($user, $load_state_board=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$sql = "SELECT a.id, a.datep as dp";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= ")";
|
||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql.= " WHERE a.percent >= 0 AND a.percent < 100";
|
||||
$sql.= " AND a.entity IN (".getEntity('agenda').")";
|
||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
||||
if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
|
||||
if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$agenda_static = new ActionComm($this->db);
|
||||
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay = $conf->agenda->warning_delay/60/60/24;
|
||||
$response->label = $langs->trans("ActionsToDo");
|
||||
$response->url = DOL_URL_ROOT.'/comm/action/listactions.php?status=todo&mainmenu=agenda';
|
||||
if ($user->rights->agenda->allactions->read) $response->url.='&filtert=-1';
|
||||
$response->img = img_object('',"action",'class="inline-block valigntextmiddle"');
|
||||
|
||||
// This assignment in condition is not a bug. It allows walking the results.
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$response->nbtodo++;
|
||||
|
||||
$agenda_static->datep = $this->db->jdate($obj->dp);
|
||||
|
||||
if ($agenda_static->hasDelay()) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
global $conf, $langs;
|
||||
|
||||
if(empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp";
|
||||
else {
|
||||
$this->nb=array();
|
||||
$sql = "SELECT count(a.id) as nb";
|
||||
}
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= ")";
|
||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql.= " WHERE 1";
|
||||
if(empty($load_state_board)) $sql.= " AND a.percent >= 0 AND a.percent < 100";
|
||||
$sql.= " AND a.entity IN (".getEntity('agenda').")";
|
||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
||||
if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
|
||||
if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if(empty($load_state_board)) {
|
||||
$agenda_static = new ActionComm($this->db);
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay = $conf->agenda->warning_delay/60/60/24;
|
||||
$response->label = $langs->trans("ActionsToDo");
|
||||
$response->url = DOL_URL_ROOT.'/comm/action/listactions.php?status=todo&mainmenu=agenda';
|
||||
if ($user->rights->agenda->allactions->read) $response->url.='&filtert=-1';
|
||||
$response->img = img_object('',"action",'class="inline-block valigntextmiddle"');
|
||||
}
|
||||
// This assignment in condition is not a bug. It allows walking the results.
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
if(empty($load_state_board)) {
|
||||
$response->nbtodo++;
|
||||
$agenda_static->datep = $this->db->jdate($obj->dp);
|
||||
if ($agenda_static->hasDelay()) $response->nbtodolate++;
|
||||
} else $this->nb["actionscomm"]=$obj->nb;
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
if(empty($load_state_board)) return $response;
|
||||
else return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -128,14 +128,13 @@ if ($object->id > 0)
|
||||
|
||||
// Link to other agenda views
|
||||
$out='';
|
||||
$out.=img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out.='<br>';
|
||||
$out.=img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out.=img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
$linkback.=$out;
|
||||
|
||||
@ -51,6 +51,8 @@ $result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
@ -66,14 +68,13 @@ $linkback.= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("B
|
||||
|
||||
// Link to other agenda views
|
||||
$out='';
|
||||
$out.=img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out.='<br>';
|
||||
$out.=img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out.=img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||
$out.='</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
$linkback.=$out;
|
||||
|
||||
@ -1716,7 +1716,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '<input type="button" class="button" name="cancel" value="' . $langs->trans("Cancel") . '" onclick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -149,7 +149,7 @@ dol_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), -1, 'account'
|
||||
$title=$langs->trans("FinancialAccount")." : ".$object->label;
|
||||
$link=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?account=".$object->id."&year_start=".($year_start-1)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$object->id."&year_start=".($year_start+1)."'>".img_next('', 'class="valignbottom"')."</a>":"");
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
if (!empty($id))
|
||||
@ -203,7 +203,7 @@ print '</tr>';
|
||||
$var=true;
|
||||
for ($mois = 1 ; $mois < 13 ; $mois++)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>".dol_print_date(dol_mktime(1,1,1,$mois,1,2000),"%B")."</td>";
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/bankentries.php
|
||||
* \file htdocs/compta/bank/bankentries_list.php
|
||||
* \ingroup banque
|
||||
* \brief List of bank transactions
|
||||
*/
|
||||
@ -405,7 +405,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$head=bank_prepare_head($object);
|
||||
dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
|
||||
@ -447,7 +447,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($object->canBeConciliated() > 0) {
|
||||
// If not cash account and can be reconciliate
|
||||
if ($user->rights->banque->consolidate) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?action=reconcile&search_conciliated=0'.$param.'">'.$langs->trans("Conciliate").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&search_conciliated=0'.$param.'">'.$langs->trans("Conciliate").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
|
||||
}
|
||||
@ -559,7 +559,7 @@ if (! empty($thirdparty)) $mode_balance_ok=false;
|
||||
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
|
||||
dol_syslog('compta/bank/bankentries.php', LOG_DEBUG);
|
||||
dol_syslog('compta/bank/bankentries_list.php', LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -74,9 +74,9 @@ if ($result)
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><a href=\"".DOL_URL_ROOT."/compta/bank/bankentries.php?bid=$objp->rowid\">$objp->label</a></td>";
|
||||
print "<td><a href=\"".DOL_URL_ROOT."/compta/bank/bankentries_list.php?bid=$objp->rowid\">$objp->label</a></td>";
|
||||
print '<td align="right">'.$objp->nombre.'</td>';
|
||||
print '<td align="right">'.price(abs($objp->somme))."</td>";
|
||||
print '<td align="right">'.price(abs(price2num($objp->somme / $objp->nombre,'MT')))."</td>";
|
||||
|
||||
@ -262,7 +262,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
header("Location: ".DOL_URL_ROOT."/compta/bank/index.php");
|
||||
header("Location: ".DOL_URL_ROOT."/compta/bank/list.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -576,7 +576,7 @@ else
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
@ -1161,50 +1161,88 @@ class Account extends CommonObject
|
||||
*/
|
||||
function load_board(User $user, $filteraccountid = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
|
||||
$sql = "SELECT b.rowid, b.datev as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= " WHERE b.rappro=0";
|
||||
$sql.= " AND b.fk_account = ba.rowid";
|
||||
$sql.= " AND ba.entity IN (".getEntity('bank_account').")";
|
||||
$sql.= " AND (ba.rappro = 1 AND ba.courant != 2)"; // Compte rapprochable
|
||||
$sql.= " AND clos = 0";
|
||||
if ($filteraccountid) $sql.=" AND ba.rowid = ".$filteraccountid;
|
||||
$sql = "SELECT b.rowid, b.datev as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= " WHERE b.rappro=0";
|
||||
$sql.= " AND b.fk_account = ba.rowid";
|
||||
$sql.= " AND ba.entity IN (".getEntity('bank_account').")";
|
||||
$sql.= " AND (ba.rappro = 1 AND ba.courant != 2)"; // Compte rapprochable
|
||||
$sql.= " AND clos = 0";
|
||||
if ($filteraccountid) $sql.=" AND ba.rowid = ".$filteraccountid;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$langs->load("banks");
|
||||
$now=dol_now();
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$langs->load("banks");
|
||||
$now=dol_now();
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php';
|
||||
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->bank->rappro->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("TransactionsToConciliate");
|
||||
$response->url=DOL_URL_ROOT.'/compta/bank/index.php?leftmenu=bank&mainmenu=bank';
|
||||
$response->img=img_object('',"payment");
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->bank->rappro->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("TransactionsToConciliate");
|
||||
$response->url=DOL_URL_ROOT.'/compta/bank/list.php?leftmenu=bank&mainmenu=bank';
|
||||
$response->img=img_object('',"payment");
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$response->nbtodo++;
|
||||
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->rappro->warning_delay)) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$response->nbtodo++;
|
||||
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->rappro->warning_delay)) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
* @param int $filteraccountid To get info for a particular account id
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function load_state_board($filteraccountid = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
|
||||
$sql = "SELECT count(b.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= " WHERE b.fk_account = ba.rowid";
|
||||
$sql.= " AND ba.entity IN (".getEntity('bank_account').")";
|
||||
$sql.= " AND (ba.rappro = 1 AND ba.courant != 2)"; // Compte rapprochable
|
||||
$sql.= " AND clos = 0";
|
||||
if ($filteraccountid) $sql.=" AND ba.rowid = ".$filteraccountid;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["banklines"]=$obj->nb;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1241,14 +1279,15 @@ class Account extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto Include picto into link
|
||||
* @param string $mode ''=Link to card, 'transactions'=Link to transactions card
|
||||
* @param string $option ''=Show ref, 'reflabel'=Show ref+label
|
||||
* @return string Chaine avec URL
|
||||
* @param int $withpicto Include picto into link
|
||||
* @param string $mode ''=Link to card, 'transactions'=Link to transactions card
|
||||
* @param string $option ''=Show ref, 'reflabel'=Show ref+label
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $mode='', $option='')
|
||||
function getNomUrl($withpicto=0, $mode='', $option='', $save_lastsearch_value=-1)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -1268,20 +1307,28 @@ class Account extends CommonObject
|
||||
|
||||
if (empty($mode))
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id.$linkclose;
|
||||
$linkend='</a>';
|
||||
$url = DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id;
|
||||
}
|
||||
else if ($mode == 'transactions')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?id='.$this->id.$linkclose;
|
||||
$linkend='</a>';
|
||||
$url = DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$this->id;
|
||||
}
|
||||
else if ($mode == 'receipts')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$this->id.$linkclose;
|
||||
$linkend='</a>';
|
||||
$url = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$this->id;
|
||||
}
|
||||
|
||||
if ($option != 'nolink')
|
||||
{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
}
|
||||
|
||||
$link = '<a href="'.$url.$linkclose;
|
||||
$linkend='</a>';
|
||||
|
||||
if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' ');
|
||||
$result.=$link.$this->ref.($option == 'reflabel' && $this->label ? ' - '.$this->label : '').$linkend;
|
||||
return $result;
|
||||
|
||||
@ -117,7 +117,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ else
|
||||
dol_print_error($db);
|
||||
}
|
||||
if (empty($min)) $min = dol_now - 3600 * 24;
|
||||
|
||||
|
||||
$log="graph.php: min=".$min." max=".$max;
|
||||
dol_syslog($log);
|
||||
|
||||
@ -760,7 +760,7 @@ $head=bank_prepare_head($object);
|
||||
dol_fiche_head($head,'graph',$langs->trans("FinancialAccount"),0,'account');
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
if ($account)
|
||||
{
|
||||
|
||||
@ -58,7 +58,7 @@ $h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("LineRecord"), -1, 'account');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
@ -152,7 +152,7 @@ if ($user->rights->banque->modifier && $action == "update")
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$arrayofcategs=GETPOST('custcats', 'array');
|
||||
@ -175,8 +175,8 @@ if ($user->rights->banque->modifier && $action == "update")
|
||||
}
|
||||
// $arrayselected will be loaded after in page output
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
@ -296,14 +296,14 @@ if ($result)
|
||||
print '<input type="hidden" name="id" value="'.$acct->id.'">';
|
||||
|
||||
dol_fiche_head($tabs, 0, $langs->trans('LineRecord'), 0, 'account');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($bankline, 'rowid', $linkback);
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
@ -314,7 +314,7 @@ if ($result)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
|
||||
$i++;
|
||||
|
||||
// Bank account
|
||||
@ -582,7 +582,7 @@ if ($result)
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
$langs->load('categories');
|
||||
|
||||
|
||||
// Bank line
|
||||
print '<tr><td class="toptd">' . fieldLabel('RubriquesTransactions', 'custcats') . '</td><td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1);
|
||||
@ -591,28 +591,28 @@ if ($result)
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'"></div><br>';
|
||||
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Releve rappro
|
||||
if ($acct->canBeConciliated() > 0) // Si compte rapprochable
|
||||
{
|
||||
print load_fiche_titre($langs->trans("Reconciliation"), '', 'title_bank.png');
|
||||
print '<hr>'."\n";
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$objp->rowid.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setreconcile">';
|
||||
print '<input type="hidden" name="orig_account" value="'.$orig_account.'">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Conciliation")."</td>";
|
||||
@ -652,13 +652,13 @@ if ($result)
|
||||
print '</table>';
|
||||
|
||||
print '<div class="center">';
|
||||
|
||||
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
if ($backtopage)
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/index.php
|
||||
* \file htdocs/compta/bank/list.php
|
||||
* \ingroup banque
|
||||
* \brief Home page of bank module
|
||||
*/
|
||||
@ -611,7 +611,7 @@ foreach ($accounts as $key=>$type)
|
||||
if (! empty($arrayfields['balance']['checked']))
|
||||
{
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?id='.$obj->id.'">'.price($solde, 0, $langs, 0, 0, -1, $obj->currency_code).'</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$obj->id.'">'.price($solde, 0, $langs, 0, 0, -1, $obj->currency_code).'</a>';
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
|
||||
@ -328,7 +328,7 @@ if (empty($numref))
|
||||
$head=bank_prepare_head($object);
|
||||
dol_fiche_head($head,'statement',$langs->trans("FinancialAccount"),0,'account');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
|
||||
@ -340,7 +340,7 @@ if (empty($numref))
|
||||
if ($object->canBeConciliated() > 0) {
|
||||
// If not cash account and can be reconciliate
|
||||
if ($user->rights->banque->consolidate) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?action=reconcile&search_conciliated=0'.$param.'">'.$langs->trans("Conciliate").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&search_conciliated=0'.$param.'">'.$langs->trans("Conciliate").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
|
||||
}
|
||||
|
||||
@ -93,14 +93,14 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
$head=bank_prepare_head($object);
|
||||
dol_fiche_head($head, 'cash', $langs->trans("FinancialAccount"), -1, 'account');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
$solde = $object->solde(0);
|
||||
|
||||
// Show next coming entries
|
||||
@ -120,13 +120,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
$var=true;
|
||||
|
||||
// Current balance
|
||||
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="left" colspan="5">'.$langs->trans("CurrentBalance").'</td>';
|
||||
print '<td align="right" class="nowrap">'.price($solde).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="left" colspan="5">'.$langs->trans("RemainderToPay").'</td>';
|
||||
print '<td align="right" class="nowrap"> </td>';
|
||||
@ -295,7 +295,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
// We discard lines with a remainder to pay to 0
|
||||
if (price2num($total_ttc) != 0)
|
||||
{
|
||||
|
||||
|
||||
|
||||
// Show line
|
||||
print '<tr class="oddeven">';
|
||||
@ -320,7 +320,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
}
|
||||
|
||||
// Solde actuel
|
||||
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="left" colspan="5">'.$langs->trans("FutureBalance").' ('.$object->currency_code.')</td>';
|
||||
print '<td align="right" class="nowrap">'.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).'</td>';
|
||||
|
||||
@ -378,7 +378,59 @@ class Invoices extends DolibarrApi
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate an order
|
||||
* Sets an invoice as draft
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param int $idwarehouse Warehouse ID
|
||||
*
|
||||
* @url POST {id}/settodraft
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws 200
|
||||
* @throws 304
|
||||
* @throws 401
|
||||
* @throws 404
|
||||
* @throws 500
|
||||
*
|
||||
*/
|
||||
function settodraft($id, $idwarehouse=-1)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->set_draft(DolibarrApiAccess::$user, $idwarehouse);
|
||||
if ($result == 0) {
|
||||
throw new RestException(304, 'Nothing done.');
|
||||
}
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error : '.$this->invoice->error);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
return $this->_cleanObjectDatas($this->invoice);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate an invoice
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param int $idwarehouse Warehouse ID
|
||||
@ -411,20 +463,82 @@ class Invoices extends DolibarrApi
|
||||
|
||||
$result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger);
|
||||
if ($result == 0) {
|
||||
throw new RestException(500, 'Error nothing done. May be object is already validated');
|
||||
throw new RestException(304, 'Error nothing done. May be object is already validated');
|
||||
}
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when validating Invoice: '.$this->invoice->error);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Invoice validated (Ref='.$this->invoice->ref.')'
|
||||
)
|
||||
);
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
return $this->_cleanObjectDatas($this->invoice);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an invoice as paid
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple)
|
||||
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple)
|
||||
*
|
||||
* @url POST {id}/settopaid
|
||||
*
|
||||
* @return array An invoice object
|
||||
*
|
||||
* @throws 200
|
||||
* @throws 304
|
||||
* @throws 401
|
||||
* @throws 404
|
||||
* @throws 500
|
||||
*/
|
||||
function settopaid($id, $close_code='', $close_note='')
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->set_paid(DolibarrApiAccess::$user, $close_code, $close_note);
|
||||
if ($result == 0) {
|
||||
throw new RestException(304, 'Error nothing done. May be object is already validated');
|
||||
}
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error : '.$this->invoice->error);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
return $this->_cleanObjectDatas($this->invoice);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
|
||||
@ -1076,18 +1076,19 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable link of object (with eventually picto)
|
||||
* Return clicable link of object (with eventually picto)
|
||||
*
|
||||
* @param int $withpicto Add picto into link
|
||||
* @param string $option Where point the link
|
||||
* @param int $max Maxlength of ref
|
||||
* @param int $short 1=Return just URL
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $addlinktonotes 1=Add link to notes
|
||||
* @return string String with URL
|
||||
* @param int $withpicto Add picto into link
|
||||
* @param string $option Where point the link
|
||||
* @param int $max Maxlength of ref
|
||||
* @param int $short 1=Return just URL
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $addlinktonotes 1=Add link to notes
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='',$max=0,$short=0,$moretitle='',$notooltip=0,$addlinktonotes=0)
|
||||
function getNomUrl($withpicto=0, $option='', $max=0, $short=0, $moretitle='', $notooltip=0, $addlinktonotes=0, $save_lastsearch_value=-1)
|
||||
{
|
||||
global $langs, $conf, $user, $form;
|
||||
|
||||
@ -1100,6 +1101,14 @@ class Facture extends CommonInvoice
|
||||
|
||||
if ($short) return $url;
|
||||
|
||||
if ($option !== 'nolink')
|
||||
{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
}
|
||||
|
||||
$picto='bill';
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note
|
||||
@ -1737,7 +1746,7 @@ class Facture extends CommonInvoice
|
||||
* @param User $user User making the deletion.
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @return int <0 if KO, 0=Refused, >0 if OK
|
||||
*/
|
||||
function delete($user, $notrigger=0, $idwarehouse=-1)
|
||||
{
|
||||
@ -1748,9 +1757,13 @@ class Facture extends CommonInvoice
|
||||
|
||||
dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG);
|
||||
|
||||
// TODO Test if there is at least one payment. If yes, refuse to delete.
|
||||
// Test to avoid invoice deletion (allowed if draft)
|
||||
$test = $this->is_erasable();
|
||||
|
||||
if ($test <= 0) return $test;
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
@ -3356,9 +3369,9 @@ class Facture extends CommonInvoice
|
||||
/**
|
||||
* Return if an invoice can be deleted
|
||||
* Rule is:
|
||||
* If hidden option INVOICE_CAN_ALWAYS_BE_REMOVED is on, we can
|
||||
* If invoice has a definitive ref, is last, without payment and not dipatched into accountancy -> yes end of rule
|
||||
* If invoice is draft and ha a temporary ref -> yes
|
||||
* If hidden option INVOICE_CAN_ALWAYS_BE_REMOVED is on, we can. If hidden option INVOICE_CAN_NEVER_BE_REMOVED is on, we can't.
|
||||
* If invoice has a definitive ref, is last, without payment and not dipatched into accountancy -> yes end of rule
|
||||
*
|
||||
* @return int <0 if KO, 0=no, 1=yes
|
||||
*/
|
||||
@ -3366,30 +3379,36 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// on verifie si la facture est en numerotation provisoire
|
||||
$facref = substr($this->ref, 1, 4);
|
||||
|
||||
if ($this->statut == self::STATUS_DRAFT && $facref == 'PROV') // If draft invoice and ref not yet defined
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) return 1;
|
||||
if (! empty($conf->global->INVOICE_CAN_NEVER_BE_REMOVED)) return 0;
|
||||
|
||||
// on verifie si la facture est en numerotation provisoire
|
||||
$facref = substr($this->ref, 1, 4);
|
||||
// TODO Test if there is at least one payment. If yes, refuse to delete.
|
||||
// ...
|
||||
|
||||
// If not a draft invoice and not temporary invoice
|
||||
if ($facref != 'PROV')
|
||||
{
|
||||
$maxfacnumber = $this->getNextNumRef($this->thirdparty,'last');
|
||||
$ventilExportCompta = $this->getVentilExportCompta();
|
||||
|
||||
// If there is no invoice into the reset range and not already dispatched, we can delete
|
||||
if ($maxfacnumber == '' && $ventilExportCompta == 0) return 1;
|
||||
// If invoice to delete is last one and not already dispatched, we can delete
|
||||
if ($maxfacnumber == $this->ref && $ventilExportCompta == 0) return 1;
|
||||
|
||||
if ($this->situation_cycle_ref) {
|
||||
$last = $this->is_last_in_cycle();
|
||||
return $last;
|
||||
}
|
||||
}
|
||||
else if ($this->statut == self::STATUS_DRAFT && $facref == 'PROV') // Si facture brouillon et provisoire
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -139,13 +139,13 @@ if ($id > 0 || ! empty($ref))
|
||||
$head = facture_prepare_head($object);
|
||||
|
||||
$totalpaye = $object->getSommePaiement();
|
||||
|
||||
|
||||
dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), -1, 'bill');
|
||||
|
||||
// Invoice content
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
@ -186,11 +186,11 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -113,7 +113,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Invoice content
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
|
||||
@ -1169,7 +1169,7 @@ else
|
||||
|
||||
// Recurring invoice content
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/invoicetemplate_list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/invoicetemplate_list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref='';
|
||||
if ($action != 'editref') $morehtmlref.=$form->editfieldkey($object->ref, 'ref', $object->ref, $object, $user->rights->facture->creer, '', '', 0, 2);
|
||||
|
||||
@ -58,7 +58,7 @@ $totalpaye = $object->getSommePaiement();
|
||||
|
||||
// Invoice content
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
|
||||
@ -74,14 +74,14 @@ if ($id > 0 || ! empty($ref))
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$head = facture_prepare_head($object);
|
||||
|
||||
|
||||
$totalpaye = $object->getSommePaiement();
|
||||
|
||||
|
||||
dol_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill');
|
||||
|
||||
// Invoice content
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
@ -130,8 +130,8 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
|
||||
|
||||
$cssclass="titlefield";
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
|
||||
@ -151,7 +151,7 @@ if ($object->id > 0)
|
||||
|
||||
// Invoice content
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
@ -425,28 +425,28 @@ if ($object->id > 0)
|
||||
print '<tr><td>'.$langs->trans("RIB").'</td><td colspan="3">';
|
||||
print $object->thirdparty->display_rib();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency))
|
||||
{
|
||||
// Multicurrency Amount HT
|
||||
print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount VAT
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount TTC
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
@ -507,16 +507,16 @@ if ($object->id > 0)
|
||||
|
||||
// TODO Replace this by an include with same code to show already done payment visible in invoice card
|
||||
print '<tr><td>'.$langs->trans('RemainderToPay').'</td><td class="nowrap">'.price($resteapayer, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@ -612,7 +612,7 @@ if ($object->id > 0)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result_sql);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td align="left">'.dol_print_date($db->jdate($obj->date_demande),'day')."</td>\n";
|
||||
@ -640,7 +640,7 @@ if ($object->id > 0)
|
||||
}
|
||||
|
||||
// Closed requests
|
||||
|
||||
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande,";
|
||||
$sql.= " pfd.date_traite, pfd.fk_prelevement_bons, pfd.amount,";
|
||||
$sql.= " pb.ref,";
|
||||
@ -663,7 +663,7 @@ if ($object->id > 0)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
@ -526,21 +526,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
* List of unpaid invoices
|
||||
*/
|
||||
|
||||
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type, ';
|
||||
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type,';
|
||||
$sql.= ' f.datef as df, f.fk_soc as socid';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
|
||||
|
||||
if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS)) {
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON (f.fk_soc = s.rowid)';
|
||||
}
|
||||
|
||||
$sql.= ' WHERE f.entity = '.$conf->entity;
|
||||
$sql.= ' WHERE f.entity IN ('.getEntity('facture', $conf->entity).')';
|
||||
$sql.= ' AND (f.fk_soc = '.$facture->socid;
|
||||
|
||||
// Can pay invoices of all child of parent company
|
||||
if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS) && !empty($facture->thirdparty->parent)) {
|
||||
$sql.= ' OR f.fk_soc IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'societe WHERE parent = '.$facture->thirdparty->parent.')';
|
||||
}
|
||||
|
||||
// Can pay invoices of all child of myself
|
||||
if(!empty($conf->global->FACTURE_PAYMENTS_ON_SUBSIDIARY_COMPANIES)){
|
||||
$sql.= ' OR f.fk_soc IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'societe WHERE parent = '.$facture->thirdparty->id.')';
|
||||
}
|
||||
$sql.= ') AND f.paye = 0';
|
||||
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled
|
||||
if ($facture->type != 2)
|
||||
|
||||
@ -478,20 +478,20 @@ class RemiseCheque extends CommonObject
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param User $user Objet user
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param User $user Objet user
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
function load_board($user)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
|
||||
|
||||
$sql = "SELECT b.rowid, b.datev as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
@ -500,28 +500,28 @@ class RemiseCheque extends CommonObject
|
||||
$sql.= " AND b.fk_type = 'CHQ'";
|
||||
$sql.= " AND b.fk_bordereau = 0";
|
||||
$sql.= " AND b.amount > 0";
|
||||
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$langs->load("banks");
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->bank->cheque->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("BankChecksToReceipt");
|
||||
$response->url=DOL_URL_ROOT.'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank';
|
||||
$response->img=img_object('',"payment");
|
||||
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$response->nbtodo++;
|
||||
|
||||
|
||||
if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->cheque->warning_delay)) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $response;
|
||||
}
|
||||
else
|
||||
@ -531,6 +531,45 @@ class RemiseCheque extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
global $user;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
|
||||
$sql = "SELECT count(b.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= " WHERE b.fk_account = ba.rowid";
|
||||
$sql.= " AND ba.entity IN (".getEntity('bank_account').")";
|
||||
$sql.= " AND b.fk_type = 'CHQ'";
|
||||
$sql.= " AND b.amount > 0";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["cheques"]=$obj->nb;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -203,7 +203,7 @@ if ($resql)
|
||||
|
||||
// Bank
|
||||
print '<td>';
|
||||
if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.'</a>';
|
||||
if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.'</a>';
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -214,6 +214,12 @@ if ($action == 'create')
|
||||
$pastmonthyear--;
|
||||
}
|
||||
|
||||
$datespmonth = GETPOST('datespmonth', 'int');
|
||||
$datespday = GETPOST('datespday', 'int');
|
||||
$datespyear = GETPOST('datespyear', 'int');
|
||||
$dateepmonth = GETPOST('dateepmonth', 'int');
|
||||
$dateepday = GETPOST('dateepday', 'int');
|
||||
$dateepyear = GETPOST('dateepyear', 'int');
|
||||
$datesp=dol_mktime(0, 0, 0, $datespmonth, $datespday, $datespyear);
|
||||
$dateep=dol_mktime(23, 59, 59, $dateepmonth, $dateepday, $dateepyear);
|
||||
|
||||
@ -253,7 +259,7 @@ if ($action == 'create')
|
||||
// Label
|
||||
print '<tr><td>';
|
||||
print fieldLabel('Label','label',1).'</td><td>';
|
||||
print '<input name="label" id="label" class="minwidth300" value="'.($_POST["label"]?GETPOST("label",'',2):$langs->trans("SalaryPayment")).'">';
|
||||
print '<input name="label" id="label" class="minwidth300" value="'.(GETPOST("label")?GETPOST("label"):$langs->trans("SalaryPayment")).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start period
|
||||
|
||||
@ -210,7 +210,7 @@ else
|
||||
|
||||
dol_fiche_head($head, 'agenda', $title, -1, 'contact');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
|
||||
@ -1064,7 +1064,7 @@ else
|
||||
|
||||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
|
||||
@ -987,38 +987,52 @@ class Contact extends CommonObject
|
||||
* Return name of contact with link (and eventually picto)
|
||||
* Use $this->id, $this->lastname, $this->firstname, this->civility_id
|
||||
*
|
||||
* @param int $withpicto Include picto with link
|
||||
* @param string $option Where the link point to
|
||||
* @param int $maxlen Max length of
|
||||
* @param string $moreparam Add more param into URL
|
||||
* @return string String with URL
|
||||
* @param int $withpicto Include picto with link
|
||||
* @param string $option Where the link point to
|
||||
* @param int $maxlen Max length of
|
||||
* @param string $moreparam Add more param into URL
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')
|
||||
function getNomUrl($withpicto=0, $option='', $maxlen=0, $moreparam='', $save_lastsearch_value=-1)
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
$result='';
|
||||
$label = '<u>' . $langs->trans("ShowContact") . '</u>';
|
||||
$label.= '<br><b>' . $langs->trans("Name") . ':</b> '.$this->getFullName($langs);
|
||||
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
|
||||
if (! empty($this->poste)) $label.= '<br><b>' . $langs->trans("Poste") . ':</b> '.$this->poste;
|
||||
$label.= '<br><b>' . $langs->trans("EMail") . ':</b> '.$this->email;
|
||||
$phonelist=array();
|
||||
if ($this->phone_pro) $phonelist[]=$this->phone_pro;
|
||||
if ($this->phone_mobile) $phonelist[]=$this->phone_mobile;
|
||||
if ($this->phone_perso) $phonelist[]=$this->phone_perso;
|
||||
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',$phonelist);
|
||||
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'"';
|
||||
$linkclose="";
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowContact");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.= ' class="classfortooltip">';
|
||||
$label = '<u>' . $langs->trans("ShowContact") . '</u>';
|
||||
$label.= '<br><b>' . $langs->trans("Name") . ':</b> '.$this->getFullName($langs);
|
||||
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
|
||||
if (! empty($this->poste)) $label.= '<br><b>' . $langs->trans("Poste") . ':</b> '.$this->poste;
|
||||
$label.= '<br><b>' . $langs->trans("EMail") . ':</b> '.$this->email;
|
||||
$phonelist=array();
|
||||
if ($this->phone_pro) $phonelist[]=$this->phone_pro;
|
||||
if ($this->phone_mobile) $phonelist[]=$this->phone_mobile;
|
||||
if ($this->phone_perso) $phonelist[]=$this->phone_perso;
|
||||
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',$phonelist);
|
||||
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
|
||||
|
||||
$url = DOL_URL_ROOT.'/contact/card.php?id='.$this->id;
|
||||
|
||||
if ($option !== 'nolink')
|
||||
{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
}
|
||||
|
||||
$url .= $moreparam;
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkclose="";
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowContact");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.= ' class="classfortooltip">';
|
||||
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
@ -1030,18 +1044,17 @@ class Contact extends CommonObject
|
||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
||||
|
||||
$link.=$linkclose;
|
||||
|
||||
$linkstart.=$linkclose;
|
||||
$linkend='</a>';
|
||||
|
||||
if ($option == 'xxx')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend='</a>';
|
||||
}
|
||||
|
||||
if ($withpicto) $result.=($link.img_object($label, 'contact', 'class="classfortooltip"').$linkend.' ');
|
||||
$result.=$link.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$linkend;
|
||||
if ($withpicto) $result.=($linkstart.img_object($label, 'contact', 'class="classfortooltip"').$linkend.' ');
|
||||
$result.=$linkstart.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -107,8 +107,8 @@ if ($object->id)
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
@ -120,11 +120,11 @@ if ($object->id)
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
@ -147,7 +147,7 @@ if ($object->id)
|
||||
print '</td></tr>';
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
// Civility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
print $object->getCivilityLabel();
|
||||
@ -160,7 +160,7 @@ if ($object->id)
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$modulepart = 'contact';
|
||||
$permission = $user->rights->societe->contact->creer;
|
||||
$permtoedit = $user->rights->societe->contact->creer;
|
||||
|
||||
@ -61,7 +61,7 @@ if ($id > 0)
|
||||
|
||||
dol_fiche_head($head, 'info', $title, -1, 'contact');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
|
||||
@ -71,11 +71,11 @@ if ($id > 0)
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
dol_print_object_info($object);
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
@ -90,6 +90,8 @@ $head = contact_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'ldap', $title, -1, 'contact');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
@ -74,8 +74,8 @@ if ($id > 0)
|
||||
$head = contact_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'note', $title, -1, 'contact');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
@ -88,13 +88,13 @@ if ($id > 0)
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
$cssclass='titlefield';
|
||||
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
|
||||
//if ($action == 'editnote_private') $cssclass='titlefieldcreate';
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
@ -107,12 +107,12 @@ if ($id > 0)
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
|
||||
$cssclass="titlefield";
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact
|
||||
$object->old_firstname='';
|
||||
// Logo/Photo save
|
||||
$dir= $conf->societe->dir_output.'/contact/' . get_exdir($object->id,0,0,1,$object,'contact').'/photos';
|
||||
|
||||
|
||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||
if ($file_OK)
|
||||
{
|
||||
@ -88,7 +88,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact
|
||||
else
|
||||
{
|
||||
// Create thumbs
|
||||
$object->addThumbs($newfile);
|
||||
$object->addThumbs($newfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -147,26 +147,26 @@ if ($action == 'edit')
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
dol_fiche_head($head, 'perso', $title, 0, 'contact');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $object->id;
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Photo
|
||||
print '<td align="center" class="hideonsmartphone" valign="middle" rowspan="6">';
|
||||
print $form->showphoto('contact',$object)."\n";
|
||||
if ($object->photo) print "<br>\n";
|
||||
|
||||
|
||||
print '<table class="nobordernopadding">';
|
||||
|
||||
|
||||
if ($object->photo) print '<tr><td align="center"><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Name
|
||||
@ -216,7 +216,7 @@ if ($action == 'edit')
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
@ -228,11 +228,11 @@ if ($action == 'edit')
|
||||
else
|
||||
{
|
||||
// View mode
|
||||
|
||||
|
||||
dol_fiche_head($head, 'perso', $title, -1, 'contact');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
@ -244,13 +244,13 @@ else
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
@ -1311,7 +1311,7 @@ else
|
||||
|
||||
// Contract card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='';
|
||||
|
||||
@ -1938,19 +1938,29 @@ class Contrat extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $maxlength Max length of ref
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string Chaine avec URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $maxlength Max length of ref
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlength=0,$notooltip=0)
|
||||
function getNomUrl($withpicto=0, $maxlength=0, $notooltip=0, $save_lastsearch_value=-1)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
$result='';
|
||||
|
||||
$url = DOL_URL_ROOT.'/contrat/card.php?id='.$this->id;
|
||||
$picto = 'contract';
|
||||
|
||||
//if ($option !== 'nolink')
|
||||
//{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
//}
|
||||
|
||||
$picto = 'contract';
|
||||
$label = '';
|
||||
|
||||
if ($user->rights->contrat->lire) {
|
||||
|
||||
@ -134,9 +134,9 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Contract card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
|
||||
$morehtmlref='';
|
||||
//if (! empty($modCodeContract->code_auto)) {
|
||||
$morehtmlref.=$object->ref;
|
||||
@ -144,7 +144,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3);
|
||||
$morehtmlref.=$form->editfieldval("",'ref',$object->ref,0,'string','',0,2);
|
||||
}*/
|
||||
|
||||
|
||||
$morehtmlref.='<div class="refidno">';
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1);
|
||||
@ -196,10 +196,10 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Discount').'</td><td colspan="3">';
|
||||
if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent);
|
||||
@ -225,7 +225,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Contacts lines
|
||||
|
||||
@ -107,7 +107,7 @@ if ($object->id)
|
||||
|
||||
// Contract card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='';
|
||||
@ -170,7 +170,7 @@ if ($object->id)
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="titlefield">'.$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>';
|
||||
@ -179,7 +179,7 @@ if ($object->id)
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$modulepart = 'contract';
|
||||
$permission = $user->rights->contrat->creer;
|
||||
$permtoedit = $user->rights->contrat->creer;
|
||||
|
||||
@ -62,7 +62,7 @@ dol_fiche_head($head, 'info', $langs->trans("Contract"), -1, 'contract');
|
||||
|
||||
// Contract card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='';
|
||||
|
||||
@ -323,16 +323,17 @@ if ($resql)
|
||||
}
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($sall != '') $param.='&sall='.$sall;
|
||||
if ($search_contract != '') $param.='&search_contract='.$search_contract;
|
||||
if ($search_name != '') $param.='&search_name='.$search_name;
|
||||
if ($search_email != '') $param.='&search_email='.$search_email;
|
||||
if ($search_ref_supplier != '') $param.='&search_ref_supplier='.$search_ref_supplier;
|
||||
if ($search_sale != '') $param.='&search_sale=' .$search_sale;
|
||||
if ($show_files) $param.='&show_files=' .$show_files;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
if ($sall != '') $param.='&sall='.urlencode($sall);
|
||||
if ($search_contract != '') $param.='&search_contract='.urlencode($search_contract);
|
||||
if ($search_name != '') $param.='&search_name='.urlencode($search_name);
|
||||
if ($search_email != '') $param.='&search_email='.urlencode($search_email);
|
||||
if ($search_ref_customer != '') $param.='&search_ref_customer='.urlencode($search_ref_customer);
|
||||
if ($search_ref_supplier != '') $param.='&search_ref_supplier='.urlencode($search_ref_supplier);
|
||||
if ($search_sale != '') $param.='&search_sale=' .urlencode($search_sale);
|
||||
if ($show_files) $param.='&show_files=' .urlencode($show_files);
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
{
|
||||
@ -600,6 +601,11 @@ if ($resql)
|
||||
$contracttmp->ref_customer=$obj->ref_customer;
|
||||
$contracttmp->ref_supplier=$obj->ref_supplier;
|
||||
|
||||
if ($obj->socid > 0)
|
||||
{
|
||||
$result=$socstatic->fetch($obj->socid);
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
if (! empty($arrayfields['c.ref']['checked']))
|
||||
{
|
||||
@ -631,7 +637,13 @@ if ($resql)
|
||||
}
|
||||
if (! empty($arrayfields['s.nom']['checked']))
|
||||
{
|
||||
print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
|
||||
print '<td>';
|
||||
//print '<a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a>';
|
||||
if ($obj->socid > 0)
|
||||
{
|
||||
print $socstatic->getNomUrl(1, '');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['s.email']['checked']))
|
||||
{
|
||||
@ -683,7 +695,6 @@ if ($resql)
|
||||
print '<td>';
|
||||
if ($obj->socid > 0)
|
||||
{
|
||||
$result=$socstatic->fetch($obj->socid);
|
||||
$listsalesrepresentatives=$socstatic->getSalesRepresentatives($user);
|
||||
if ($listsalesrepresentatives < 0) dol_print_error($db);
|
||||
$nbofsalesrepresentative=count($listsalesrepresentatives);
|
||||
|
||||
@ -74,7 +74,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Contract card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='';
|
||||
@ -139,7 +139,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Discount').'</td><td colspan="3">';
|
||||
if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent);
|
||||
@ -161,9 +161,9 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
//print '<br>';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
@ -30,9 +30,9 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if ($object->id)
|
||||
{
|
||||
if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
||||
$result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask'));
|
||||
$result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask', 'alpha'));
|
||||
else
|
||||
$result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask'));
|
||||
$result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask', 'alpha'));
|
||||
}
|
||||
}
|
||||
elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
@ -57,7 +57,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
if ($object->id)
|
||||
{
|
||||
$urlfile = GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
if (GETPOST('section')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir
|
||||
if (GETPOST('section', 'alpha')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir
|
||||
else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
|
||||
{
|
||||
$urlfile=basename($urlfile);
|
||||
@ -116,7 +116,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
exit;
|
||||
}
|
||||
}
|
||||
elseif ($action == 'confirm_updateline' && GETPOST('save') && GETPOST('link', 'alpha'))
|
||||
elseif ($action == 'confirm_updateline' && GETPOST('save','alpha') && GETPOST('link', 'alpha'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
|
||||
$langs->load('link');
|
||||
@ -150,8 +150,8 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave'))
|
||||
//var_dump($upload_dir);exit;
|
||||
if (! empty($upload_dir))
|
||||
{
|
||||
$filenamefrom=dol_sanitizeFileName(GETPOST('renamefilefrom'));
|
||||
$filenameto=dol_sanitizeFileName(GETPOST('renamefileto'));
|
||||
$filenamefrom=dol_sanitizeFileName(GETPOST('renamefilefrom','alpha'));
|
||||
$filenameto=dol_sanitizeFileName(GETPOST('renamefileto','alpha'));
|
||||
|
||||
// Security:
|
||||
// Disallow file with some extensions. We rename them.
|
||||
|
||||
@ -418,6 +418,21 @@ abstract class CommonDocGenerator
|
||||
$resarray[$array_key.'_total_discount_ht'] = '';
|
||||
}
|
||||
|
||||
// Fetch project information if there is a project assigned to this object
|
||||
if ($object->element != "project" && ! empty($object->fk_project) && $object->fk_project > 0)
|
||||
{
|
||||
if (! is_object($object->project))
|
||||
{
|
||||
$object->fetch_projet();
|
||||
}
|
||||
|
||||
$resarray[$array_key.'_project_ref'] = $object->project->ref;
|
||||
$resarray[$array_key.'_project_title'] = $object->project->title;
|
||||
$resarray[$array_key.'_project_description'] = $object->project->description;
|
||||
$resarray[$array_key.'_project_date_start'] = dol_print_date($object->project->date_start, 'day');
|
||||
$resarray[$array_key.'_project_date_end'] = dol_print_date($object->project->date_end, 'day');
|
||||
}
|
||||
|
||||
// Add vat by rates
|
||||
if (is_array($object->lines) && count($object->lines)>0)
|
||||
{
|
||||
|
||||
@ -4594,23 +4594,28 @@ abstract class CommonObject
|
||||
}else {
|
||||
$colspan='3';
|
||||
}
|
||||
|
||||
switch($mode) {
|
||||
case "view":
|
||||
$value=$this->array_options["options_".$key];
|
||||
break;
|
||||
case "edit":
|
||||
if (isset($_POST["options_" . $key])) {
|
||||
if (is_array($_POST["options_" . $key])) {
|
||||
// $_POST["options"] is an array but following code expects a comma separated string
|
||||
$value = implode(",", $_POST["options_" . $key]);
|
||||
// GETPOST("options_" . $key) can be 'abc' or array(0=>'abc')
|
||||
$getposttemp = GETPOST('options_'.$key, 'none'); // GETPOST can get value from GET, POST or setup of default values.
|
||||
if (isset($getposttemp)) {
|
||||
if (is_array($getposttemp)) {
|
||||
// $getposttemp is an array but following code expects a comma separated string
|
||||
$value = implode(",", $getposttemp);
|
||||
} else {
|
||||
$value = $_POST["options_" . $key];
|
||||
$value = $getposttemp;
|
||||
}
|
||||
} else {
|
||||
$value = $this->array_options["options_" . $key];
|
||||
$value = $this->array_options["options_" . $key]; // No GET, no POST, no default value, so we take value of object.
|
||||
}
|
||||
break;
|
||||
}
|
||||
//var_dump($value);
|
||||
|
||||
if ($extrafields->attribute_type[$key] == 'separate')
|
||||
{
|
||||
$out .= $extrafields->showSeparator($key);
|
||||
|
||||
@ -893,7 +893,7 @@ class ExtraFields
|
||||
if (! is_object($form)) $form=new Form($this->db);
|
||||
|
||||
// TODO Must also support $moreparam
|
||||
$out = $form->select_date($value, $keysuffix.'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
|
||||
$out = $form->select_date($value, $keysuffix.'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, ($keysuffix != 'search_' ? 1 : 0), 1, 0, 1);
|
||||
}
|
||||
elseif (in_array($type,array('int')))
|
||||
{
|
||||
@ -1323,7 +1323,8 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'password')
|
||||
{
|
||||
$out='<input type="password" class="flat '.$showsize.'" name="'.$keysuffix.'options_'.$key.$keyprefix.'" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
|
||||
// If prefix is 'search_', field is used as a filter, we use a common text field.
|
||||
$out='<input type="'.($keysuffix=='search_'?'text':'password').'" class="flat '.$showsize.'" name="'.$keysuffix.'options_'.$key.$keyprefix.'" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
|
||||
}
|
||||
if (!empty($hidden)) {
|
||||
$out='<input type="hidden" value="'.$value.'" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="'.$keysuffix.'options_'.$key.$keyprefix.'"/>';
|
||||
|
||||
@ -5973,7 +5973,7 @@ class Form
|
||||
|
||||
if ($previous_ref || $next_ref || $morehtml)
|
||||
{
|
||||
$ret.='<div class="pagination"><ul>';
|
||||
$ret.='<div class="pagination paginationref"><ul class="right">';
|
||||
}
|
||||
if ($morehtml)
|
||||
{
|
||||
|
||||
@ -57,21 +57,22 @@ class FormFile
|
||||
/**
|
||||
* Show form to upload a new file
|
||||
*
|
||||
* @param string $url Url
|
||||
* @param string $title Title zone (Title or '' or 'none')
|
||||
* @param string $url Url
|
||||
* @param string $title Title zone (Title or '' or 'none')
|
||||
* @param int $addcancel 1=Add 'Cancel' button
|
||||
* @param int $sectionid If upload must be done inside a particular ECM section
|
||||
* @param int $perm Value of permission to allow upload
|
||||
* @param int $size Length of input file area. Deprecated.
|
||||
* @param Object $object Object to use (when attachment is done on an element)
|
||||
* @param string $options Add an option column
|
||||
* @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used.
|
||||
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
|
||||
* @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files
|
||||
* @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM)
|
||||
* @param int $size Length of input file area. Deprecated.
|
||||
* @param Object $object Object to use (when attachment is done on an element)
|
||||
* @param string $options Add an option column
|
||||
* @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used.
|
||||
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
|
||||
* @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files
|
||||
* @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM)
|
||||
* @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*')
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile')
|
||||
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='')
|
||||
{
|
||||
global $conf,$langs, $hookmanager;
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
@ -130,6 +131,7 @@ class FormFile
|
||||
$out .= '<input class="flat minwidth400" type="file"';
|
||||
$out .= ((! empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic')?' name="userfile"':' name="userfile[]" multiple');
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':'');
|
||||
$out .= (!empty($accept)?' accept="'.$accept.'"':'accept=""');
|
||||
$out .= '>';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||
|
||||
@ -506,26 +506,26 @@ function getDateFromFormat(val,format)
|
||||
if (substr == "MM" ||substr == "M")
|
||||
{
|
||||
month=getIntegerInString(val,d,1,2);
|
||||
d -= 2- month.length;
|
||||
if (month) d -= 2- month.length;
|
||||
}
|
||||
if (substr == "dd")
|
||||
{
|
||||
day=getIntegerInString(val,d,1,2);
|
||||
d -= 2- day.length;
|
||||
if (day) d -= 2- day.length;
|
||||
}
|
||||
if (substr == "HH" ||substr == "hh" )
|
||||
{
|
||||
hour=getIntegerInString(val,d,1,2);
|
||||
d -= 2- hour.length;
|
||||
if (dhouray) d -= 2- hour.length;
|
||||
}
|
||||
if (substr == "mm"){
|
||||
minute=getIntegerInString(val,d,1,2);
|
||||
d -= 2- minute.length;
|
||||
if (minute) d -= 2- minute.length;
|
||||
}
|
||||
if (substr == "ss")
|
||||
{
|
||||
seconde=getIntegerInString(val,d,1,2);
|
||||
d -= 2- seconde.length;
|
||||
if (seconde) d -= 2- seconde.length;
|
||||
}
|
||||
|
||||
i+=substr.length;
|
||||
|
||||
@ -42,7 +42,7 @@ function bank_prepare_head(Account $object)
|
||||
$head[$h][2] = 'bankname';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/bankentries.php?id=" . $object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/bankentries_list.php?id=" . $object->id;
|
||||
$head[$h][1] = $langs->trans("BankTransactions");
|
||||
$head[$h][2] = 'journal';
|
||||
$h++;
|
||||
@ -95,7 +95,7 @@ function bank_prepare_head(Account $object)
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
$h++;*/
|
||||
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -146,9 +146,9 @@ function bank_admin_prepare_head($object)
|
||||
* @return array Array of tabs to shoc
|
||||
*/
|
||||
function various_payment_prepare_head($object) {
|
||||
|
||||
|
||||
global $db, $langs, $conf;
|
||||
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
@ -178,7 +178,7 @@ function various_payment_prepare_head($object) {
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'various_payment', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -247,7 +247,7 @@ function checkBanForAccount($account)
|
||||
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
|
||||
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
|
||||
// Multiplication de chaque groupe par les coef du tableau
|
||||
|
||||
|
||||
for ($i = 0, $s = 0; $i < 3; $i++) {
|
||||
$code = substr($rib, 7 * $i, 7);
|
||||
$s += (0 + (int) $code) * $coef[$i];
|
||||
|
||||
@ -1475,19 +1475,17 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
$destfull=$upload_dir . "/" . $TFile['name'][$i];
|
||||
$destfile=$TFile['name'][$i];
|
||||
|
||||
$savingdocmask = dol_sanitizeFileName($savingdocmask);
|
||||
|
||||
if ($savingdocmask)
|
||||
{
|
||||
$destfull=$upload_dir . "/" . preg_replace('/__file__/',$TFile['name'][$i],$savingdocmask);
|
||||
$destfile=preg_replace('/__file__/',$TFile['name'][$i],$savingdocmask);
|
||||
}
|
||||
|
||||
// lowercase extension
|
||||
// dol_sanitizeFileName the file name and lowercase extension
|
||||
$info = pathinfo($destfull);
|
||||
$destfull = $info['dirname'].'/'.$info['filename'].'.'.strtolower($info['extension']);
|
||||
$destfull = $info['dirname'].'/'.dol_sanitizeFileName($info['filename'].'.'.strtolower($info['extension']));
|
||||
$info = pathinfo($destfile);
|
||||
$destfile = $info['filename'].'.'.strtolower($info['extension']);
|
||||
$destfile = dol_sanitizeFileName($info['filename'].'.'.strtolower($info['extension']));
|
||||
|
||||
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
|
||||
|
||||
|
||||
@ -312,111 +312,126 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N
|
||||
{
|
||||
if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
|
||||
{
|
||||
if (! empty($user->default_values)) // $user->default_values defined from menu default values
|
||||
if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values'
|
||||
{
|
||||
$qualified=1;
|
||||
if (isset($user->default_values[$relativepathstring]['createform_queries'])) // Even if paramname is sortfield, data are stored into ['sortorder...']
|
||||
{
|
||||
$tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['createform_queries']);
|
||||
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
{
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0;
|
||||
}
|
||||
}
|
||||
if ($qualified)
|
||||
if (isset($user->default_values[$relativepathstring]['createform']))
|
||||
{
|
||||
//var_dump($user->default_values[$relativepathstring]['createform']);
|
||||
if (isset($user->default_values[$relativepathstring]['createform'][$paramname])) $out = $user->default_values[$relativepathstring]['createform'][$paramname];
|
||||
foreach($user->default_values[$relativepathstring]['createform'] as $defkey => $defval)
|
||||
{
|
||||
$qualified = 0;
|
||||
if ($defkey != '_noquery_')
|
||||
{
|
||||
$tmpqueryarraytohave=explode('&', $defkey);
|
||||
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
||||
$foundintru=0;
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
{
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
||||
}
|
||||
if (! $foundintru) $qualified=1;
|
||||
//var_dump($defkey.'-'.$qualified);
|
||||
}
|
||||
else $qualified = 1;
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
//var_dump($user->default_values[$relativepathstring][$defkey]['createform']);
|
||||
if (isset($user->default_values[$relativepathstring]['createform'][$defkey][$paramname]))
|
||||
{
|
||||
$out = $user->default_values[$relativepathstring]['createform'][$defkey][$paramname];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Management of default search_filters and sort order
|
||||
//elseif (preg_match('/list.php$/', $_SERVER["PHP_SELF"]) && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
|
||||
elseif (! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
|
||||
{
|
||||
if (! empty($user->default_values)) // $user->default_values defined from menu default values
|
||||
if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values'
|
||||
{
|
||||
//var_dump($user->default_values[$relativepathstring]);
|
||||
if ($paramname == 'sortfield') // Sorted on which fields ?
|
||||
if ($paramname == 'sortfield' || $paramname == 'sortorder') // Sorted on which fields ? ASC or DESC ?
|
||||
{
|
||||
$qualified=1;
|
||||
if (isset($user->default_values[$relativepathstring]['sortorder_queries'])) // Even if paramname is sortfield, data are stored into ['sortorder...']
|
||||
if (isset($user->default_values[$relativepathstring]['sortorder'])) // Even if paramname is sortfield, data are stored into ['sortorder...']
|
||||
{
|
||||
$tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['sortorder_queries']);
|
||||
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
foreach($user->default_values[$relativepathstring]['sortorder'] as $defkey => $defval)
|
||||
{
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0;
|
||||
}
|
||||
}
|
||||
if ($qualified)
|
||||
{
|
||||
if (isset($user->default_values[$relativepathstring]['sortorder'])) // We will use the key of $user->default_values[path][sortorder]
|
||||
{
|
||||
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
|
||||
foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val)
|
||||
{
|
||||
if ($out) $out.=', ';
|
||||
$out.=dol_string_nospecial($key, '', $forbidden_chars_to_replace);
|
||||
}
|
||||
$qualified = 0;
|
||||
if ($defkey != '_noquery_')
|
||||
{
|
||||
$tmpqueryarraytohave=explode('&', $defkey);
|
||||
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
||||
$foundintru=0;
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
{
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
||||
}
|
||||
if (! $foundintru) $qualified=1;
|
||||
//var_dump($defkey.'-'.$qualified);
|
||||
}
|
||||
else $qualified = 1;
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
|
||||
foreach($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val)
|
||||
{
|
||||
if ($out) $out.=', ';
|
||||
if ($paramname == 'sortfield')
|
||||
{
|
||||
$out.=dol_string_nospecial($key, '', $forbidden_chars_to_replace);
|
||||
}
|
||||
if ($paramname == 'sortorder')
|
||||
{
|
||||
$out.=dol_string_nospecial($val, '', $forbidden_chars_to_replace);
|
||||
}
|
||||
}
|
||||
//break; // No break for sortfield and sortorder so we can cumulate fields (is it realy usefull ?)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($paramname == 'sortorder') // ASC or DESC ?
|
||||
elseif (isset($user->default_values[$relativepathstring]['filters']))
|
||||
{
|
||||
$qualified=1;
|
||||
if (isset($user->default_values[$relativepathstring]['sortorder_queries']))
|
||||
foreach($user->default_values[$relativepathstring]['filters'] as $defkey => $defval)
|
||||
{
|
||||
$tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['sortorder_queries']);
|
||||
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
{
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0;
|
||||
}
|
||||
}
|
||||
if ($qualified)
|
||||
{
|
||||
if (isset($user->default_values[$relativepathstring]['sortorder'])) // We will use the val of $user->default_values[path][sortorder]
|
||||
{
|
||||
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
|
||||
foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val)
|
||||
{
|
||||
if ($out) $out.=', ';
|
||||
$out.=dol_string_nospecial($val, '', $forbidden_chars_to_replace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (isset($user->default_values[$relativepathstring]['filters'][$paramname]))
|
||||
{
|
||||
$qualified=1;
|
||||
if (isset($user->default_values[$relativepathstring]['filters_queries']))
|
||||
{
|
||||
$tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['filters_queries']);
|
||||
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
{
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0;
|
||||
}
|
||||
}
|
||||
if ($qualified)
|
||||
{
|
||||
if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all']))
|
||||
$qualified = 0;
|
||||
if ($defkey != '_noquery_')
|
||||
{
|
||||
// We made a search from quick search menu, do we still use default filter ?
|
||||
if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH))
|
||||
$tmpqueryarraytohave=explode('&', $defkey);
|
||||
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
||||
$foundintru=0;
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
{
|
||||
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
|
||||
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace);
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
||||
}
|
||||
if (! $foundintru) $qualified=1;
|
||||
//var_dump($defkey.'-'.$qualified);
|
||||
}
|
||||
else
|
||||
{
|
||||
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
|
||||
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace);
|
||||
}
|
||||
}
|
||||
else $qualified = 1;
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all']))
|
||||
{
|
||||
// We made a search from quick search menu, do we still use default filter ?
|
||||
if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH))
|
||||
{
|
||||
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
|
||||
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and ,
|
||||
$out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -424,14 +439,14 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N
|
||||
|
||||
}
|
||||
|
||||
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters)
|
||||
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ...
|
||||
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
|
||||
if (! is_array($out) && empty($_POST[$paramname]))
|
||||
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters)
|
||||
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ...
|
||||
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
|
||||
if (! is_array($out) && empty($_POST[$paramname]))
|
||||
{
|
||||
$maxloop=20; $loopnb=0; // Protection against infinite loop
|
||||
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
|
||||
{
|
||||
$maxloop=20; $loopnb=0; // Protection against infinite loop
|
||||
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
|
||||
{
|
||||
$loopnb++; $newout = '';
|
||||
|
||||
if ($reg[1] == 'DAY') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mday']; }
|
||||
@ -462,57 +477,57 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N
|
||||
else $newout = ''; // Key not found, we replace with empty string
|
||||
//var_dump('__'.$reg[1].'__ -> '.$newout);
|
||||
$out = preg_replace('/__'.preg_quote($reg[1],'/').'__/', $newout, $out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check is done after replacement
|
||||
switch ($check)
|
||||
{
|
||||
case 'none':
|
||||
break;
|
||||
case 'int': // Check param is a numeric value (integer but also float or hexadecimal)
|
||||
if (! is_numeric($out)) { $out=''; }
|
||||
break;
|
||||
case 'intcomma':
|
||||
if (preg_match('/[^0-9,]+/i',$out)) $out='';
|
||||
break;
|
||||
case 'alpha':
|
||||
$out=trim($out);
|
||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||
// '../' is dangerous because it allows dir transversals
|
||||
if (preg_match('/"/',$out)) $out='';
|
||||
else if (preg_match('/\.\.\//',$out)) $out='';
|
||||
break;
|
||||
case 'san_alpha':
|
||||
$out=filter_var($out,FILTER_SANITIZE_STRING);
|
||||
break;
|
||||
case 'aZ':
|
||||
$out=trim($out);
|
||||
if (preg_match('/[^a-z]+/i',$out)) $out='';
|
||||
break;
|
||||
case 'aZ09':
|
||||
$out=trim($out);
|
||||
if (preg_match('/[^a-z0-9_\-\.]+/i',$out)) $out='';
|
||||
break;
|
||||
case 'array':
|
||||
if (! is_array($out) || empty($out)) $out=array();
|
||||
break;
|
||||
case 'nohtml':
|
||||
$out=dol_string_nohtmltag($out);
|
||||
break;
|
||||
case 'alphanohtml': // Recommended for search params
|
||||
$out=trim($out);
|
||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||
// '../' is dangerous because it allows dir transversals
|
||||
if (preg_match('/"/',$out)) $out='';
|
||||
else if (preg_match('/\.\.\//',$out)) $out='';
|
||||
$out=dol_string_nohtmltag($out);
|
||||
break;
|
||||
case 'custom':
|
||||
if (empty($filter)) return 'BadFourthParameterForGETPOST';
|
||||
$out=filter_var($out, $filter, $options);
|
||||
break;
|
||||
}
|
||||
// Check is done after replacement
|
||||
switch ($check)
|
||||
{
|
||||
case 'none':
|
||||
break;
|
||||
case 'int': // Check param is a numeric value (integer but also float or hexadecimal)
|
||||
if (! is_numeric($out)) { $out=''; }
|
||||
break;
|
||||
case 'intcomma':
|
||||
if (preg_match('/[^0-9,]+/i',$out)) $out='';
|
||||
break;
|
||||
case 'alpha':
|
||||
$out=trim($out);
|
||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||
// '../' is dangerous because it allows dir transversals
|
||||
if (preg_match('/"/',$out)) $out='';
|
||||
else if (preg_match('/\.\.\//',$out)) $out='';
|
||||
break;
|
||||
case 'san_alpha':
|
||||
$out=filter_var($out,FILTER_SANITIZE_STRING);
|
||||
break;
|
||||
case 'aZ':
|
||||
$out=trim($out);
|
||||
if (preg_match('/[^a-z]+/i',$out)) $out='';
|
||||
break;
|
||||
case 'aZ09':
|
||||
$out=trim($out);
|
||||
if (preg_match('/[^a-z0-9_\-\.]+/i',$out)) $out='';
|
||||
break;
|
||||
case 'array':
|
||||
if (! is_array($out) || empty($out)) $out=array();
|
||||
break;
|
||||
case 'nohtml':
|
||||
$out=dol_string_nohtmltag($out);
|
||||
break;
|
||||
case 'alphanohtml': // Recommended for search params
|
||||
$out=trim($out);
|
||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||
// '../' is dangerous because it allows dir transversals
|
||||
if (preg_match('/"/',$out)) $out='';
|
||||
else if (preg_match('/\.\.\//',$out)) $out='';
|
||||
$out=dol_string_nohtmltag($out);
|
||||
break;
|
||||
case 'custom':
|
||||
if (empty($filter)) return 'BadFourthParameterForGETPOST';
|
||||
$out=filter_var($out, $filter, $options);
|
||||
break;
|
||||
}
|
||||
|
||||
// Code for search criteria persistence.
|
||||
// Save data into session if key start with 'search_' or is 'smonth', 'syear', 'month', 'year'
|
||||
@ -745,7 +760,7 @@ function dol_size($size,$type='')
|
||||
*/
|
||||
function dol_sanitizeFileName($str,$newstr='_',$unaccent=1)
|
||||
{
|
||||
$filesystem_forbidden_chars = array('<','>',':','/','\\','?','*','|','"','°');
|
||||
$filesystem_forbidden_chars = array('<','>','/','\\','?','*','|','"','°');
|
||||
return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars);
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function');
|
||||
|
||||
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, ($followlocation?true:false)); // We use @ here because this may return warning if safe mode is on or open_basedir is on
|
||||
|
||||
|
||||
if (count($addheaders)) curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders);
|
||||
curl_setopt($ch, CURLINFO_HEADER_OUT, true); // To be able to retrieve request header and log it
|
||||
|
||||
@ -63,7 +63,7 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
// You can force, if supported a version like TLSv1 or TLSv1.2
|
||||
if (! empty($conf->global->MAIN_CURL_SSLVERSION)) curl_setopt($ch, CURLOPT_SSLVERSION, $conf->global->MAIN_CURL_SSLVERSION);
|
||||
//curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2
|
||||
|
||||
|
||||
//turning off the server and peer verification(TrustManager Concept).
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
@ -82,12 +82,12 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
|
||||
if (! is_array($param)) parse_str($param, $array_param);
|
||||
else
|
||||
else
|
||||
{
|
||||
dol_syslog("parameter param must be a string", LOG_WARNING);
|
||||
$array_param=$param;
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param)); // Setting param x=a&y=z as PUT fields
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param)); // Setting param x=a&y=z as PUT fields
|
||||
}
|
||||
else if ($postorget == 'PUTALREADYFORMATED')
|
||||
{
|
||||
@ -121,7 +121,7 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
$response = curl_exec($ch);
|
||||
|
||||
$request = curl_getinfo($ch, CURLINFO_HEADER_OUT); // Reading of request must be done after sending request
|
||||
|
||||
|
||||
dol_syslog("getURLContent request=".$request);
|
||||
dol_syslog("getURLContent response=".$response);
|
||||
|
||||
@ -130,7 +130,7 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
{
|
||||
// Ad keys to $rep
|
||||
$rep['content']=$response;
|
||||
|
||||
|
||||
// moving to display page to display curl errors
|
||||
$rep['curl_error_no']=curl_errno($ch);
|
||||
$rep['curl_error_msg']=curl_error($ch);
|
||||
@ -146,12 +146,12 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
//$rep['header_size']=$info['header_size'];
|
||||
//$rep['http_code']=$info['http_code'];
|
||||
dol_syslog("getURLContent http_code=".$rep['http_code']);
|
||||
|
||||
|
||||
// Add more keys to $rep
|
||||
$rep['content']=$response;
|
||||
$rep['curl_error_no']='';
|
||||
$rep['curl_error_msg']='';
|
||||
|
||||
|
||||
//closing the curl
|
||||
curl_close($ch);
|
||||
}
|
||||
@ -159,3 +159,19 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
return $rep;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function get second level domain name.
|
||||
* For example: https://www.abc.mydomain.com/dir/page.html return 'mydomain'
|
||||
*
|
||||
* @param string $url Full URL.
|
||||
* @return string Returns domaine name
|
||||
*/
|
||||
function getDomainFromURL($url)
|
||||
{
|
||||
$tmpdomain = preg_replace('/^https?:\/\//i', '', $url); // Remove http(s)://
|
||||
$tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); // Remove part after domain
|
||||
$tmpdomain = preg_replace('/\.[^\.]+$/', '', $tmpdomain); // Remove first level domain (.com, .net, ...)
|
||||
$tmpdomain = preg_replace('/^[^\.]+\./', '', $tmpdomain); // Remove part www. before domain name
|
||||
return $tmpdomain;
|
||||
}
|
||||
|
||||
@ -252,7 +252,8 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
|
||||
{
|
||||
//print '<br>feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write;
|
||||
if (empty($user->rights->$feature->creer)
|
||||
&& empty($user->rights->$feature->write)) { $createok=0; $nbko++; }
|
||||
&& empty($user->rights->$feature->write)
|
||||
&& empty($user->rights->$feature->create)) { $createok=0; $nbko++; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,6 +308,10 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
|
||||
{
|
||||
if (! $user->rights->ftp->write) $deleteok=0;
|
||||
}
|
||||
else if ($feature == 'salaries')
|
||||
{
|
||||
if (! $user->rights->salaries->delete) $deleteok=0;
|
||||
}
|
||||
else if (! empty($feature2)) // This should be used for future changes
|
||||
{
|
||||
foreach($feature2 as $subfeature)
|
||||
|
||||
@ -14,7 +14,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'Accountancy', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 2, 51, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 110, __ENTITY__);
|
||||
@ -224,7 +224,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 41, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__);
|
||||
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 51, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 51, __ENTITY__);
|
||||
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 52, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 53, __ENTITY__);
|
||||
@ -283,10 +283,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2506__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/rejets.php?leftmenu=withdraw', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2507__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/stats.php?leftmenu=withdraw', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __ENTITY__);
|
||||
-- Bank
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/index.php?leftmenu=bank&mainmenu=bank', 'MenuBankCash', 0, 'banks', '$user->rights->banque->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/list.php?leftmenu=bank&mainmenu=bank', 'MenuBankCash', 0, 'banks', '$user->rights->banque->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2601__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/card.php?action=create&leftmenu=bank', 'MenuNewFinancialAccount', 1, 'banks', '$user->rights->banque->configurer', '', 0, 0, __ENTITY__);
|
||||
-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2602__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/categ.php?leftmenu=bank', 'Rubriques', 1, 'categories', '$user->rights->banque->configurer', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries.php?leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->lire', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries_list.php?leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->lire', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->rights->banque->lire', '', 0, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __ENTITY__);
|
||||
-- Bank - Categories
|
||||
|
||||
@ -339,7 +339,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
if ($numr > 0) $newmenu->add('/compta/bank/list.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
@ -347,7 +347,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
$newmenu->add('/compta/bank/card.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
if ($objp->rappro && $objp->courant != Account::TYPE_CASH && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
|
||||
{
|
||||
$newmenu->add('/compta/bank/bankentries.php?id='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
$newmenu->add('/compta/bank/bankentries_list.php?id='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -163,13 +163,13 @@ class MenuManager
|
||||
$canonurl=preg_replace('/\?.*$/','',$val['url']);
|
||||
|
||||
print '<a class="alilevel0" href="#">';
|
||||
|
||||
|
||||
// Add font-awesome
|
||||
if ($val['level'] == 0 && $val['mainmenu'] == 'home') print '<span class="fa fa-home fa-fw paddingright" aria-hidden="true"></span>';
|
||||
|
||||
|
||||
print $val['titre'];
|
||||
print '</a>'."\n";
|
||||
|
||||
|
||||
// Search submenu fot this mainmenu entry
|
||||
$tmpmainmenu=$val['mainmenu'];
|
||||
$tmpleftmenu='all';
|
||||
@ -183,7 +183,7 @@ class MenuManager
|
||||
//var_dump($canonnexturl);
|
||||
print '<ul>'."\n";
|
||||
if (($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('tools')))
|
||||
|| (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/index.php') !== false))
|
||||
|| (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/list.php') !== false))
|
||||
{
|
||||
// We add sub entry
|
||||
print str_pad('',1).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
|
||||
@ -201,7 +201,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
|
||||
else $classname = 'class="tmenu"';
|
||||
$idsel='bank';
|
||||
|
||||
$menu->add('/compta/bank/index.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", '', 60, $id, $idsel, $classname);
|
||||
$menu->add('/compta/bank/list.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", '', 60, $id, $idsel, $classname);
|
||||
}
|
||||
|
||||
// Projects
|
||||
@ -977,7 +977,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
|
||||
}
|
||||
if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
@ -1146,11 +1146,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
// Bank-Caisse
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
$newmenu->add("/compta/bank/index.php?leftmenu=bank&mainmenu=bank",$langs->trans("MenuBankCash"),0,$user->rights->banque->lire, '', $mainmenu, 'bank');
|
||||
$newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank",$langs->trans("MenuBankCash"),0,$user->rights->banque->lire, '', $mainmenu, 'bank');
|
||||
|
||||
$newmenu->add("/compta/bank/card.php?action=create",$langs->trans("MenuNewFinancialAccount"),1,$user->rights->banque->configurer);
|
||||
$newmenu->add("/compta/bank/index.php?leftmenu=bank&mainmenu=bank",$langs->trans("List"),1,$user->rights->banque->lire, '', $mainmenu, 'bank');
|
||||
$newmenu->add("/compta/bank/bankentries.php",$langs->trans("ListTransactions"),1,$user->rights->banque->lire);
|
||||
$newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank",$langs->trans("List"),1,$user->rights->banque->lire, '', $mainmenu, 'bank');
|
||||
$newmenu->add("/compta/bank/bankentries_list.php",$langs->trans("ListTransactions"),1,$user->rights->banque->lire);
|
||||
$newmenu->add("/compta/bank/budget.php",$langs->trans("ListTransactionsByCategory"),1,$user->rights->banque->lire);
|
||||
|
||||
$newmenu->add("/compta/bank/transfer.php",$langs->trans("MenuBankInternalTransfer"),1,$user->rights->banque->transfer);
|
||||
@ -1498,7 +1498,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
if ($numr > 0) $newmenu->add('/compta/bank/list.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
@ -1506,7 +1506,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add('/compta/bank/card.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
if ($objp->rappro && $objp->courant != Account::TYPE_CASH && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
|
||||
{
|
||||
$newmenu->add('/compta/bank/bankentries.php?action=reconcile&contextpage=banktransactionlist-'.$objp->rowid.'&account='.$objp->rowid.'&id='.$objp->rowid.'&search_conciliated=0',$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
$newmenu->add('/compta/bank/bankentries_list.php?action=reconcile&contextpage=banktransactionlist-'.$objp->rowid.'&account='.$objp->rowid.'&id='.$objp->rowid.'&search_conciliated=0',$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ class MenuManager
|
||||
|
||||
print $val['titre'];
|
||||
print '</a>'."\n";
|
||||
|
||||
|
||||
// Search submenu fot this mainmenu entry
|
||||
$tmpmainmenu=$val['mainmenu'];
|
||||
$tmpleftmenu='all';
|
||||
@ -193,7 +193,7 @@ class MenuManager
|
||||
//var_dump($canonnexturl);
|
||||
print '<ul>'."\n";
|
||||
if (($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('tools')))
|
||||
|| (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/index.php') !== false))
|
||||
|| (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/list.php') !== false))
|
||||
{
|
||||
// We add sub entry
|
||||
print str_pad('',1).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
|
||||
@ -199,7 +199,7 @@ class MenuManager
|
||||
//var_dump($canonnexturl);
|
||||
print '<ul>'."\n";
|
||||
if (($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('tools')))
|
||||
|| (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/index.php') !== false))
|
||||
|| (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/list.php') !== false))
|
||||
{
|
||||
// We add sub entry
|
||||
print str_pad('',1).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
|
||||
@ -122,6 +122,8 @@ class pdf_paiement
|
||||
|
||||
$month = sprintf("%02d",$month);
|
||||
$year = sprintf("%04d",$year);
|
||||
|
||||
$file = $dir . "/payments-".$year."-".$month.".pdf";
|
||||
switch ($this->doc_type) {
|
||||
case "client":
|
||||
$file = $dir . "/payments-".$year."-".$month.".pdf";
|
||||
@ -251,7 +253,7 @@ class pdf_paiement
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
|
||||
|
||||
$lines[$i][0] = $objp->facnumber;
|
||||
$lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true);
|
||||
@ -328,9 +330,9 @@ class pdf_paiement
|
||||
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS
|
||||
{
|
||||
$fullpath=$dir."/".$original_file;
|
||||
$result=dol_imageResizeOrCrop($fullpath,0,$_POST['sizex'],$_POST['sizey']);
|
||||
|
||||
|
||||
if ($result == $fullpath)
|
||||
{
|
||||
$object->addThumbs($fullpath);
|
||||
@ -178,7 +178,7 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS
|
||||
// Update/create database for file $fullpath
|
||||
$rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $fullpath);
|
||||
$rel_filename = preg_replace('/^[\\/]/','',$rel_filename);
|
||||
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||
$ecmfile=new EcmFiles($db);
|
||||
$result = $ecmfile->fetch(0, '', $rel_filename);
|
||||
@ -188,7 +188,7 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS
|
||||
$rel_dir = dirname($rel_filename);
|
||||
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
|
||||
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
|
||||
|
||||
|
||||
$ecmfile->label = md5_file(dol_osencode($fullpath));
|
||||
$result = $ecmfile->update($user);
|
||||
}
|
||||
@ -198,7 +198,7 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS
|
||||
$rel_dir = dirname($rel_filename);
|
||||
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
|
||||
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
|
||||
|
||||
|
||||
$ecmfile->filepath = $rel_dir;
|
||||
$ecmfile->filename = $filename;
|
||||
$ecmfile->label = md5_file(dol_osencode($fullpath)); // $fullpath is a full path to file
|
||||
@ -213,7 +213,7 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS
|
||||
}
|
||||
$result = $ecmfile->create($user);
|
||||
}
|
||||
|
||||
|
||||
if ($backtourl)
|
||||
{
|
||||
header("Location: ".$backtourl);
|
||||
@ -246,7 +246,7 @@ if ($action == 'confirm_crop')
|
||||
// Update/create database for file $fullpath
|
||||
$rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $fullpath);
|
||||
$rel_filename = preg_replace('/^[\\/]/','',$rel_filename);
|
||||
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||
$ecmfile=new EcmFiles($db);
|
||||
$result = $ecmfile->fetch(0, '', $rel_filename);
|
||||
@ -256,7 +256,7 @@ if ($action == 'confirm_crop')
|
||||
$rel_dir = dirname($rel_filename);
|
||||
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
|
||||
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
|
||||
|
||||
|
||||
$ecmfile->label = md5_file(dol_osencode($fullpath));
|
||||
$result = $ecmfile->update($user);
|
||||
}
|
||||
@ -266,7 +266,7 @@ if ($action == 'confirm_crop')
|
||||
$rel_dir = dirname($rel_filename);
|
||||
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
|
||||
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
|
||||
|
||||
|
||||
$ecmfile->filepath = $rel_dir;
|
||||
$ecmfile->filename = $filename;
|
||||
$ecmfile->label = md5_file(dol_osencode($fullpath)); // $fullpath is a full path to file
|
||||
@ -281,7 +281,7 @@ if ($action == 'confirm_crop')
|
||||
}
|
||||
$result = $ecmfile->create($user);
|
||||
}
|
||||
|
||||
|
||||
if ($backtourl)
|
||||
{
|
||||
header("Location: ".$backtourl);
|
||||
@ -311,7 +311,7 @@ llxHeader($head, $langs->trans("Image"), '', '', 0, 0, array('/includes/jquery/p
|
||||
|
||||
print load_fiche_titre($langs->trans("ImageEditor"));
|
||||
|
||||
$infoarray=dol_getImageSize($dir."/".GETPOST("file"));
|
||||
$infoarray=dol_getImageSize($dir."/".GETPOST("file",'alpha'));
|
||||
$height=$infoarray['height'];
|
||||
$width=$infoarray['width'];
|
||||
print $langs->trans("CurrentInformationOnImage").': ';
|
||||
@ -373,7 +373,7 @@ if (! empty($conf->use_javascript_ajax))
|
||||
print $langs->trans("DefineNewAreaToPick").'...<br>';
|
||||
print '<br><div class="center">';
|
||||
print '<div style="border: 1px solid #888888; width: '.$widthforcrop.'px;">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$object->entity.'&file='.$original_file.'" alt="" id="cropbox" width="'.$widthforcrop.'px"/>';
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$object->entity.'&file='.urlencode($original_file).'" alt="" id="cropbox" width="'.$widthforcrop.'px"/>';
|
||||
print '</div>';
|
||||
print '</div><br>';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">
|
||||
|
||||
@ -79,7 +79,7 @@ $formfile->form_attach_new_file(
|
||||
);
|
||||
|
||||
$disablemove=1;
|
||||
if ($modulepart == 'produit') $disablemove=0;
|
||||
if ($modulepart == 'product' || $modulepart == 'produit') $disablemove=0; // Drag and drop for up and down allowed on product
|
||||
|
||||
// List of document
|
||||
$formfile->list_of_documents(
|
||||
|
||||
@ -17,15 +17,15 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// $permission must be defined by caller.
|
||||
// $cssclass must be defined by caller. For example cssclass='fieldtitle"
|
||||
// $permissionnote must be defined by caller. For example $permissionnote=$user->rights->module->create
|
||||
// $cssclass must be defined by caller. For example $cssclass='fieldtitle"
|
||||
$module = $object->element;
|
||||
$note_public = 'note_public';
|
||||
$note_private = 'note_private';
|
||||
|
||||
$colwidth=(isset($colwidth)?$colwidth:(empty($cssclass)?'25':''));
|
||||
|
||||
$permission=(isset($permission)?$permission:(isset($user->rights->$module->creer)?$user->rights->$module->creer:0)); // If already defined by caller page
|
||||
// Set $permission from the $permissionnote var defined on calling page
|
||||
$permission=(isset($permissionnote)?$permissionnote:(isset($permission)?$permission:(isset($user->rights->$module->create)?$user->rights->$module->create:(isset($user->rights->$module->creer)?$user->rights->$module->creer:0))));
|
||||
$moreparam=(isset($moreparam)?$moreparam:'');
|
||||
$value_public=$object->note_public;
|
||||
$value_private=$object->note_private;
|
||||
|
||||
@ -1439,7 +1439,7 @@ else if ($id || $ref)
|
||||
}
|
||||
|
||||
// Shipment card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">'.$langs->trans("BackToList").'</a>';
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer shipment
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1);
|
||||
|
||||
@ -1486,14 +1486,15 @@ class Expedition extends CommonObject
|
||||
/**
|
||||
* Return clicable link of object (with eventually picto)
|
||||
*
|
||||
* @param int $withpicto Add picto into link
|
||||
* @param int $option Where point the link
|
||||
* @param int $max Max length to show
|
||||
* @param int $short Use short labels
|
||||
* @param int $notooltip 1=No tooltip
|
||||
* @return string String with URL
|
||||
* @param int $withpicto Add picto into link
|
||||
* @param int $option Where point the link
|
||||
* @param int $max Max length to show
|
||||
* @param int $short Use short labels
|
||||
* @param int $notooltip 1=No tooltip
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0,$notooltip=0)
|
||||
function getNomUrl($withpicto=0, $option=0, $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -1506,6 +1507,14 @@ class Expedition extends CommonObject
|
||||
|
||||
if ($short) return $url;
|
||||
|
||||
if ($option !== 'nolink')
|
||||
{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
}
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
|
||||
@ -91,7 +91,7 @@ if ($action == 'addcontact' && $user->rights->expedition->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
|
||||
@ -160,8 +160,8 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
|
||||
// Shipment card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer shipment
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1);
|
||||
@ -203,11 +203,11 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
//print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
@ -237,23 +237,23 @@ if ($id > 0 || ! empty($ref))
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
|
||||
//print '</div>';
|
||||
//print '<div class="fichehalfright">';
|
||||
//print '<div class="ficheaddleft">';
|
||||
//print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
|
||||
|
||||
//print '</div>';
|
||||
//print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
// Lignes de contacts
|
||||
|
||||
@ -42,9 +42,10 @@ $result = restrictedArea($user, 'expedition',$expeditionid,'');
|
||||
|
||||
$diroutputmassaction=$conf->expedition->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
$search_ref_exp = GETPOST("search_ref_exp");
|
||||
$search_ref_liv = GETPOST('search_ref_liv');
|
||||
$search_company = GETPOST("search_company");
|
||||
$search_ref_exp = GETPOST("search_ref_exp", 'alpha');
|
||||
$search_ref_liv = GETPOST('search_ref_liv', 'alpha');
|
||||
$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
|
||||
$search_company = GETPOST("search_company", 'alpha');
|
||||
$search_town=GETPOST('search_town','alpha');
|
||||
$search_zip=GETPOST('search_zip','alpha');
|
||||
$search_state=trim(GETPOST("search_state"));
|
||||
@ -133,6 +134,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
{
|
||||
$search_ref_exp='';
|
||||
$search_ref_liv='';
|
||||
$search_ref_customer='';
|
||||
$search_company='';
|
||||
$search_town='';
|
||||
$search_zip="";
|
||||
@ -213,6 +215,7 @@ if ($socid)
|
||||
if ($viewstatut <> '' && $viewstatut >= 0) {
|
||||
$sql.= " AND e.fk_statut = ".$viewstatut;
|
||||
}
|
||||
if ($search_ref_customer != '') $sql.=natural_search('e.ref_customer', $search_ref_customer);
|
||||
if ($search_billed != '' && $search_billed >= 0) $sql.=' AND e.billed = '.$search_billed;
|
||||
if ($search_town) $sql.= natural_search('s.town', $search_town);
|
||||
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
|
||||
@ -262,13 +265,14 @@ if ($resql)
|
||||
$expedition = new Expedition($db);
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($sall) $param.= "&sall=".$sall;
|
||||
if ($search_ref_exp) $param.= "&search_ref_exp=".$search_ref_exp;
|
||||
if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv;
|
||||
if ($search_company) $param.= "&search_company=".$search_company;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
if ($sall) $param.= "&sall=".urlencode($sall);
|
||||
if ($search_ref_exp) $param.= "&search_ref_exp=".urlencode($search_ref_exp);
|
||||
if ($search_ref_liv) $param.= "&search_ref_liv=".urlencode($search_ref_liv);
|
||||
if ($search_ref_customer) $param.= "&search_ref_customer=".urlencode($search_ref_customer);
|
||||
if ($search_company) $param.= "&search_company=".urlencode($search_company);
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
{
|
||||
|
||||
@ -100,9 +100,9 @@ if ($id > 0 || ! empty($ref))
|
||||
$head=shipping_prepare_head($object);
|
||||
dol_fiche_head($head, 'note', $langs->trans("Shipment"), -1, 'sending');
|
||||
|
||||
|
||||
|
||||
// Shipment card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer shipment
|
||||
@ -145,13 +145,13 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
$cssclass='titlefield';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
|
||||
@ -85,14 +85,14 @@ if (empty($reshook))
|
||||
$object->fetch($id);
|
||||
$object->setProject(GETPOST('projectid','int'));
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'confirm_cloture' && GETPOST('confirm','alpha') == 'yes')
|
||||
{
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result = $object->cloture($user);
|
||||
}
|
||||
|
||||
|
||||
// Positionne ref commande client
|
||||
else if ($action == 'setref_client' && $user->rights->commande->creer) {
|
||||
$result = $object->set_ref_client($user, GETPOST('ref_client'));
|
||||
@ -101,12 +101,12 @@ if (empty($reshook))
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'setdatedelivery' && $user->rights->commande->creer)
|
||||
{
|
||||
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
|
||||
$datelivraison=dol_mktime(0, 0, 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int'));
|
||||
|
||||
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result=$object->set_date_livraison($user,$datelivraison);
|
||||
@ -131,7 +131,7 @@ if (empty($reshook))
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'setavailability' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
@ -139,7 +139,7 @@ if (empty($reshook))
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'setdemandreason' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
@ -147,7 +147,7 @@ if (empty($reshook))
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'setconditions' && $user->rights->commande->creer)
|
||||
{
|
||||
$object = new Commande($db);
|
||||
@ -156,7 +156,7 @@ if (empty($reshook))
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
// shipping method
|
||||
if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
@ -165,7 +165,7 @@ if (empty($reshook))
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
// warehouse
|
||||
if ($action == 'setwarehouse' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
@ -174,14 +174,14 @@ if (empty($reshook))
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'update_extras')
|
||||
{
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
@ -197,20 +197,20 @@ if (empty($reshook))
|
||||
} else if ($reshook < 0)
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if ($error)
|
||||
$action = 'edit_extras';
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'set_thirdparty' && $user->rights->commande->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->setValueFrom('fk_soc', $socid, '', '', 'date', '', $user, 'ORDER_MODIFY');
|
||||
|
||||
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||
|
||||
}
|
||||
@ -243,13 +243,13 @@ if ($id > 0 || ! empty($ref))
|
||||
$author->fetch($object->user_author_id);
|
||||
|
||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
||||
|
||||
|
||||
$head = commande_prepare_head($object);
|
||||
dol_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"), -1, 'order');
|
||||
|
||||
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
|
||||
// Confirm validation
|
||||
if ($action == 'cloture')
|
||||
{
|
||||
@ -263,14 +263,14 @@ if ($id > 0 || ! empty($ref))
|
||||
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
|
||||
}
|
||||
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
|
||||
|
||||
// Order card
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
@ -320,7 +320,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Discounts for third party
|
||||
@ -516,9 +516,9 @@ if ($id > 0 || ! empty($ref))
|
||||
print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// TODO How record was recorded OrderMode (llx_c_input_method)
|
||||
|
||||
|
||||
// Incoterms
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
@ -541,7 +541,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
@ -561,18 +561,18 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount VAT
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount TTC
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Total HT
|
||||
print '<tr><td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td>'.price($object->total_ht, 0, '', 1, -1, -1, $conf->currency).'</td>';
|
||||
@ -593,7 +593,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
|
||||
print '<td>' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Total TTC
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($object->total_ttc, 0, '', 1, -1, -1, $conf->currency).'</td>';
|
||||
print '</tr>';
|
||||
@ -603,11 +603,11 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="clearboth"></div><br>';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Lines or orders with quantity shipped and remain to ship
|
||||
* Note: Qty shipped are already available into $object->expeditions[fk_product]
|
||||
@ -654,7 +654,7 @@ if ($id > 0 || ! empty($ref))
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
// Show product and description
|
||||
$type=isset($objp->type)?$objp->type:$objp->product_type;
|
||||
@ -866,14 +866,14 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
print $langs->trans("ValidateOrderFirstBeforeShipment");
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->stock->enabled) && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED))
|
||||
{
|
||||
if ($user->rights->expedition->creer)
|
||||
{
|
||||
//print load_fiche_titre($langs->trans("CreateShipment"));
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
|
||||
print '<form method="GET" action="'.DOL_URL_ROOT.'/expedition/card.php">';
|
||||
print '<input type="hidden" name="action" value="create">';
|
||||
//print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
@ -910,7 +910,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
//print "</table>";
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
$somethingshown=1;
|
||||
|
||||
@ -1454,7 +1454,7 @@ else
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
print '<table class="border" style="width:100%;">';
|
||||
|
||||
@ -1614,7 +1614,7 @@ else
|
||||
print $formconfirm;
|
||||
|
||||
// Expense report card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
/*
|
||||
|
||||
@ -828,7 +828,7 @@ class ExpenseReport extends CommonObject
|
||||
print '<tr>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/expensereport/card.php?id='.$objp->rowid.'">'.$objp->ref_num.'</a></td>';
|
||||
print '<td align="center">'.dol_print_date($objp->date,'day').'</td>';
|
||||
print '<td>'.$author->getNomUrl().'</td>';
|
||||
print '<td>'.$author->getNomUrl(1).'</td>';
|
||||
print '<td>'.$objp->comments.'</td>';
|
||||
print '<td align="right">'.price($objp->total_ht).'</td>';
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
||||
@ -1525,14 +1525,15 @@ class ExpenseReport extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $max Max length of shown ref
|
||||
* @param int $short 1=Return just URL
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $max Max length of shown ref
|
||||
* @param int $short 1=Return just URL
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$max=0,$short=0,$moretitle='',$notooltip=0)
|
||||
function getNomUrl($withpicto=0, $max=0, $short=0, $moretitle='', $notooltip=0, $save_lastsearch_value=-1)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@ -1554,6 +1555,14 @@ class ExpenseReport extends CommonObject
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if ($moretitle) $label.=' - '.$moretitle;
|
||||
|
||||
//if ($option != 'nolink')
|
||||
//{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
//}
|
||||
|
||||
$ref=$this->ref;
|
||||
if (empty($ref)) $ref=$this->id;
|
||||
|
||||
|
||||
@ -93,15 +93,15 @@ if ($object->id)
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("ExpenseReport"), -1, 'trip');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
$totalsize=0;
|
||||
@ -112,7 +112,7 @@ if ($object->id)
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
@ -124,8 +124,8 @@ if ($object->id)
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
|
||||
$modulepart = 'expensereport';
|
||||
$permission = $user->rights->expensereport->creer;
|
||||
$permtoedit = $user->rights->expensereport->creer;
|
||||
|
||||
@ -56,25 +56,25 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("ExpenseReport"), -1, 'trip');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$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>';
|
||||
dol_print_object_info($object);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
@ -80,22 +80,22 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
dol_fiche_head($head, 'note', $langs->trans("ExpenseReport"), -1, 'trip');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
$cssclass="titlefield";
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
@ -1148,7 +1148,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
|
||||
// Intervention card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
|
||||
@ -655,28 +655,52 @@ class Fichinter extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
|
||||
* @param string $option Options
|
||||
* @return string String with URL
|
||||
* @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
|
||||
* @param string $option Options
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
function getNomUrl($withpicto=0, $option='', $notooltip=0, $save_lastsearch_value=-1)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result='';
|
||||
|
||||
$label = '<u>' . $langs->trans("ShowIntervention") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> '.$this->ref;
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$picto='intervention';
|
||||
$url = DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id;
|
||||
|
||||
//if ($option !== 'nolink')
|
||||
//{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
//}
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowIntervention");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
$picto='intervention';
|
||||
|
||||
|
||||
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
|
||||
if ($withpicto != 2) $result.=$linkstart.$this->ref.$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -126,9 +126,9 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
|
||||
// Intervention card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
//$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
@ -169,13 +169,13 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
if (! empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_USER)) $hideaddcontactforuser=1;
|
||||
if (! empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_THIPARTY)) $hideaddcontactforthirdparty=1;
|
||||
|
||||
|
||||
@ -102,9 +102,9 @@ if ($object->id)
|
||||
|
||||
|
||||
// Intervention card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
//$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
@ -145,13 +145,13 @@ if ($object->id)
|
||||
}
|
||||
}
|
||||
$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 '<tr><td class="titlefield">'.$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>';
|
||||
@ -160,7 +160,7 @@ if ($object->id)
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$modulepart = 'ficheinter';
|
||||
$permission = $user->rights->ficheinter->creer;
|
||||
$permtoedit = $user->rights->ficheinter->creer;
|
||||
|
||||
@ -63,7 +63,7 @@ $head = fichinter_prepare_head($object);
|
||||
dol_fiche_head($head, 'info', $langs->trans('InterventionCard'), -1, 'intervention');
|
||||
|
||||
// Intervention card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
|
||||
@ -61,14 +61,14 @@ $form = new Form($db);
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
|
||||
$head = fichinter_prepare_head($object);
|
||||
dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), -1, 'intervention');
|
||||
|
||||
// Intervention card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
//$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
@ -109,17 +109,17 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
$cssclass="titlefield";
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
@ -594,12 +594,13 @@ class CommandeFournisseur extends CommonOrder
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param string $option On what the link points
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string Chain with URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param string $option On what the link points
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chain with URL
|
||||
*/
|
||||
public function getNomUrl($withpicto=0,$option='',$notooltip=0)
|
||||
public function getNomUrl($withpicto=0, $option='', $notooltip=0, $save_lastsearch_value=-1)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@ -619,6 +620,14 @@ class CommandeFournisseur extends CommonOrder
|
||||
$picto='order';
|
||||
$url = DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id;
|
||||
|
||||
if ($option !== 'nolink')
|
||||
{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
}
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user