Exemplo n.º 1
0
	print '<td class="liste_titre">';
	$listetype=$membertypestatic->liste_array();
	print $form->selectarray("type", $listetype, $_REQUEST["type"], 1, 0, 0, '', 0, 12);
	print '</td>';

	print '<td class="liste_titre">&nbsp;</td>';

	print '<td class="liste_titre" align="left">';
	print '<input class="flat" type="text" name="search_email" value="'.$_REQUEST["search_email"].'" size="12"></td>';

	print '<td class="liste_titre">&nbsp;</td>';

	print '<td align="right" colspan="2" class="liste_titre">';
	print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
	print '&nbsp; ';
	print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
	print '</td>';

	print "</tr>\n";
	print '</form>';

	$var=True;
	while ($i < $num && $i < $conf->liste_limit)
	{
		$objp = $db->fetch_object($resql);

		$datefin=$db->jdate($objp->datefin);

		$adh=new Adherent($db);

		// Nom
Exemplo n.º 2
0
		print '<form method="get" action="impayees.php">';
		print '<tr class="liste_titre">';
		print '<td class="liste_titre">';
		print '<input class="flat" size="8" type="text" name="search_ref" value="'.$_GET["search_ref"].'"></td>';
		print '<td class="liste_titre">';
		print '<input class="flat" size="8" type="text" name="search_ref_supplier" value="'.$_GET["search_ref_supplier"].'"></td>';
		print '<td class="liste_titre">&nbsp;</td>';
		print '<td class="liste_titre">&nbsp;</td>';
		print '<td class="liste_titre" align="left">';
		print '<input class="flat" type="text" size="6" name="search_societe" value="'.$_GET["search_societe"].'">';
		print '</td><td class="liste_titre" align="right">';
		print '<input class="flat" type="text" size="8" name="search_montant_ht" value="'.$_GET["search_montant_ht"].'">';
		print '</td><td class="liste_titre" align="right">';
		print '<input class="flat" type="text" size="8" name="search_montant_ttc" value="'.$_GET["search_montant_ttc"].'">';
		print '</td><td class="liste_titre" colspan="2" align="right">';
		print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
		print '</td>';
		print "</tr>\n";
		print '</form>';


		if ($num > 0)
		{
			$var=True;
			$total_ht=0;
			$total_ttc=0;
			$total_paid=0;

			while ($i < $num)
			{
				$objp = $db->fetch_object($result);
 }
 // We are on a specific warehouse card, no filter on other should be possible
 print '</td>';
 print '<td class="liste_titre" align="left">';
 if (empty($idproduct) || $idproduct < 0) {
     print '<input class="flat" type="text" size="10" name="search_warehouse_destiny" value="' . $search_warehouse_destiny . '">';
 }
 // We are on a specific warehouse card, no filter on other should be possible
 print '</td>';
 print '<td class="liste_titre" align="left">';
 print '<input class="flat" type="text" size="6" name="search_user" value="' . $search_user . '">';
 print '</td>';
 print '<td class="liste_titre" align="right">';
 print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
 print '&nbsp; ';
 print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
 print '</td>';
 print "</tr>\n";
 print '</form>';
 $arrayofuniqueproduct = array();
 $var = True;
 while ($i < min($num, $conf->liste_limit)) {
     $objp = $db->fetch_object($resql);
     $entrepot_origen = $obj->stock;
     $entrepot_destino = $obj->stock;
     $entrepot_id_origen = $obj->entrepot_id;
     $entrepot_id_destino = $obj->entrepot_id;
     // Checkpoin: evaluar las transferencias
     if (substr($objp->label, 0, 6) == 'Transf') {
         if ((double) $objp->value < 0) {
             $entrepot_origen = $objp->stock;
Exemplo n.º 4
0
        echo '<a class="alogin" href="' . DOL_URL_ROOT . '/user/passwordforgotten.php' . $moreparam . '">(';
        echo $langs->trans('PasswordForgotten');
        if (!$helpcenterlink) {
            echo ')';
        }
        echo '</a>';
    }
    if ($forgetpasslink && $helpcenterlink) {
        echo '&nbsp;-&nbsp;';
    }
    if ($helpcenterlink) {
        $url = DOL_URL_ROOT . '/support/index.php' . $moreparam;
        if (!empty($conf->global->MAIN_HELPCENTER_LINKTOUSE)) {
            $url = $conf->global->MAIN_HELPCENTER_LINKTOUSE;
        }
        echo '<a class="alogin" href="' . dol_escape_htmltag($url) . '" target="_blank">';
        if (!$forgetpasslink) {
            echo '(';
        }
        echo $langs->trans('NeedHelpCenter');
        echo ')</a>';
    }
    echo '</div>';
}
if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication)) {
    $langs->load("users");
    //if (! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $url=
    echo '<br>';
    echo '<div align="center" style="margin-top: 4px;">';
    $url = $conf->global->MAIN_AUTHENTICATION_OPENID_URL;
    if (!empty($url)) {
Exemplo n.º 5
0
    /**
     * Build a graph onto disk using JFlot library. Input when calling this method should be:
     *	$this->data  = array(array(      0=>'labelxA',     1=>yA),  array('labelxB',yB)); or
     *  $this->data  = array(array('label'=>'labelxA','data'=>yA),  array('labelxB',yB));			// TODO Syntax not supported. Removed when dol_print_graph_removed
     *	$this->data  = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn));   // when there is n series to show for each x
     *  $this->legend= array("Val1",...,"Valn");													// list of n series name
     *  $this->type  = array('bars',...'lines'); or array('pie')
     *  $this->mode = 'depth' ???
     *  $this->bgcolorgrid
     *  $this->datacolor
     *
     * @param	string	$file    	Image file name to use to save onto disk (also used as javascript unique id)
     * @param	string	$fileurl	Url path to show image if saved onto disk
     * @return	void
     */
    private function draw_jflot($file, $fileurl)
    {
        global $artichow_defaultfont;
        dol_syslog(get_class($this) . "::draw_jflot this->type=" . join(',', $this->type));
        if (empty($this->width) && empty($this->height)) {
            print 'Error width or height not set';
            return;
        }
        $legends = array();
        $nblot = count($this->data[0]) - 1;
        // -1 to remove legend
        if ($nblot < 0) {
            dol_print_error('Bad value for property ->data. Must be set by mydolgraph->SetData before callinf mydolgrapgh->draw');
        }
        $firstlot = 0;
        // Works with line but not with bars
        //if ($nblot > 2) $firstlot = ($nblot - 2);        // We limit nblot to 2 because jflot can't manage more than 2 bars on same x
        $i = $firstlot;
        $serie = array();
        while ($i < $nblot) {
            $values = array();
            // Array with horizontal y values (specific values of a serie) for each abscisse x
            $serie[$i] = "var d" . $i . " = [];\n";
            // Fill array $values
            $x = 0;
            foreach ($this->data as $valarray) {
                $legends[$x] = $valarray[0];
                $values[$x] = is_numeric($valarray[$i + 1]) ? $valarray[$i + 1] : null;
                $x++;
            }
            // TODO Avoid push by adding generated long array...
            if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie') {
                foreach ($values as $x => $y) {
                    if (isset($y)) {
                        $serie[$i] .= 'd' . $i . '.push({"label":"' . dol_escape_js($legends[$x]) . '", "data":' . $y . '});' . "\n";
                    }
                }
            } else {
                foreach ($values as $x => $y) {
                    if (isset($y)) {
                        $serie[$i] .= 'd' . $i . '.push([' . $x . ', ' . $y . ']);' . "\n";
                    }
                }
            }
            unset($values);
            $i++;
        }
        $tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.'))));
        $this->_stringtoshow = '<!-- Build using ' . $this->_library . ' -->' . "\n";
        if (!empty($this->title)) {
            $this->_stringtoshow .= '<div align="center" class="dolgraphtitle' . (empty($this->cssprefix) ? '' : ' dolgraphtitle' . $this->cssprefix) . '">' . $this->title . '</div>';
        }
        $this->_stringtoshow .= '<div id="placeholder_' . $tag . '" style="width:' . $this->width . 'px;height:' . $this->height . 'px;" class="dolgraph' . (empty($this->cssprefix) ? '' : ' dolgraph' . $this->cssprefix) . '"></div>' . "\n";
        $this->_stringtoshow .= '<script id="' . $tag . '">' . "\n";
        $this->_stringtoshow .= '$(function () {' . "\n";
        $i = $firstlot;
        while ($i < $nblot) {
            $this->_stringtoshow .= $serie[$i];
            $i++;
        }
        $this->_stringtoshow .= "\n";
        // Special case for Graph of type 'pie'
        if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie') {
            $datacolor = array();
            foreach ($this->datacolor as $val) {
                $datacolor[] = "#" . sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]);
            }
            $urltemp = '';
            // TODO Add support for url link into labels
            $showlegend = $this->showlegend;
            $showpointvalue = $this->showpointvalue;
            $showpercent = $this->showpercent;
            $this->_stringtoshow .= '
			function plotWithOptions_' . $tag . '() {
			$.plot($("#placeholder_' . $tag . '"), d0,
			{
			series: {
			pie: {
			show: true,
			radius: 3/4,
			label: {
			show: true,
			radius: 3/4,
			formatter: function(label, series) {
			var percent=Math.round(series.percent);
			var number=series.data[0][1];
			return \'';
            $this->_stringtoshow .= '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">';
            if ($urltemp) {
                $this->_stringtoshow .= '<a style="color: #FFFFFF;" border="0" href="' . $urltemp . '">';
            }
            $this->_stringtoshow .= '\'+';
            $this->_stringtoshow .= $showlegend ? '' : 'label+\'<br/>\'+';
            // Hide label if already shown in legend
            $this->_stringtoshow .= $showpointvalue ? 'number+' : '';
            $this->_stringtoshow .= $showpercent ? '\'<br/>\'+percent+\'%\'+' : '';
            $this->_stringtoshow .= '\'';
            if ($urltemp) {
                $this->_stringtoshow .= '</a>';
            }
            $this->_stringtoshow .= '</div>\';
			},
			background: {
			opacity: 0.5,
			color: \'#000000\'
			}
			}
			}
			},
			zoom: {
			interactive: true
			},
			pan: {
			interactive: true
			},';
            if (count($datacolor)) {
                $this->_stringtoshow .= 'colors: ' . (!empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor)) . ',';
            }
            $this->_stringtoshow .= 'legend: {show: ' . ($showlegend ? 'true' : 'false') . ', position: \'ne\' }
		});
		}' . "\n";
        } else {
            // Add code to support tooltips
            $this->_stringtoshow .= '
			function showTooltip_' . $tag . '(x, y, contents) {
				$(\'<div id="tooltip_' . $tag . '">\' + contents + \'</div>\').css({
					position: \'absolute\',
					display: \'none\',
					top: y + 5,
					left: x + 5,
					border: \'1px solid #ddd\',
					padding: \'2px\',
					\'background-color\': \'#ffe\',
					width: 200,
					opacity: 0.80
				}).appendTo("body").fadeIn(20);
			}

			var previousPoint = null;
			$("#placeholder_' . $tag . '").bind("plothover", function (event, pos, item) {
				$("#x").text(pos.x.toFixed(2));
				$("#y").text(pos.y.toFixed(2));

				if (item) {
					if (previousPoint != item.dataIndex) {
						previousPoint = item.dataIndex;

						$("#tooltip").remove();
						/* console.log(item); */
						var x = item.datapoint[0].toFixed(2);
						var y = item.datapoint[1].toFixed(2);
						var z = item.series.xaxis.ticks[item.dataIndex].label;
						';
            if ($this->showpointvalue > 0) {
                $this->_stringtoshow .= '
							showTooltip_' . $tag . '(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y);
						';
            }
            $this->_stringtoshow .= '
					}
				}
				else {
					$("#tooltip_' . $tag . '").remove();
					previousPoint = null;
				}
			});
			';
            $this->_stringtoshow .= 'var stack = null, steps = false;' . "\n";
            $this->_stringtoshow .= 'function plotWithOptions_' . $tag . '() {' . "\n";
            $this->_stringtoshow .= '$.plot($("#placeholder_' . $tag . '"), [ ' . "\n";
            $i = $firstlot;
            while ($i < $nblot) {
                if ($i > $firstlot) {
                    $this->_stringtoshow .= ', ' . "\n";
                }
                $color = sprintf("%02x%02x%02x", $this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2]);
                $this->_stringtoshow .= '{ ';
                if (!isset($this->type[$i]) || $this->type[$i] == 'bars') {
                    $this->_stringtoshow .= 'bars: { show: true, align: "' . ($i == $firstlot ? 'center' : 'left') . '", barWidth: 0.5 }, ';
                }
                if (isset($this->type[$i]) && $this->type[$i] == 'lines') {
                    $this->_stringtoshow .= 'lines: { show: true, fill: false }, ';
                }
                $this->_stringtoshow .= 'color: "#' . $color . '", label: "' . (isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '') . '", data: d' . $i . ' }';
                $i++;
            }
            $this->_stringtoshow .= "\n" . ' ], { series: { stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }' . "\n";
            // Xaxis
            $this->_stringtoshow .= ', xaxis: { ticks: [' . "\n";
            $x = 0;
            foreach ($this->data as $key => $valarray) {
                if ($x > 0) {
                    $this->_stringtoshow .= ', ' . "\n";
                }
                $this->_stringtoshow .= ' [' . $x . ', "' . $valarray[0] . '"]';
                $x++;
            }
            $this->_stringtoshow .= '] }' . "\n";
            // Yaxis
            $this->_stringtoshow .= ', yaxis: { min: ' . $this->MinValue . ', max: ' . $this->MaxValue . ' }' . "\n";
            // Background color
            $color1 = sprintf("%02x%02x%02x", $this->bgcolorgrid[0], $this->bgcolorgrid[0], $this->bgcolorgrid[2]);
            $color2 = sprintf("%02x%02x%02x", $this->bgcolorgrid[0], $this->bgcolorgrid[1], $this->bgcolorgrid[2]);
            $this->_stringtoshow .= ', grid: { hoverable: true, backgroundColor: { colors: ["#' . $color1 . '", "#' . $color2 . '"] } }' . "\n";
            //$this->_stringtoshow.=', shadowSize: 20'."\n";    TODO Uncommet this
            $this->_stringtoshow .= '});' . "\n";
            $this->_stringtoshow .= '}' . "\n";
        }
        $this->_stringtoshow .= 'plotWithOptions_' . $tag . '();' . "\n";
        $this->_stringtoshow .= '});' . "\n";
        $this->_stringtoshow .= '</script>' . "\n";
    }
