Optimize with smartphone

This commit is contained in:
Laurent Destailleur 2013-04-03 00:36:31 +02:00
parent f98e40f694
commit 08be243dc4
6 changed files with 68 additions and 40 deletions

View File

@ -1893,13 +1893,28 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '</tr>';
// Societe
// Third party
print '<tr><td>'.$langs->trans('Company').'</td>';
print '<td colspan="3">'.$soc->getNomUrl(1).'</td>';
print '</tr>';
// Ligne info remises tiers
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
{
$filterabsolutediscount="fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
$filtercreditnote="fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
}
else
{
$filterabsolutediscount="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')";
$filtercreditnote="fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'";
}
// Relative and absolute discounts
$addrelativediscount='<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditRelativeDiscounts").'</a>';
$addabsolutediscount='<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditGlobalDiscounts").'</a>';
$addcreditnote='<a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$soc->id.'&type=2&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddCreditNote").'</a>';
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount");
print '. ';
@ -1915,10 +1930,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
}
else
{
// Remise dispo de type non avoir
$filter='fk_facture_source IS NULL';
// Remise dispo de type remise fixe (not credit note)
print '<br>';
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter);
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filterabsolutediscount);
}
}
if ($absolute_creditnote)
@ -1958,10 +1972,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DateDeliveryPlanned');
print '</td>';
if ($action != 'editdate_livraison') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td colspan="3">';
if ($action == 'editdate_livraison')
{
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
@ -1976,6 +1989,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : '&nbsp;';
}
print '</td>';
print '</tr>';
// Terms of payment
print '<tr><td height="10">';
@ -1984,7 +1998,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '</td>';
if ($action != 'editconditions' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&amp;id='.$object->id.'">'.img_edit($langs->trans('SetConditions'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td colspan="3">';
if ($action == 'editconditions')
{
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id',1);
@ -2004,7 +2018,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '</td>';
if ($action != 'editmode' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$object->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td colspan="3">';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
@ -2022,7 +2036,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '</td>';
if ($action != 'editavailability' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editavailability&amp;id='.$object->id.'">'.img_edit($langs->trans('SetAvailability'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td colspan="3">';
if ($action == 'editavailability')
{
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id',1);
@ -2040,7 +2054,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '</td>';
if ($action != 'editdemandreason' && ! empty($object->brouillon)) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdemandreason&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDemandReason'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td colspan="3">';
if ($action == 'editdemandreason')
{
$form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1);
@ -2065,7 +2079,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '</td>';
if ($action != 'classify') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td colspan="3">';
//print "$object->id, $object->socid, $object->fk_project";
if ($action == 'classify')
{
@ -2079,52 +2093,52 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
}
// Other attributes
$parameters=array('colspan' => ' colspan="2"');
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields,'edit');
}
$rowspan=4;
if ($mysoc->localtax1_assuj=="1") $rowspan++;
if ($mysoc->localtax2_assuj=="1") $rowspan++;
// Total HT
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
print '<td align="right"><b>'.price($object->total_ht).'</b></td>';
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td>';
print '<td align="right">'.price($object->total_ht,'',$langs,'','',0,$conf->currency).'</td>';
// Margin Infos
if (! empty($conf->margin->enabled)) {
print '<td valign="top" width="50%" rowspan="4">';
if (! empty($conf->margin->enabled))
{
print '<td valign="top" width="50%" colspan="2" rowspan="'.$rowspan.'">';
$object->displayMarginInfos();
print '</td>';
}
else print '<td width="50%" colspan="2" rowspan="'.$rowspan.'"></td>';
print '</tr>';
// Total TVA
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($object->total_tva).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($object->total_tva,'',$langs,'','',0,$conf->currency).'</td></tr>';
// Amount Local Taxes
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<td align="right">'.price($object->total_localtax1,'',$langs,'','',0,$conf->currency).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<td align="right">'.price($object->total_localtax2,'',$langs,'','',0,$conf->currency).'</td></tr>';
}
// Total TTC
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right">'.price($object->total_ttc).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right">'.price($object->total_ttc,'',$langs,'','',0,$conf->currency).'</td></tr>';
// Statut
print '<tr><td>'.$langs->trans('Status').'</td>';
print '<td colspan="2">'.$object->getLibStatut(4).'</td>';
print '</tr>';
print '<tr><td>'.$langs->trans('Status').'</td><td>'.$object->getLibStatut(4).'</td></tr>';
print '</table><br>';
print "\n";

View File

@ -305,6 +305,10 @@ function ajax_dialog($title,$message,$w=350,$h=150)
*/
function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0)
{
global $conf;
if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works)
$msg = '<script type="text/javascript">
$(function() {
$("#'.$htmlname.'").combobox({

View File

@ -588,10 +588,14 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
*/
function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0)
{
global $conf;
$out="\n".'<div class="tabs">'."\n";
// Affichage titre
if (! empty($title))
// Show title
$showtitle=1;
if (! empty($conf->browser->phone)) $showtitle=0;
if (! empty($title) && $showtitle)
{
$limittitle=30;
$out.='<a class="tabTitle">';

View File

@ -196,9 +196,7 @@ class MenuManager
$tmpmainmenu=$val['mainmenu'];
$tmpleftmenu='all';
$submenu=new Menu();
//var_dump($tmpmainmenu.' - '.$tmpleftmenu);
$res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu);
//var_dump($submenu->liste);
$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
$canonrelurl=preg_replace('/\?.*$/','',$relurl);

View File

@ -160,18 +160,24 @@ class MenuManager
//var_dump($canonrelurl);
//var_dump($canonnexturl);
print '<ul>';
if ($canonrelurl != $canonnexturl && $val['mainmenu'] != 'home')
if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools')))
{
// We add sub entry
print '<li data-role="list-divider"><a href="'.$relurl.'">'.$langs->trans("MainArea").'-'.$val['titre'].'</a></li>'."\n";
}
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
{
$relurl2=dol_buildpath($val2['url'],1);
$relurl2=dol_buildpath($val2['url'],1);
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
//var_dump($val2);
print '<li'.($val2['level']==0?' data-role="list-divider"':'').'><a href="'.$relurl2.'">'.$val2['titre'].'</a></li>'."\n";
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
print '<li'.($val2['level']==0?' data-role="list-divider"':'').'>';
if ($relurl2) print '<a href="'.$relurl2.'">';
print $val2['titre'];
if ($relurl2) print '</a>';
print '</li>'."\n";
}
//var_dump($submenu);
print '</ul>';

View File

@ -67,6 +67,8 @@ if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global-
$fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif';
$img_head=dol_buildpath($path.'/theme/'.$theme.'/img/headbg2.jpg',1);
$img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1);
$dol_hide_topmenu=(! empty($_SESSION['dol_hide_topmenu']) || GETPOST('dol_hide_topmenu'));
$dol_hide_leftmenu=(! empty($_SESSION['dol_hide_leftmenu']) || GETPOST('dol_hide_leftmenu'));
// Define reference colors
// Example: Light grey: $colred=235;$colgreen=235;$colblue=235;
@ -356,7 +358,7 @@ td.showDragHandle {
/* ============================================================================== */
div.fiche {
margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:((empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?((empty($_SESSION['dol_hide_leftmenu']) && ! GETPOST('dol_hide_leftmenu'))?'20':'4'):'24')); ?>px;
margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:((empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?($dol_hide_leftmenu?'4':'20'):'24')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->browser->phone)?'12':'6')); ?>px;
}
@ -1443,7 +1445,7 @@ span.butAction, span.butActionDelete {
#undertopmenu {
/* background-image: url("<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/gradient.gif',1) ?>"); */
background-repeat: repeat-x;
margin-top: 0px;
margin-top: <?php echo ($dol_hide_topmenu?'6':'0'); ?>px;
}
@ -2522,7 +2524,7 @@ div.dolEventError h1, div.dolEventError h2 {
/* JMobile */
/* ============================================================================== */
.ui-body-c .ui-link {
li.ui-li-divider .ui-link {
color: #FFF !important;
}
/*