Exemplo n.º 6
0
                case "submit":
                    if ($key['enabled']) {
                        $submit_enabled = 1;
                    }
                    break;
            }
            $i++;
        }
    } else {
        print $langs->trans('PleaseSelectaDriverfromList');
    }
    print '</table>';
    dol_fiche_end();
    if (!empty($driver)) {
        if ($submit_enabled) {
            print '<div class="center"><input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans("Modify")) . '"></div>';
        }
    }
    print '</form>';
}
if ($mode == 'config' && $user->admin) {
    dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic');
    print $langs->trans("PrintingDesc") . "<br><br>\n";
    print '<table class="noborder" width="100%">' . "\n";
    $var = true;
    print '<tr class="liste_titre">';
    print '<th>' . $langs->trans("Description") . '</th>';
    print '<th class="center">' . $langs->trans("Active") . '</th>';
    print '<th class="center">' . $langs->trans("Setup") . '</th>';
    print '<th class="center">' . $langs->trans("TargetedPrinter") . '</th>';
    print "</tr>\n";
Exemplo n.º 7
0
print $form->select_date($birthday, 'birth', 0, 0, 1, "newmember");
print '</td></tr>' . "\n";
// Photo
print '<tr><td>' . $langs->trans("URLPhoto") . '</td><td><input type="text" name="photo" size="40" value="' . dol_escape_htmltag(GETPOST('photo')) . '"></td></tr>' . "\n";
// Public
print '<tr><td>' . $langs->trans("Public") . '</td><td><input type="checkbox" name="public" value="1" checked></td></tr>' . "\n";
// Extrafields
foreach ($extrafields->attribute_label as $key => $value) {
    print "<tr><td>" . $value . "</td><td>";
    print $extrafields->showInputField($key, GETPOST('options_' . $key));
    print "</td></tr>\n";
}
// Comments
print '<tr>';
print '<td valign="top">' . $langs->trans("Comments") . '</td>';
print '<td valign="top"><textarea name="comment" wrap="soft" cols="60" rows="' . ROWS_4 . '">' . dol_escape_htmltag(GETPOST('comment')) . '</textarea></td>';
print '</tr>' . "\n";
// Add specific fields used by Dolibarr foundation for example
if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
    $arraybudget = array('50' => '<= 100 000', '100' => '<= 200 000', '200' => '<= 500 000', '300' => '<= 1 500 000', '600' => '<= 3 000 000', '1000' => '<= 5 000 000', '2000' => '5 000 000+');
    print '<tr id="trbudget" class="trcompany"><td>' . $langs->trans("TurnoverOrBudget") . ' <FONT COLOR="red">*</FONT></td><td>';
    print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1);
    print ' € or $';
    print '<script type="text/javascript">
    jQuery(document).ready(function () {
        initturnover();
        jQuery("#morphy").click(function() {
            initturnover();
        });
        jQuery("#budget").change(function() {
                if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
Exemplo n.º 8
0
            $var = !$var;

            // Rupture detectee, on recupere objMod
            $objMod=$modules[$obj->module];
            $picto=($objMod->picto?$objMod->picto:'generic');

            if ($caneditperms && (! $objMod->rights_admin_allowed || ! $fuser->admin))
            {
                // On affiche ligne pour modifier droits
                print '<tr '. $bc[$var].'>';
                print '<td nowrap="nowrap">'.img_object('',$picto).' '.$objMod->getName();
                print '<a name="'.$objMod->getName().'">&nbsp;</a></td>';
                print '<td align="center" nowrap="nowrap">';
                print '<a title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="perms.php?id='.$fuser->id.'&amp;action=addrights&amp;module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("All")."</a>";
                print '/';
                print '<a title="'.dol_escape_htmltag($langs->trans("None")).'" alt="'.dol_escape_htmltag($langs->trans("None")).'" href="perms.php?id='.$fuser->id.'&amp;action=delrights&amp;module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("None")."</a>";
                print '</td>';
                print '<td colspan="2">&nbsp;</td>';
                print '</tr>'."\n";
            }
        }

        print '<tr '. $bc[$var].'>';

        // Picto and label of permission
        print '<td>'.img_object('',$picto).' '.$objMod->getName();
        print '</td>';

        // Permission and tick
        if ($fuser->admin && $objMod->rights_admin_allowed)
        {
Exemplo n.º 9
0
     $showdatefilter++;
 }
 print '<br>';
 print_titre($langs->trans($title));
 $selectList = $formproject->select_element($tablename, $project->thirdparty->id);
 if (!$selectList || $selectList < 0) {
     setEventMessage($formproject->error, 'errors');
 } else {
     print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $projectid . '" method="post">';
     print '<input type="hidden" name="tablename" value="' . $tablename . '">';
     print '<input type="hidden" name="action" value="addelement">';
     print '<input type="hidden" name="datesrfc" value="' . dol_print_date($dates, 'dayhourrfc') . '">';
     print '<input type="hidden" name="dateerfc" value="' . dol_print_date($datee, 'dayhourrfc') . '">';
     print '<table><tr><td>' . $langs->trans("SelectElement") . '</td>';
     print '<td>' . $selectList . '</td>';
     print '<td><input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans("AddElement")) . '"></td>';
     print '</tr></table>';
     print '</form>';
 }
 print '<table class="noborder" width="100%">';
 print '<tr class="liste_titre">';
 print '<td width="100" colspan="2">' . $langs->trans("Ref") . '</td>';
 print '<td width="100" align="center">' . $langs->trans("Date") . '</td>';
 print '<td>' . $langs->trans("ThirdParty") . '</td>';
 if (empty($value['disableamount'])) {
     print '<td align="right" width="120">' . $langs->trans("AmountHT") . '</td>';
 } else {
     print '<td width="120"></td>';
 }
 if (empty($value['disableamount'])) {
     print '<td align="right" width="120">' . $langs->trans("AmountTTC") . '</td>';
Exemplo n.º 10
0
print '<!-- Form to crop -->'."\n";
print '<fieldset id="redim_file">';
print '<legend>'.$langs->trans("Recenter").'</legend>';
print $langs->trans("DefineNewAreaToPick").'...<br>';
print '<br><center>';
print '<div style="border: 1px solid #888888; width: '.$width.'px;"><img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.$original_file.'" alt="" id="cropbox" /></div>';
print '</center><br>';
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$_GET['id'].'" method="post" onsubmit="return checkCoords();">
      <div class="jc_coords">
         '.$langs->trans("NewSizeAfterCropping").':
         <label>X1 <input type="text" size="4" id="x" name="x" /></label>
         <label>Y1 <input type="text" size="4" id="y" name="y" /></label>
         <label>X2 <input type="text" size="4" id="x2" name="x2" /></label>
         <label>Y2 <input type="text" size="4" id="y2" name="y2" /></label>
         <label>W <input type="text" size="4" id="w" name="w" /></label>
         <label>H <input type="text" size="4" id="h" name="h" /></label>
      </div>

      <input type="hidden" id="file" name="file" value="'.urlencode($original_file).'" />
      <input type="hidden" id="action" name="action" value="confirm_crop" />
      <input type="hidden" id="product" name="product" value="'.$_REQUEST['id'].'" />
	  <input type="hidden" name="id" value="'.$_REQUEST['id'].'" />
      <br><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Recenter")).'" />
   </form>';
print '</fieldset>';

}


llxFooter('$Date: 2011/07/31 23:45:15 $ - $Revision: 1.14 $');
?>
Exemplo n.º 11
0
 /**
  *Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
  *
  * @param   array   $head       Array with properties of box title
  * @param   array   $contents   Array with properties of box lines
  *
  * @return  void
  */
 function showBox($head, $contents)
 {
     global $langs, $user, $conf;
     require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
     $MAXLENGTHBOX = 60;
     // Mettre 0 pour pas de limite
     $bcx = array();
     $bcx[0] = 'class="box_pair"';
     $bcx[1] = 'class="box_impair"';
     $var = false;
     $cachetime = 900;
     // 900 : 15mn
     $cachedir = DOL_DATA_ROOT . '/boxes/temp';
     $fileid = get_class($this) . 'id-' . $this->box_id . '-e' . $conf->entity . '-u' . $user->id . '-s' . $user->societe_id . '.cache';
     $filename = '/box-' . $fileid;
     $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
     $out = '';
     if ($refresh) {
         dol_syslog(get_class($this) . '::showBox');
         // Define nbcol and nblines of the box to show
         $nbcol = 0;
         if (isset($contents[0])) {
             $nbcol = count($contents[0]);
         }
         $nblines = count($contents);
         $out .= "\n<!-- Box " . get_class($this) . " start -->\n";
         $out .= '<div class="box" id="boxto_' . $this->box_id . '">' . "\n";
         if (!empty($head['text']) || !empty($head['sublink']) || !empty($head['subpicto']) || $nblines) {
             $out .= '<table summary="boxtable' . $this->box_id . '" width="100%" class="noborder boxtable">' . "\n";
         }
         // Show box title
         if (!empty($head['text']) || !empty($head['sublink']) || !empty($head['subpicto'])) {
             //$out.= '<div id="boxto_'.$this->box_id.'_title">'."\n";
             //$out.= '<table summary="boxtabletitle'.$this->box_id.'" width="100%" class="noborder">'."\n";
             $out .= '<tr class="box_titre">';
             $out .= '<td';
             if ($nbcol > 0) {
                 $out .= ' colspan="' . $nbcol . '"';
             }
             $out .= '>';
             if ($conf->use_javascript_ajax) {
                 $out .= '<table summary="" class="nobordernopadding" width="100%"><tr><td>';
             }
             if (!empty($head['text'])) {
                 $s = dol_trunc($head['text'], isset($head['limit']) ? $head['limit'] : $MAXLENGTHBOX);
                 $out .= $s;
             }
             $out .= ' ';
             if (!empty($head['sublink'])) {
                 $out .= '<a href="' . $head['sublink'] . '"' . (empty($head['target']) ? ' target="_blank"' : '') . '>';
             }
             if (!empty($head['subpicto'])) {
                 $out .= img_picto($head['subtext'], $head['subpicto'], 'class="' . (empty($head['subclass']) ? '' : $head['subclass']) . '" id="idsubimg' . $this->boxcode . '"');
             }
             if (!empty($head['sublink'])) {
                 '</a>';
             }
             if (!empty($conf->use_javascript_ajax)) {
                 $out .= '</td><td class="nocellnopadd boxclose nowrap">';
                 // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
                 $out .= img_picto($langs->trans("MoveBox", $this->box_id), 'grip_title', 'class="boxhandle hideonsmartphone" style="cursor:move;"');
                 $out .= img_picto($langs->trans("Close2", $this->box_id), 'close_title', 'class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose' . $this->box_id . '"');
                 $label = $head['text'];
                 if (!empty($head['graph'])) {
                     $label .= ' (' . $langs->trans("Graph") . ')';
                 }
                 $out .= '<input type="hidden" id="boxlabelentry' . $this->box_id . '" value="' . dol_escape_htmltag($label) . '">';
                 $out .= '</td></tr></table>';
             }
             $out .= '</td>';
             $out .= "</tr>\n";
             //$out.= "</table>\n";
             //$out.= "</div>\n";
         }
         // Show box lines
         if ($nblines) {
             //$out.= '<table summary="boxtablelines'.$this->box_id.'" width="100%" class="noborder">'."\n";
             // Loop on each record
             for ($i = 0, $n = $nblines; $i < $n; $i++) {
                 if (isset($contents[$i])) {
                     $var = !$var;
                     // TR
                     if (isset($contents[$i][0]['tr'])) {
                         $out .= '<tr valign="top" ' . $contents[$i][0]['tr'] . '>';
                     } else {
                         $out .= '<tr valign="top" ' . $bcx[$var] . '>';
                     }
                     // Loop on each TD
                     $nbcolthisline = count($contents[$i]);
                     for ($j = 0; $j < $nbcolthisline; $j++) {
                         // Define tdparam
                         $tdparam = '';
                         if (isset($contents[$i][$j]['td'])) {
                             $tdparam .= ' ' . $contents[$i][$j]['td'];
                         }
                         $text = isset($contents[$i][$j]['text']) ? $contents[$i][$j]['text'] : '';
                         $textwithnotags = preg_replace('/<([^>]+)>/i', '', $text);
                         $text2 = isset($contents[$i][$j]['text2']) ? $contents[$i][$j]['text2'] : '';
                         $text2withnotags = preg_replace('/<([^>]+)>/i', '', $text2);
                         $textnoformat = isset($contents[$i][$j]['textnoformat']) ? $contents[$i][$j]['textnoformat'] : '';
                         //$out.= "xxx $textwithnotags y";
                         if (empty($contents[$i][$j]['tooltip'])) {
                             $contents[$i][$j]['tooltip'] = "";
                         }
                         $tooltip = isset($contents[$i][$j]['tooltip']) ? $contents[$i][$j]['tooltip'] : '';
                         $out .= '<td' . $tdparam . '>' . "\n";
                         // Url
                         if (!empty($contents[$i][$j]['url']) && empty($contents[$i][$j]['logo'])) {
                             $out .= '<a href="' . $contents[$i][$j]['url'] . '" title="' . dol_escape_htmltag($langs->trans("Show") . ' ' . $tooltip, 1) . '" class="classfortooltip"';
                             //$out.= ' alt="'.$textwithnotags.'"';      // Pas de alt sur un "<a href>"
                             $out .= isset($contents[$i][$j]['target']) ? ' target="' . $contents[$i][$j]['target'] . '"' : '';
                             $out .= '>';
                         }
                         // Logo
                         if (!empty($contents[$i][$j]['logo'])) {
                             $logo = preg_replace("/^object_/i", "", $contents[$i][$j]['logo']);
                             $out .= '<a href="' . $contents[$i][$j]['url'] . '">';
                             $out .= img_object($langs->trans("Show") . ' ' . $tooltip, $logo, 'class="classfortooltip"');
                         }
                         $maxlength = $MAXLENGTHBOX;
                         if (!empty($contents[$i][$j]['maxlength'])) {
                             $maxlength = $contents[$i][$j]['maxlength'];
                         }
                         if ($maxlength) {
                             $textwithnotags = dol_trunc($textwithnotags, $maxlength);
                         }
                         if (preg_match('/^<img/i', $text) || !empty($contents[$i][$j]['asis'])) {
                             $out .= $text;
                         } else {
                             $out .= $textwithnotags;
                         }
                         // show text with html cleaning
                         // End Url
                         if (!empty($contents[$i][$j]['url'])) {
                             $out .= '</a>';
                         }
                         if (preg_match('/^<img/i', $text2) || !empty($contents[$i][$j]['asis2'])) {
                             $out .= $text2;
                         } else {
                             $out .= $text2withnotags;
                         }
                         // show text with html cleaning
                         if (!empty($textnoformat)) {
                             $out .= "\n" . $textnoformat . "\n";
                         }
                         $out .= "</td>\n";
                     }
                     $out .= "</tr>\n";
                 }
             }
         }
         if (!empty($head['text']) || !empty($head['sublink']) || !empty($head['subpicto']) || $nblines) {
             $out .= "</table>\n";
         }
         // If invisible box with no contents
         if (empty($head['text']) && empty($head['sublink']) && empty($head['subpicto']) && !$nblines) {
             $out .= "<br>\n";
         }
         $out .= "</div>\n";
         $out .= "<!-- Box " . get_class($this) . " end -->\n\n";
         if (!empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
             dol_filecache($cachedir, $filename, $out);
         }
     } else {
         dol_syslog(get_class($this) . '::showBoxCached');
         $out = dol_readcachefile($cachedir, $filename);
         print "<!-- Box " . get_class($this) . " from cache -->";
     }
     print $out;
 }
Exemplo n.º 12
0
								print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
								print img_picto($langs->trans("Enabled"),'on');
								print '</a>';
							//}
							//else
							//{
							//	print img_picto($langs->trans("Enabled"),'on');
							//}
							print "</td>";
						}
						else
						{
							if (versioncompare($module->phpmin,versionphparray()) > 0)
							{
								print "<td align=\"center\">\n";
								print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion",join('.',$module->phpmin))),'off');
								print "</td>";
							}
							else
							{
								print "<td align=\"center\">\n";
								print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
								print "</td>";
							}
						}

						// Info
						$htmltooltip =    ''.$langs->trans("Name").': '.$module->name;
						$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
						if ($modele->type == 'pdf')
						{
Exemplo n.º 13
0
});
</script>';
// Checkbox to select from free text
print '<input id="fillmanually" type="radio" ' . (!GETPOST("selectorforbarcode") || GETPOST("selectorforbarcode") == 'fillmanually' ? 'checked ' : '') . 'name="selectorforbarcode" value="fillmanually" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueManually") . ' &nbsp; ';
print '<br>';
print '<input id="fillfromproduct" type="radio" ' . (GETPOST("selectorforbarcode") == 'fillfromproduct' ? 'checked ' : '') . 'name="selectorforbarcode" value="fillfromproduct" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueFromProduct") . ' &nbsp; ';
print '<br>';
print '<div class="showforproductselector">';
$form->select_produits(GETPOST('productid'), 'productid', '');
print ' &nbsp; <input type="submit" id="submitproduct" name="submitproduct" class="button" value="' . dol_escape_htmltag($langs->trans("GetBarCode")) . '">';
print '</div>';
print '<input id="fillfromthirdparty" type="radio" ' . (GETPOST("selectorforbarcode") == 'fillfromthirdparty' ? 'checked ' : '') . 'name="selectorforbarcode" value="fillfromthirdparty" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueFromThirdParty") . ' &nbsp; ';
print '<br>';
print '<div class="showforthirdpartyselector">';
print $form->select_company(GETPOST('socid'), 'socid', '', 1, 0, 0, array(), 0, 'minwidth300');
print ' &nbsp; <input type="submit" id="submitthirdparty" name="submitthirdparty" class="button showforthirdpartyselector" value="' . dol_escape_htmltag($langs->trans("GetBarCode")) . '">';
print '</div>';
print '<br>';
if ($producttmp->id > 0) {
    print $langs->trans("BarCodeDataForProduct", '') . ' ' . $producttmp->getNomUrl(1) . '<br>';
}
if ($thirdpartytmp->id > 0) {
    print $langs->trans("BarCodeDataForThirdparty", '') . ' ' . $thirdpartytmp->getNomUrl(1) . '<br>';
}
print '<div class="tagtable">';
// Barcode type
print '	<div class="tagtr">';
print '	<div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
print $langs->trans("BarcodeType") . ' &nbsp; ';
print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbarcode.class.php';
Exemplo n.º 14
0
 /**
  *      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
  *      @return string 			         String with URL
  */
 function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '')
 {
     global $langs, $conf;
     $result = '';
     if ($option == 'withdraw') {
         $url = DOL_URL_ROOT . '/compta/facture/prelevement.php?facid=' . $this->id;
     } else {
         $url = DOL_URL_ROOT . '/compta/facture.php?facid=' . $this->id;
     }
     if ($short) {
         return $url;
     }
     $picto = 'bill';
     if ($this->type == self::TYPE_REPLACEMENT) {
         $picto .= 'r';
     }
     // Replacement invoice
     if ($this->type == self::TYPE_CREDIT_NOTE) {
         $picto .= 'a';
     }
     // Credit note
     if ($this->type == self::TYPE_DEPOSIT) {
         $picto .= 'd';
     }
     // Deposit invoice
     $label = '<u>' . $langs->trans("ShowInvoice") . '</u>';
     if (!empty($this->ref)) {
         $label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
     }
     if (!empty($this->ref_client)) {
         $label .= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client;
     }
     if (!empty($this->total_ht)) {
         $label .= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
     }
     if (!empty($this->total_tva)) {
         $label .= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
     }
     if (!empty($this->total_ttc)) {
         $label .= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
     }
     if ($this->type == self::TYPE_REPLACEMENT) {
         $label = $langs->transnoentitiesnoconv("ShowInvoiceReplace") . ': ' . $this->ref;
     }
     if ($this->type == self::TYPE_CREDIT_NOTE) {
         $label = $langs->transnoentitiesnoconv("ShowInvoiceAvoir") . ': ' . $this->ref;
     }
     if ($this->type == self::TYPE_DEPOSIT) {
         $label = $langs->transnoentitiesnoconv("ShowInvoiceDeposit") . ': ' . $this->ref;
     }
     if ($this->type == self::TYPE_SITUATION) {
         $label = $langs->transnoentitiesnoconv("ShowInvoiceSituation") . ': ' . $this->ref;
     }
     if ($moretitle) {
         $label .= ' - ' . $moretitle;
     }
     $linkstart = '<a href="' . $url . '" title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip">';
     $linkend = '</a>';
     if ($withpicto) {
         $result .= $linkstart . img_object($max ? dol_trunc($label, $max) : $label, $picto, 'class="classfortooltip"') . $linkend;
     }
     if ($withpicto && $withpicto != 2) {
         $result .= ' ';
     }
     if ($withpicto != 2) {
         $result .= $linkstart . ($max ? dol_trunc($this->ref, $max) : $this->ref) . $linkend;
     }
     return $result;
 }
Exemplo n.º 15
0
		$url=$_SERVER["PHP_SELF"].'?action=gotodemo&amp;urlfrom='.urlencode($_SERVER["PHP_SELF"]);
		$urlwithmod=$url.'&amp;demochoice='.$profilearray['key'];
		// Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
		//print "xx".$_SERVER["PHP_SELF"].' '.DOL_URL_ROOT.'<br>';
		$urlfrom=preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/i','',$_SERVER["PHP_SELF"]);
		//print $urlfrom;
		if (! empty($profilearray['url'])) $urlwithmod=$profilearray['url'];

		//if ($i % $NBOFCOLS == 0) print '<tr>';
		//print '<tr>';
		//print '<td>'."\n";

		print '<form method="POST" name="form'.$profilearray['key'].'" action="'.$_SERVER["PHP_SELF"].'">'."\n";
		print '<input type="hidden" name="action" value="gotodemo">'."\n";
        print '<input type="hidden" name="urlfrom" value="'.dol_escape_htmltag($urlfrom).'">'."\n";
        print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
        print '<input type="hidden" name="username" value="demo">'."\n";
        print '<input type="hidden" name="dol_hide_topmenu" value="'.$conf->dol_hide_topmenu.'">'."\n";
        print '<input type="hidden" name="dol_hide_leftmenu" value="'.$conf->dol_hide_leftmenu.'">'."\n";
        print '<input type="hidden" name="dol_optimize_smallscreen" value="'.$conf->dol_optimize_smallscreen.'">'."\n";
        print '<input type="hidden" name="dol_no_mouse_hover" value="'.$conf->dol_no_mouse_hover.'">'."\n";
        print '<input type="hidden" name="dol_use_jmobile" value="'.$conf->dol_use_jmobile.'">'."\n";

        print '<table summary="Dolibarr online demonstration for profile '.$profilearray['label'].'" style="font-size:14px;" width="100%" class="CTable CTableRow'.($i%2==0?'1':'0').'">'."\n";
		// Title
        print '<tr>';
		print '<td width="50" id="a1'.$profilearray['key'].'" class="'.(empty($profilearray['url'])?'modulelineshow cursorpointer':'nomodulelines').'"><a href="'.$urlwithmod.'" class="'.(empty($profilearray['url'])?'modulelineshow':'nomodulelines').'"><img src="'.$profilearray['icon'].'" width="48" border="0" alt="Demo '.$profilearray['label'].'"></a></td>';
		print '<td id="a2'.$profilearray['key'].'" class="'.(empty($profilearray['url'])?'modulelineshow cursorpointer':'nomodulelines').'"><a href="'.$urlwithmod.'" class="'.(empty($profilearray['url'])?'modulelineshow':'nomodulelines').'">'.$langs->trans($profilearray['label']).'</a></td>';
		print '</tr>'."\n";
        // Modules
Exemplo n.º 16
0
 /**
  *  Return clicable name (with picto eventually)
  *
  *	@param	int		$withpicto		0=No picto, 1=Include picto into link, 2=Only picto
  *	@param	string	$option			Sur quoi pointe le lien
  *	@return	string					Chaine avec URL
  */
 function getNomUrl($withpicto = 0, $option = '')
 {
     global $langs;
     $result = '';
     $label = $langs->trans("ShowPayment") . ': ' . $this->ref;
     $link = '<a href="' . DOL_URL_ROOT . '/compta/paiement/card.php?id=' . $this->id . '" title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip">';
     $linkend = '</a>';
     if ($withpicto) {
         $result .= $link . img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"') . $linkend;
     }
     if ($withpicto && $withpicto != 2) {
         $result .= ' ';
     }
     if ($withpicto != 2) {
         $result .= $link . ($this->ref ? $this->ref : $this->id) . $linkend;
     }
     return $result;
 }
Exemplo n.º 17
0
    print '<tr><td>' . $langs->trans('LangFile') . '</td><td><input type="text" size="30" name="langs" value="' . $menu->langs . '"></td><td>' . $langs->trans('DetailLangs') . '</td></tr>';
    // Position
    print '<tr><td>' . $langs->trans('Position') . '</td><td><input type="text" size="5" name="position" value="' . $menu->position . '"></td><td>' . $langs->trans('DetailPosition') . '</td></tr>';
    // Target
    print '<tr><td>' . $langs->trans('Target') . '</td><td><select class="flat" name="target">';
    print '<option value=""' . ($menu->target == "" ? ' selected' : '') . '>' . $langs->trans('') . '</option>';
    print '<option value="_blank"' . ($menu->target == "_blank" ? ' selected' : '') . '>' . $langs->trans('_blank') . '</option>';
    print '</select></td><td>' . $langs->trans('DetailTarget') . '</td></tr>';
    // Enabled
    print '<tr><td>' . $langs->trans('Enabled') . '</td><td><input type="text" size="60" name="enabled" value="' . dol_escape_htmltag($menu->enabled) . '"></td><td>' . $langs->trans('DetailEnabled');
    if (!empty($menu->enabled)) {
        print ' (' . $langs->trans("ConditionIsCurrently") . ': ' . yn(dol_eval($menu->enabled, 1)) . ')';
    }
    print '</td></tr>';
    // Perms
    print '<tr><td>' . $langs->trans('Rights') . '</td><td><input type="text" size="60" name="perms" value="' . dol_escape_htmltag($menu->perms) . '"></td><td>' . $langs->trans('DetailRight');
    if (!empty($menu->perms)) {
        print ' (' . $langs->trans("ConditionIsCurrently") . ': ' . yn(dol_eval($menu->perms, 1)) . ')';
    }
    print '</td></tr>';
    print '</table>';
    // Bouton
    print '<br><div class="center">';
    print '<input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">';
    print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
    print '</div>';
    print '</form>';
    print '<br>';
}
$db->close();
print '<table class="border" width="100%">';
print '<tr><td width="20%">' . $langs->trans('SalesRepresentative') . '</td>';
print '<td colspan="4">';
print $form->select_dolusers($agentid, 'agentid', 1);
print '</td></tr>';
// Start date
print '<td>' . $langs->trans('StartDate') . ' (' . $langs->trans("DateValidation") . ')</td>';
print '<td width="20%">';
$form->select_date($startdate, 'startdate', '', '', 1, "sel", 1, 1);
print '</td>';
print '<td width="20%">' . $langs->trans('EndDate') . ' (' . $langs->trans("DateValidation") . ')</td>';
print '<td width="20%">';
$form->select_date($enddate, 'enddate', '', '', 1, "sel", 1, 1);
print '</td>';
print '<td style="text-align: center;">';
print '<input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Launch')) . '" />';
print '</td></tr>';
print "</table>";
print '</form>';
$sql = "SELECT";
if ($agentid > 0) {
    $sql .= " s.rowid as socid, s.nom, s.code_client, s.client,";
}
$sql .= " u.rowid as agent, u.login, u.lastname, u.firstname,";
$sql .= " sum(d.total_ht) as selling_price,";
$sql .= " sum(" . $db->ifsql('d.total_ht < 0', 'd.qty * d.buy_price_ht * -1', 'd.qty * d.buy_price_ht') . ") as buying_price,";
$sql .= " sum(" . $db->ifsql('d.total_ht < 0', '-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))', 'd.total_ht - (d.buy_price_ht * d.qty)') . ") as marge";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
$sql .= ", " . MAIN_DB_PREFIX . "facture as f";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = " . (empty($conf->global->AGENT_CONTACT_TYPE) ? -1 : $conf->global->AGENT_CONTACT_TYPE);
$sql .= ", " . MAIN_DB_PREFIX . "facturedet as d";
Exemplo n.º 19
0
                        print '<a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('Modify') . '</a>';
                    }
                }
                if ($object->statut == 0) {
                    if ($user->rights->deplacement->creer) {
                        print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=validate&id=' . $id . '">' . $langs->trans('Validate') . '</a>';
                    } else {
                        print '<a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('Validate') . '</a>';
                    }
                }
                if ($object->statut == 1) {
                    if ($user->rights->deplacement->creer) {
                        print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=classifyrefunded&id=' . $id . '">' . $langs->trans('ClassifyRefunded') . '</a>';
                    } else {
                        print '<a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('ClassifyRefunded') . '</a>';
                    }
                }
                if ($user->rights->deplacement->supprimer) {
                    print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=delete&id=' . $id . '">' . $langs->trans('Delete') . '</a>';
                } else {
                    print '<a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('Delete') . '</a>';
                }
                print '</div>';
            }
        } else {
            dol_print_error($db);
        }
    }
}
llxFooter();
$db->close();
Exemplo n.º 20
0
 $duration = '';
 if ($contractline->fk_product) {
     if ($product->isservice() && $product->duration_value > 0) {
         $label = $langs->trans("Duration");
         // TODO Put this in a global method
         if ($product->duration_value > 1) {
             $dur = array("h" => $langs->trans("Hours"), "d" => $langs->trans("DurationDays"), "w" => $langs->trans("DurationWeeks"), "m" => $langs->trans("DurationMonths"), "y" => $langs->trans("DurationYears"));
         } else {
             $dur = array("h" => $langs->trans("Hour"), "d" => $langs->trans("DurationDay"), "w" => $langs->trans("DurationWeek"), "m" => $langs->trans("DurationMonth"), "y" => $langs->trans("DurationYear"));
         }
         $duration = $product->duration_value . ' ' . $dur[$product->duration_unit];
     }
 }
 print '<tr class="CTableRow' . ($var ? '1' : '2') . '"><td class="CTableRow' . ($var ? '1' : '2') . '">' . $label . '</td>';
 print '<td class="CTableRow' . ($var ? '1' : '2') . '"><b>' . ($duration ? $duration : $qty) . '</b>';
 print '<input type="hidden" name="newqty" value="' . dol_escape_htmltag($qty) . '">';
 print '</b></td></tr>' . "\n";
 // Amount
 $var = !$var;
 print '<tr class="CTableRow' . ($var ? '1' : '2') . '"><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("Amount");
 if (empty($amount)) {
     print ' (' . $langs->trans("ToComplete") . ')';
 }
 print '</td><td class="CTableRow' . ($var ? '1' : '2') . '">';
 if (empty($amount) || !is_numeric($amount)) {
     print '<input type="hidden" name="amount" value="' . GETPOST("amount", 'int') . '">';
     print '<input class="flat" size=8 type="text" name="newamount" value="' . GETPOST("newamount", "int") . '">';
 } else {
     print '<b>' . price($amount) . '</b>';
     print '<input type="hidden" name="amount" value="' . $amount . '">';
     print '<input type="hidden" name="newamount" value="' . $amount . '">';
Exemplo n.º 21
0
						});
						
						$("#amountpayment").change(function() {
							callForResult();
						});';
            }
            print '});
			</script>' . "\n";
        }
        print '<form id="payment_form" name="add_paiement" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
        print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
        print '<input type="hidden" name="action" value="add_paiement">';
        print '<input type="hidden" name="facid" value="' . $facture->id . '">';
        print '<input type="hidden" name="socid" value="' . $facture->socid . '">';
        print '<input type="hidden" name="type" value="' . $facture->type . '">';
        print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="' . dol_escape_htmltag($facture->client->name) . '">';
        print '<table class="border" width="100%">';
        // Third party
        print '<tr><td><span class="fieldrequired">' . $langs->trans('Company') . '</span></td><td colspan="2">' . $facture->client->getNomUrl(4) . "</td></tr>\n";
        // Date payment
        print '<tr><td><span class="fieldrequired">' . $langs->trans('Date') . '</span></td><td>';
        $datepayment = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
        $datepayment = $datepayment == '' ? empty($conf->global->MAIN_AUTOFILL_DATE) ? -1 : 0 : $datepayment;
        $html->select_date($datepayment, '', '', '', 0, "add_paiement", 1, 1);
        print '</td>';
        print '<td>' . $langs->trans('Comments') . '</td></tr>';
        $rowspan = 5;
        if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_JS_ON_PAYMENT)) {
            $rowspan++;
        }
        // Payment mode
Exemplo n.º 22
0
		print '</td>';
		print '<td class="liste_titre" colspan="1" align="right">';
		print $langs->trans('Month').': <input class="flat" type="text" size="2" maxlength="2" name="month" value="'.$month.'">';
		print '&nbsp;'.$langs->trans('Year').': ';
		$syear = $year;
		if($syear == '')
		$syear = date("Y");
		$htmlother->select_year($syear,'year',1, 20, 5);
		print '</td>';
		print '<td class="liste_titre" align="right">';
		print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$_GET['search_montant_ht'].'">';
		print '</td>';
		print '<td class="liste_titre" align="right">';
		$html->select_propal_statut($viewstatut);
		print '</td>';
		print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
		print '</td>';
		print "</tr>\n";
		print '</form>';

		while ($i < min($num, $limit))
		{
			$objp = $db->fetch_object($result);

			$var=!$var;
			print "<tr $bc[$var]>";
			print '<td nowrap="nowrap">';

			$propalstatic->id=$objp->propalid;
			$propalstatic->ref=$objp->ref;
Exemplo n.º 23
0
 /**
  *	Return clicable name (with picto eventually)
  *
  *	@param	int		$withpicto		0=No picto, 1=Include picto into link, 2=Only picto
  *	@param	string	$option			'withproject' or ''
  *  @param	string	$mode			Mode 'task', 'time', 'contact', 'note', document' define page to link to.
  * 	@param	int		$addlabel		0=Default, 1=Add label into string, >1=Add first chars into string
  *  @param	string	$sep			Separator between ref and label if option addlabel is set
  *	@return	string					Chaine avec URL
  */
 function getNomUrl($withpicto = 0, $option = '', $mode = 'task', $addlabel = 0, $sep = ' - ')
 {
     global $langs;
     $result = '';
     $label = '<u>' . $langs->trans("ShowTask") . '</u>';
     if (!empty($this->ref)) {
         $label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
     }
     if (!empty($this->label)) {
         $label .= '<br><b>' . $langs->trans('LabelTask') . ':</b> ' . $this->label;
     }
     if ($this->date_start || $this->date_end) {
         $label .= "<br>" . get_date_range($this->date_start, $this->date_end, '', $langs, 0);
     }
     $linkclose = '" title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip">';
     $link = '<a href="' . DOL_URL_ROOT . '/projet/tasks/' . $mode . '.php?id=' . $this->id . ($option == 'withproject' ? '&withproject=1' : '') . $linkclose;
     $linkend = '</a>';
     $picto = 'projecttask';
     if ($withpicto) {
         $result .= $link . img_object($label, $picto, 'class="classfortooltip"') . $linkend;
     }
     if ($withpicto && $withpicto != 2) {
         $result .= ' ';
     }
     if ($withpicto != 2) {
         $result .= $link . $this->ref . $linkend . ($addlabel && $this->label ? $sep . dol_trunc($this->label, $addlabel > 1 ? $addlabel : 0) : '');
     }
     return $result;
 }
Exemplo n.º 24
0
    }
    $var = !$var;
    print "</table>\n";
    $db->free($resql);
} else {
    dol_print_error($db);
}
print '</div>';
/*
 * Boutons Actions
 */
print '<div class="tabsAction">';
if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
    if ($user->societe_id == 0 && $object->statut == 0 && $_GET['action'] == '') {
        if ($user->rights->facture->paiement) {
            print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '&amp;facid=' . $objp->facid . '&amp;action=valide">' . $langs->trans('Valid') . '</a>';
        }
    }
}
if ($user->societe_id == 0 && $action == '') {
    if ($user->rights->facture->paiement) {
        if (!$disable_delete) {
            print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '&amp;action=delete">' . $langs->trans('Delete') . '</a>';
        } else {
            print '<a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid")) . '">' . $langs->trans('Delete') . '</a>';
        }
    }
}
print '</div>';
llxFooter();
$db->close();
Exemplo n.º 25
0
	         <label>X2 <input type="text" size="4" id="x2" name="x2" /></label>
	         <label>Y2 <input type="text" size="4" id="y2" name="y2" /></label>
	         <label>W <input type="text" size="4" id="w" name="w" /></label>
	         <label>H <input type="text" size="4" id="h" name="h" /></label>
	      </div>

	      <input type="hidden" id="file" name="file" value="' . urlencode($original_file) . '" />
	      <input type="hidden" id="action" name="action" value="confirm_crop" />
	      <input type="hidden" id="product" name="product" value="' . $id . '" />
	      <input type="hidden" id="refsizeforcrop" name="refsizeforcrop" value="' . $refsizeforcrop . '" />
	      <input type="hidden" id="ratioforcrop" name="ratioforcrop" value="' . $ratioforcrop . '" />
	      <input type="hidden" name="id" value="' . $id . '" />
	      <br>
	      <input type="submit" id="submitcrop" name="submitcrop" class="button" value="' . dol_escape_htmltag($langs->trans("Recenter")) . '" />
	      &nbsp;
	      <input type="submit" id="cancelcrop" name="cancel" class="button" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '" />
	   </form>' . "\n";
    print '</fieldset>' . "\n";
    print '<br>';
}
/* Check that mandatory fields are filled */
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
	$("#submitcrop").click(function(e) {
	    var idClicked = e.target.id;
	    if (parseInt(jQuery(\'#w\').val())) return true;
	    alert(\'' . dol_escape_js($langs->trans("ErrorFieldRequired", $langs->trans("Dimension"))) . '\');
	    return false;
	});
});
</script>';
Exemplo n.º 26
0
 /**
  * Show array with linked files
  *
  * @param 	Object		$object			Object
  * @param 	int			$permtodelete	Deletion is allowed
  * @param 	string		$action			Action
  * @param 	string		$selected		???
  * @param	string		$param			More param to add into URL
  * @return 	int							Number of links
  */
 public function listOfLinks($object, $permtodelete = 1, $action = null, $selected = null, $param = '')
 {
     global $user, $conf, $langs, $user;
     global $bc;
     global $sortfield, $sortorder;
     $langs->load("link");
     require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
     $link = new Link($this->db);
     $links = array();
     if ($sortfield == "name") {
         $sortfield = "label";
     } elseif ($sortfield == "date") {
         $sortfield = "datea";
     } else {
         $sortfield = null;
     }
     $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder);
     $param .= isset($object->id) ? '&id=' . $object->id : '';
     // Show list of associated links
     print load_fiche_titre($langs->trans("LinkedFiles"));
     print '<form action="' . $_SERVER['PHP_SELF'] . ($param ? '?' . $param : '') . '" method="POST">';
     print '<table width="100%" class="liste">';
     print '<tr class="liste_titre">';
     print_liste_field_titre($langs->trans("Links"), $_SERVER['PHP_SELF'], "name", "", $param, 'align="left"', $sortfield, $sortorder);
     print_liste_field_titre("", "", "", "", "", 'align="right"');
     print_liste_field_titre($langs->trans("Date"), $_SERVER['PHP_SELF'], "date", "", $param, 'align="center"', $sortfield, $sortorder);
     print_liste_field_titre('', $_SERVER['PHP_SELF'], "", "", $param, 'align="center"');
     print_liste_field_titre('', '', '');
     print '</tr>';
     $nboflinks = count($links);
     if ($nboflinks > 0) {
         include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
     }
     $var = true;
     foreach ($links as $link) {
         $var = !$var;
         print '<tr ' . $bc[$var] . '>';
         //edit mode
         if ($action == 'update' && $selected === $link->id) {
             print '<td>';
             print '<input type="hidden" name="id" value="' . $object->id . '">';
             print '<input type="hidden" name="linkid" value="' . $link->id . '">';
             print '<input type="hidden" name="action" value="confirm_updateline">';
             print $langs->trans('Link') . ': <input type="text" name="link" size="50" value="' . $link->url . '">';
             print '</td>';
             print '<td>';
             print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">';
             print '</td>';
             print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>';
             print '<td align="right"></td>';
             print '<td align="right">';
             print '<input type="submit" name="save" class="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '">';
             print '<input type="submit" name="cancel" class="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '">';
             print '</td>';
         } else {
             print '<td>';
             print '<a data-ajax="false" href="' . $link->url . '" target="_blank">';
             print $link->label;
             print '</a>';
             print '</td>' . "\n";
             print '<td align="right"></td>';
             print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>';
             print '<td align="center"></td>';
             print '<td align="right">';
             print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink" >' . img_edit() . '</a>';
             // id= is included into $param
             if ($permtodelete) {
                 print ' &nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>';
                 // id= is included into $param
             } else {
                 print '&nbsp;';
             }
             print '</td>';
         }
         print "</tr>\n";
     }
     if ($nboflinks == 0) {
         print '<tr ' . $bc[false] . '><td colspan="5">';
         print $langs->trans("NoLinkFound");
         print '</td></tr>';
     }
     print "</table>";
     print '</form>';
     return $nboflinks;
 }
Exemplo n.º 27
0
    $classviewhide = 'visible';
}
if (empty($conf->dol_use_jmobile)) {
    $head = ecm_prepare_dasboard_head('');
    dol_fiche_head($head, 'index_auto', '', 1, '');
}
// Start container of all panels
?>
<div id="containerlayout"> <!-- begin div id="containerlayout" -->
<div id="ecm-layout-north" class="toolbar largebutton">
<?php 
// Start top panel, toolbar
print '<div class="toolbarbutton">';
// Toolbar
$url = !empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS) ? '#' : $_SERVER["PHP_SELF"] . '?action=refreshmanual' . ($module ? '&amp;module=' . $module : '') . ($section ? '&amp;section=' . $section : '');
print '<a href="' . $url . '" class="toolbarbutton" title="' . dol_escape_htmltag($langs->trans('Refresh')) . '">';
print '<img id="refreshbutton" class="toolbarbutton" border="0" src="' . DOL_URL_ROOT . '/theme/common/view-refresh.png">';
print '</a>';
print '</div>';
// End top panel, toolbar
?>
</div>
<div id="ecm-layout-west" class="<?php 
echo $classviewhide;
?>
">
<?php 
// Start left area
// Confirmation de la suppression d'une ligne categorie
if ($action == 'delete_section') {
    print $form->formconfirm($_SERVER["PHP_SELF"] . '?section=' . $section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $ecmdir->label), 'confirm_deletesection', '', '', 1);
Exemplo n.º 28
0
 //print '<fieldset><legend>aaa</legend>';
 print '<table class="border" width="100%">';
 //print '<tr><td width="30%">'.$langs->trans('Date').'</td><td width="70%">'.dol_print_date($now,'day').'</td></tr>';
 // Filter
 print '<tr><td width="200">' . $langs->trans("DateChequeReceived") . '</td><td>';
 print $form->select_date($filterdate, 'fd', 0, 0, 1, '', 1, 1);
 print '</td></tr>';
 print '<tr><td>' . $langs->trans("BankAccount") . '</td><td>';
 print $form->select_comptes($filteraccountid, 'accountid', 0, 'courant <> 2', 1);
 print '</td></tr>';
 print '</table>';
 print '<center>';
 print '<input type="submit" class="button" name="filter" value="' . dol_escape_htmltag($langs->trans("ToFilter")) . '">';
 if ($filterdate || $filteraccountid > 0) {
     print ' &nbsp; ';
     print '<input type="submit" class="button" name="removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
 }
 print '</center>';
 //print '</fieldset>';
 print '</form>';
 print '<br>';
 $sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as chqid, ";
 $sql .= " b.amount, ba.label, b.emetteur, b.num_chq, b.banque";
 $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b,";
 $sql .= " " . MAIN_DB_PREFIX . "bank_account as ba";
 $sql .= " WHERE b.fk_type = 'CHQ'";
 $sql .= " AND b.fk_account = ba.rowid";
 $sql .= " AND ba.entity = " . $conf->entity;
 $sql .= " AND b.fk_bordereau = 0";
 $sql .= " AND b.amount > 0";
 if ($filterdate) {
Exemplo n.º 29
0
 $num = $db->num_rows($result);
 $i = 0;
 $urladd = "&amp;statut=" . $statut;
 print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, "bons.php", $urladd, $sortfield, $sortorder, '', $num);
 print "\n<!-- debut table -->\n";
 print '<table class="liste" width="100%">';
 print '<tr class="liste_titre">';
 print_liste_field_titre($langs->trans("WithdrawalsReceipts"), "bons.php", "p.ref", '', '', 'class="liste_titre"');
 print_liste_field_titre($langs->trans("Date"), "bons.php", "p.datec", "", "", 'class="liste_titre" align="center"');
 print '<td class="liste_titre" align="right">' . $langs->trans("Amount") . '</td>';
 print '</tr>';
 print '<tr class="liste_titre">';
 print '<form action="bons.php" method="GET">';
 print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="' . $search_line . '" size="10"></td>';
 print '<td class="liste_titre">&nbsp;</td>';
 print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '"></td>';
 print '</form>';
 print '</tr>';
 $var = True;
 while ($i < min($num, $conf->liste_limit)) {
     $obj = $db->fetch_object($result);
     $var = !$var;
     print "<tr " . $bc[$var] . "><td>";
     print $bon->LibStatut($obj->statut, 2);
     print "&nbsp;";
     print '<a href="fiche.php?id=' . $obj->rowid . '">' . $obj->ref . "</a></td>\n";
     print '<td align="center">' . dol_print_date($db->jdate($obj->datec), 'day') . "</td>\n";
     print '<td align="right">' . price($obj->amount) . "</td>\n";
     print "</tr>\n";
     $i++;
 }
Exemplo n.º 30
0
 /**
  *	Return clicable name (with picto eventually)
  *
  *	@param		int		$withpicto		0=No picto, 1=Include picto into link, 2=Only picto
  *	@param		string	$option			Sur quoi pointe le lien
  *	@return		string					Chaine avec URL
  */
 function getNomUrl($withpicto = 0, $option = '')
 {
     global $langs;
     $result = '';
     $text = $this->ref;
     // Sometimes ref contains label
     if (preg_match('/^\\((.*)\\)$/i', $text, $reg)) {
         // Label generique car entre parentheses. On l'affiche en le traduisant
         if ($reg[1] == 'paiement') {
             $reg[1] = 'Payment';
         }
         $text = $langs->trans($reg[1]);
     }
     $label = $langs->trans("ShowPayment") . ': ' . $text;
     $link = '<a href="' . DOL_URL_ROOT . '/fourn/paiement/card.php?id=' . $this->id . '" title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip">';
     $linkend = '</a>';
     if ($withpicto) {
         $result .= $link . img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"') . $linkend;
     }
     if ($withpicto && $withpicto != 2) {
         $result .= ' ';
     }
     if ($withpicto != 2) {
         $result .= $link . $text . $linkend;
     }
     return $result;
 }